Skip to content

Commit 65ac663

Browse files
committed
added FAQ entry about adding measurements
1 parent 6c4d303 commit 65ac663

File tree

1 file changed

+77
-20
lines changed

1 file changed

+77
-20
lines changed

pages/faq.md

+77-20
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,6 @@ permalink: /faq/
55
toc: true
66
---
77

8-
{:id="x"}
9-
## How do I do x
10-
11-
Text
12-
13-
field 1 | field 2
14-
--- | ---
15-
x | 1
16-
y | 2
17-
18-
```SQL
19-
SELECT * FROM table
20-
```
21-
22-
{:id="y"}
23-
## How do I do y
24-
25-
...
26-
278
{:id="bboxes"}
289
## How to describe bounding boxes?
2910

@@ -51,7 +32,83 @@ If you have a use case for describing non-animal observations using camtrap-dp,
5132
{:id="measurements"}
5233
## How to include measurements in a data package?
5334

54-
todo
35+
There are two ways to include additional information (values not covered by the standard fields) in a camtrap-dp data package:
36+
- Using tags
37+
38+
Deployment and observation tables include `deploymentTags` and `observationTags` fields. These fields can be used to store additional information as pipe-delimited key:value pairs. For example, this is how temperature and snow cover information could be represented in the deployment table:
39+
40+
deploymentID | deploymentTags
41+
--- | ---
42+
dep1 | temperature:20 | snow_cover:false
43+
dep2 | temperature:-5 | snow_cover:true
44+
45+
There are some drawbacks to using this method. Storing additional information in the media table is not possible, since it does not contain a tags field. Additionally, data represented this way is difficult to parse.
46+
47+
- Using a custom table
48+
49+
A custom table can be added to the data package to store additional information. This requires providing a schema for the additional table. This schema has to contain the foreign key to the referenced table (`deploymentID`, `observationID` or `mediaID`) and the additional fields. This in an example schema for the deployment measurement table:
50+
```JSON
51+
{
52+
"name": "deployment-measurements",
53+
"title": "Deployment measurements",
54+
"description": "Table with weather measurements for deployments. Associated with deployments (`deploymentID`).",
55+
"fields": [
56+
{
57+
"name": "deploymentID",
58+
"description": "Identifier of the deployment. Foreign key to `deployments.deploymentID`.",
59+
"skos:broadMatch": "http://rs.tdwg.org/dwc/terms/parentEventID",
60+
"type": "string",
61+
"constraints": {
62+
"required": true
63+
},
64+
"example": "dep1"
65+
},
66+
{
67+
"name": "temperature",
68+
"description": "Temperature (in Celsius) at the time of the observation.)",
69+
"type": "number",
70+
"constraints": {
71+
"required": false,
72+
"minimum": -50,
73+
"maximum": 100
74+
},
75+
"example": 19.5
76+
},
77+
{
78+
"name": "snowCover",
79+
"description": "Snow cover present at the time of the observation.",
80+
"type": "boolean",
81+
"constraints": {
82+
"required": false
83+
},
84+
"example": true
85+
}
86+
],
87+
"foreignKeys": [
88+
{
89+
"fields": "deploymentID",
90+
"reference": {
91+
"resource": "deployments",
92+
"fields": "deploymentID"
93+
}
94+
}
95+
]
96+
}
97+
```
98+
99+
The schema has to be added to the `datapackage.json` file in the `resources` field.
100+
101+
This is an example table following the above schema:
102+
103+
deploymentID | temperature | snowCover
104+
--- | --- | ---
105+
dep1 | 20 | false
106+
dep2 | -5 | true
107+
108+
We recommend this approach for storing additional information. It allows for easy parsing and merging of tables and is more flexible than using tags.
109+
110+
For more details, see [this github issue](https://github.com/tdwg/camtrap-dp/issues/358).
111+
55112

56113
{:id="merge"}
57114
## How to merge data packages describing different projects?

0 commit comments

Comments
 (0)