{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://example.com/helcom-macroobservation.schema.yaml",
  "title": "HELCOM Macroobservation GeoJSON",
  "description": "GeoJSON schema for HELCOM Swedish EEZ macroobservation point data.",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "FeatureCollection"
      ]
    },
    "features": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "Feature"
            ]
          },
          "geometry": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "Point"
                ]
              },
              "coordinates": {
                "type": "array",
                "items": {
                  "type": "number"
                },
                "minItems": 2,
                "maxItems": 2
              }
            },
            "required": [
              "type",
              "coordinates"
            ]
          },
          "properties": {
            "type": "object",
            "properties": {
              "species": {
                "type": "string",
                "x-jsonld-id": "http://rs.tdwg.org/dwc/terms/scientificName",
                "x-jsonld-type": "http://www.w3.org/2001/XMLSchema#string"
              },
              "species_uri": {
                "type": "string",
                "format": "uri",
                "x-jsonld-id": "http://rs.tdwg.org/dwc/terms/taxonID",
                "x-jsonld-type": "@id"
              },
              "abundance": {
                "type": "string",
                "enum": [
                  "low",
                  "medium",
                  "high"
                ],
                "x-jsonld-id": "http://vocab.nerc.ac.uk/collection/P06"
              },
              "abundance_value": {
                "type": "number",
                "x-jsonld-id": "http://www.w3.org/ns/sosa/hasResult",
                "x-jsonld-type": "http://www.w3.org/2001/XMLSchema#double"
              },
              "observationTime": {
                "type": "string",
                "format": "date-time",
                "x-jsonld-id": "http://www.w3.org/ns/sosa/resultTime",
                "x-jsonld-type": "http://www.w3.org/2001/XMLSchema#dateTime"
              },
              "depth_m": {
                "type": "number",
                "x-jsonld-id": "http://vocab.nerc.ac.uk/collection/P01/current/DEPHZZ01",
                "x-jsonld-type": "http://www.w3.org/2001/XMLSchema#double"
              },
              "salinity_psu": {
                "type": "number",
                "x-jsonld-id": "http://vocab.nerc.ac.uk/collection/P01/current/PSALST01",
                "x-jsonld-type": "http://www.w3.org/2001/XMLSchema#double"
              },
              "sampleMethod": {
                "type": "string",
                "x-jsonld-id": "http://vocab.nerc.ac.uk/collection/Q01",
                "x-jsonld-type": "@id"
              },
              "source": {
                "type": "string",
                "x-jsonld-id": "http://purl.org/dc/terms/source"
              },
              "distance_from_gotland_km": {
                "type": "number",
                "x-jsonld-id": "http://vocab.nerc.ac.uk/collection/P01/current/DISTZZ01",
                "x-jsonld-type": "http://www.w3.org/2001/XMLSchema#double"
              },
              "provenance_urls": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uri"
                },
                "x-jsonld-id": "http://www.w3.org/ns/prov#wasDerivedFrom",
                "x-jsonld-type": "@id",
                "x-jsonld-container": "@set"
              }
            },
            "required": [
              "species",
              "abundance",
              "observationTime",
              "source",
              "provenance_urls"
            ]
          }
        },
        "required": [
          "type",
          "geometry",
          "properties"
        ]
      }
    }
  },
  "required": [
    "type",
    "features"
  ],
  "x-jsonld-extra-terms": {
    "cf": "http://cf-convention.org/Data/cf-standard-names/current/build/cf-standard-name-table.html",
    "Dataset": "http://www.w3.org/ns/dcat#Dataset",
    "title": "http://purl.org/dc/terms/title",
    "description": "http://purl.org/dc/terms/description",
    "spatial": "http://purl.org/dc/terms/spatial",
    "temporal": "http://purl.org/dc/terms/temporal",
    "provenance": "http://purl.org/dc/terms/provenance",
    "Location": "http://purl.org/dc/terms/Location",
    "lat": "http://www.w3.org/2003/01/geo/wgs84_pos#lat",
    "long": "http://www.w3.org/2003/01/geo/wgs84_pos#long",
    "prefLabel": "http://www.w3.org/2004/02/skos/core#prefLabel",
    "Observation": "http://www.w3.org/ns/sosa/Observation",
    "hasFeatureOfInterest": "http://www.w3.org/ns/sosa/hasFeatureOfInterest",
    "hasResult": "http://www.w3.org/ns/sosa/hasResult",
    "resultTime": "http://www.w3.org/ns/sosa/resultTime",
    "Concept": "http://www.w3.org/2004/02/skos/core#Concept",
    "inScheme": "http://www.w3.org/2004/02/skos/core#inScheme",
    "ConceptScheme": "http://www.w3.org/2004/02/skos/core#ConceptScheme",
    "ObservableProperty": "http://www.w3.org/ns/sosa/ObservableProperty",
    "observedProperty": {
      "x-jsonld-id": "http://www.w3.org/ns/sosa/observedProperty",
      "x-jsonld-type": "@id"
    },
    "wasDerivedFrom": "http://www.w3.org/ns/prov#wasDerivedFrom"
  },
  "x-jsonld-base": "urn:helcom:macroobservation:",
  "x-jsonld-prefixes": {
    "dcat": "http://www.w3.org/ns/dcat#",
    "dcterms": "http://purl.org/dc/terms/",
    "geo": "http://www.w3.org/2003/01/geo/wgs84_pos#",
    "skos": "http://www.w3.org/2004/02/skos/core#",
    "sosa": "http://www.w3.org/ns/sosa/",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "dwc": "http://rs.tdwg.org/dwc/terms/",
    "nerc": "http://vocab.nerc.ac.uk/collection/",
    "prov": "http://www.w3.org/ns/prov#",
    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "worms": "http://www.marinespecies.org/",
    "obis": "http://www.obis.org/"
  }
}