{
  "name": "example_package",
  "id": "115f49c1-8603-463e-a908-68de98327266",
  "licenses": [
    {
      "name": "CC0-1.0",
      "path": "https://creativecommons.org/publicdomain/zero/1.0/",
      "title": "CC0 1.0"
    }
  ],
  "image": null,
  "version": "1.0",
  "created": "2021-03-02T17:22:33Z",
  "temporal": {
    "start": "2020-01-01",
    "end": "2021-01-10"
  },
  "resources": [
    {
      "name": "deployments",
      "path": "deployments.csv",
      "profile": "tabular-data-resource",
      "title": "Camera trap deployments",
      "format": "csv",
      "mediatype": "text/csv",
      "encoding": "utf-8",
      "schema": {
        "fields": [
          {
            "name": "deployment_id",
            "type": "string",
            "constraints": {
              "required": true,
              "unique": true
            }
          },
          {
            "name": "longitude",
            "type": "number",
            "constraints": {
              "required": true,
              "minimum": -180,
              "maximum": 180
            }
          },
          {
            "name": "latitude",
            "constraints": {
              "required": true
            }
          },
          {
            "name": "start",
            "type": "date",
            "format": "%x",
            "constraints": {
              "required": true
            }
          },
          {
            "name": "comments",
            "type": "string",
            "constraints": {
              "required": false
            }
          }
        ],
        "missingValues": ["", "NA", "NaN"],
        "primaryKey": "deployment_id"
      }
    },
    {
      "name": "observations",
      "path": ["observations_1.tsv", "observations_2.tsv"],
      "profile": "tabular-data-resource",
      "title": "Camera trap observations",
      "format": "csv",
      "mediatype": "text/csv",
      "encoding": "utf-8",
      "dialect": {
        "delimiter": "\t"
      },
      "schema": {
        "fields": [
          {
            "name": "observation_id",
            "type": "string",
            "constraints": {
              "required": true,
              "unique": true
            }
          },
          {
            "name": "deployment_id",
            "type": "string",
            "constraints": {
              "required": true
            }
          },
          {
            "name": "timestamp",
            "type": "datetime",
            "format": "%Y-%m-%dT%H:%M:%S%z",
            "constraints": {
              "required": true
            }
          },
          {
            "name": "scientific_name",
            "type": "string",
            "constraints": {
              "required": false
            }
          },
          {
            "name": "count",
            "type": "integer",
            "constraints": {
              "required": false,
              "minimum": 1
            }
          },
          {
            "name": "life_stage",
            "type": "string",
            "constraints": {
              "required": false,
              "enum": ["adult", "subadult", "juvenile", "offspring", "unknown"]
            }
          },
          {
            "name": "comments",
            "type": "string",
            "constraints": {
              "required": false
            }
          }
        ],
        "missingValues": ["", "NA", "NaN"],
        "primaryKey": "observation_id",
        "foreignKeys": [
          {
            "fields": "deployment_id",
            "reference": {
              "resource": "deployments",
              "fields": "deployment_id"
            }
          }
        ]
      }
    },
    {
      "name": "media",
      "data": [
        {
          "media_id": "aed5fa71-3ed4-4284-a6ba-3550d1a4de8d",
          "deployment_id": "1",
          "observation_id": "1-1",
          "timestamp": "2020-09-28 02:14:59+02:00",
          "file_path": "https://multimedia.agouti.eu/assets/aed5fa71-3ed4-4284-a6ba-3550d1a4de8d/file"
        },
        {
          "media_id": "da81a501-8236-4cbd-aa95-4bc4b10a05df",
          "deployment_id": "1",
          "observation_id": "1-1",
          "timestamp": "2020-09-28 02:15:00+02:00",
          "file_path": "https://multimedia.agouti.eu/assets/da81a501-8236-4cbd-aa95-4bc4b10a05df/file"
        },
        {
          "media_id": "0ba57608-3cf1-49d6-a5a2-fe680851024d",
          "deployment_id": "1",
          "observation_id": "1-1",
          "timestamp": "2020-09-28 02:15:01+02:00",
          "file_path": "https://multimedia.agouti.eu/assets/0ba57608-3cf1-49d6-a5a2-fe680851024d/file"
        }
      ],
      "profile": "tabular-data-resource",
      "title": "Camera trap media files",
      "schema": {
        "fields": [
          {
            "name": "media_id",
            "type": "string"
          },
          {
            "name": "deployment_id",
            "type": "string"
          },
          {
            "name": "observation_id",
            "type": "string"
          },
          {
            "name": "timestamp",
            "type": "datetime",
            "format": "%Y-%m-%d %H:%M:%S%z"
          },
          {
            "name": "file_path",
            "type": "string"
          }
        ],
        "primaryKey": "media_id",
        "foreignKeys": [
          {
            "fields": "deployment_id",
            "reference": {
              "resource": "deployments",
              "fields": "deployment_id"
            }
          },
          {
            "fields": "observation_id",
            "reference": {
              "resource": "observations",
              "fields": "observation_id"
            }
          }
        ]
      }
    }
  ]
}
