Skip to main content

@context and Vocabularies

The @context maps the short keys in your JSON document onto the full IRIs that define what those keys mean. The SHACL shape is written entirely in terms of those full IRIs, so a document only validates properly if you use the properly declared prefixes.

The three most commonly used prefixes within Geoconnex are:

PrefixUsage
https://schema.org/Our default metadata vocabulary. Used for names, date ranges, organizational info, etc.
http://www.opengis.net/ont/geosparql#Used for defining geometries
https://www.opengis.net/def/schema/hy_features/hyf/Used for describing features with hydrological metadata like their flow network relationships
warning

When creating JSON-LD for Geoconnex, a common mistake is to set "@vocab": "https://schema.org/" and then write "@type": "schema:Place" without also declaring a schema prefix. JSON-LD does not expand schema:Place using @vocab; it is left as the opaque IRI schema:Place, which is not https://schema.org/Place. The shape never matches, and the validator rejects the document with:

the top level node of the jsonld must have '@type': 'schema:Place' or '@type': 'schema:Dataset'

Either declare the prefix and use schema: consistently (recommended), or use @vocab and write bare terms like "@type": "Place" and "name": "...". Do not mix the two.

All Prefixes used in Geoconnex​

The following is a list of prefixes used within Geoconnex.The first four are enough for most documents; the rest become useful as you add richer variable and method metadata but the downside is that their terms are less likely to be linked between datasets due to infrequent use.

The curl command in each row fetches a content-negotiated machine-readable version of the vocabulary as JSON-LD, RDF Turtle, or RDF/XML if you wish to introspect the vocabulary.

PrefixUsed forMachine-readable contentDocumentation
schemaCore vocabulary: names, descriptions, datasets, organizations, downloadscurl -L -H "Accept: application/ld+json" https://schema.org/version/latest/schemaorg-current-https.jsonldhttps://schema.org/docs/schemas.html
gspGeoSPARQL geometry (hasGeometry, asWKT, crs)curl -L -H "Accept: text/turtle" http://www.opengis.net/ont/geosparql#https://opengeospatial.github.io/ogc-geosparql/geosparql11/geo.html
hyfHY_Features: hydrologic location types, catchments, positions on a river networkcurl -L -H "Accept: text/turtle" https://www.opengis.net/def/schema/hy_features/hyf/https://docs.ogc.org/is/14-111r6/14-111r6.html
dcDublin Core: accrualPeriodicity, conformsTocurl -L -H "Accept: text/turtle" http://purl.org/dc/terms/https://www.dublincore.org/specifications/dublin-core/dcmi-terms/
qudtQuantities, units, dimensions and typescurl -L -H "Accept: text/turtle" http://qudt.org/schema/qudt/https://qudt.org/doc/DOC_SCHEMA-QUDT.html
qudt-unitsStandard unit identifiers for schema:unitCodecurl -L -H "Accept: text/turtle" http://qudt.org/vocab/unit/https://qudt.org/doc/DOC_VOCAB-UNITS.html
qudt-quantkindsKinds of measurement, e.g. VolumeFlowRatecurl -L -H "Accept: text/turtle" http://qudt.org/vocab/quantitykind/https://qudt.org/doc/DOC_VOCAB-QUANTITY-KINDS.html
locTypeODM2 site type classificationscurl -L -H "Accept: application/rdf+xml" "http://vocabulary.odm2.org/api/v1/sitetype/?format=skos"http://vocabulary.odm2.org/sitetype/
odm2varODM2 variable namescurl -L -H "Accept: application/rdf+xml" "http://vocabulary.odm2.org/api/v1/variablename/?format=skos"http://vocabulary.odm2.org/variablename/
odm2varTypeODM2 variable typescurl -L -H "Accept: application/rdf+xml" "http://vocabulary.odm2.org/api/v1/variabletype/?format=skos"http://vocabulary.odm2.org/variabletype/
dcatData catalog terms, e.g. dcat:temporalResolutioncurl -L -H "Accept: application/ld+json" https://www.w3.org/ns/dcat#https://www.w3.org/TR/vocab-dcat-3/
sosaSampling relationships, e.g. relating a well to an aquifercurl -L -H "Accept: text/turtle" http://www.w3.org/ns/sosa/https://www.w3.org/TR/vocab-ssn/
xsdXML Schema datatypes, used in typed literalsnot availablehttps://www.w3.org/TR/xmlschema-11-2/

Extending with your own terms​

The SHACL shape for Geoconnex is open. That means that properties it does not mention are allowed. You can use arbitrary vocabularies to add novel relationships within your data. However, novel ad-hoc metadata is likely to be ignored by downstream users of the graph due to a lack of linked relationships between datasets. You should therefore use existing vocabularies and defer to common shapes in the examples whenever possible.