Skip to content

Commit

Permalink
add json-ld template CSWFacadeDCAT
Browse files Browse the repository at this point in the history
  • Loading branch information
SpeckiJ committed Nov 18, 2024
1 parent 2bcb02c commit bf0d681
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pygeoapi-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ server:
pretty_print: true
limit: 10
# templates:
# path: /path/to/Jinja2/templates
# path: /path/to/Jinja2/templates
# static: /path/to/static/folder # css/js/img
map:
url: https://tile.openstreetmap.org/{z}/{x}/{y}.png
Expand Down Expand Up @@ -125,13 +125,9 @@ resources:
bbox: [ -180,-90,180,90 ]
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
providers:
- type: feature
- type: record
name: CSWFacadeDCAT
data: https://user.eumetsat.int/catalogue/elastic-csw/service
id_field: id
geometry:
x_field: long
y_field: lat
GEOkatalog.nrw:
type: collection
title: GEOkatalog.NRW
Expand All @@ -148,9 +144,11 @@ resources:
hreflang: en-US
extents:
spatial:
bbox: [ 5.90, 50.20, 9.50, 52.60]
bbox: [ 5.90, 50.20, 9.50, 52.60 ]
crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
linked-data:
item_template: schemas/dcat/dcat-template.jsonld
providers:
- type: feature
- type: record
name: CSWFacadeDCAT
data: https://apps.geoportal.nrw.de/csw/service
170 changes: 170 additions & 0 deletions pygeoapi/schemas/dcat/dcat-template.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
{
"@context": {
"type": "@type",
"coordinates": {
"@container": "@list",
"@id": "geojson:coordinates"
},
"bbox": {
"@container": "@list",
"@id": "geojson:bbox"
},
"href": {
"@type": "@id",
"@id": "oa:hasTarget"
},
"rel": {
"@context": {
"@base": "http://www.iana.org/assignments/relation/"
},
"@id": "http://www.iana.org/assignments/relation",
"@type": "@id"
},
"hreflang": "dct:language",
"title": "rdfs:label",
"length": "dct:extent",
"created": "dct:created",
"updated": "dct:modified",
"uriTemplate": {
"@type": "xsd:string",
"@id": "oa:hasTarget"
},
"id": "@id",
"properties": "@nest",
"geometry": "geojson:geometry",
"Feature": "geojson:Feature",
"FeatureCollection": "geojson:FeatureCollection",
"GeometryCollection": "geojson:GeometryCollection",
"LineString": "geojson:LineString",
"MultiLineString": "geojson:MultiLineString",
"MultiPoint": "geojson:MultiPoint",
"MultiPolygon": "geojson:MultiPolygon",
"Point": "geojson:Point",
"Polygon": "geojson:Polygon",
"features": {
"@container": "@set",
"@id": "geojson:features"
},
"links": {
"@context": {
"type": "dct:type"
},
"@id": "rdfs:seeAlso"
},
"time": {
"@id": "dct:temporal",
"@context": {
"interval": {
"@id": "w3ctime:hasTime",
"@container": "@list"
},
"resolution": "rec:iso8601period"
}
},
"description": {
"@container": "@set",
"@id": "dct:description"
},
"keywords": {
"@container": "@set",
"@id": "dcat:keyword"
},
"conformsTo": {
"@container": "@set",
"@id": "dct:conformsTo",
"@type": "@id"
},
"language": {
"@id": "rec:language",
"@context": {
"code": "rec:languageCode",
"name": "skos:prefLabel"
}
},
"languages": {
"@container": "@set",
"@id": "rec:languages",
"@context": {
"code": "rec:languageCode",
"name": "skos:prefLabel"
}
},
"resourceLanguages": {
"@container": "@set",
"@id": "rec:resourceLanguages",
"@context": {
"code": "rec:languageCode",
"name": "skos:prefLabel"
}
},
"externalIds": {
"@container": "@set",
"@id": "rec:scopedIdentifier",
"@context": {
"scheme": "rec:scheme",
"value": "rec:id"
}
},
"themes": {
"@container": "@set",
"@id": "rec:themes",
"@context": {
"concepts": {
"@id": "rec:concept",
"@context": {
"id": {
"@type": "xsd:string",
"@id": "rec:conceptID"
},
"url": {
"@type": "@id",
"@id": "dct:theme"
}
}
},
"scheme": "rec:scheme"
}
},
"formats": {
"@container": "@set",
"@id": "rec:format",
"@type": "@id"
},
"contacts": {
"@container": "@set",
"@id": "dcat:contactPoint",
"@type": "@id"
},
"license": "dcat:license",
"rights": "dcat:rights",
"linkTemplates": "rec:hasLinkTemplate",
"variables": {
"@container": "@id",
"@id": "rec:hasVariable",
"@context": {
"@base": "http://example.com/variables/",
"@vocab": "https://www.opengis.net/def/ogc-api/records/"
}
},
"geojson": "https://purl.org/geojson/vocab#",
"oa": "http://www.w3.org/ns/oa#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"dct": "http://purl.org/dc/terms/",
"xsd": "http://www.w3.org/2001/XMLSchema#",
"w3ctime": "http://www.w3.org/2006/time#",
"rec": "https://www.opengis.net/def/ogc-api/records/",
"dcat": "http://www.w3.org/ns/dcat#",
"skos": "http://www.w3.org/2004/02/skos/core#",
"owl": "http://www.w3.org/2002/07/owl#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"dctype": "http://purl.org/dc/dcmitype/",
"vcard": "http://www.w3.org/2006/vcard/ns#",
"prov": "http://www.w3.org/ns/prov#",
"foaf": "http://xmlns.com/foaf/0.1/",
"@version": 1.1
},
{% set _dummy = data.pop('@context') %}
{% set _dummy = data.pop('@id') %}
{% set repr_json = data|tojson %}
{{ repr_json[1:-1] }}
}

0 comments on commit bf0d681

Please sign in to comment.