diff --git a/_sources/feature/geojsonFeatureFGLenient/bblock.json b/_sources/feature/geojsonFeatureFGLenient/bblock.json index 8d0204f..d9262d3 100644 --- a/_sources/feature/geojsonFeatureFGLenient/bblock.json +++ b/_sources/feature/geojsonFeatureFGLenient/bblock.json @@ -13,6 +13,5 @@ "feature", "examples" ], - "group": "Examples", - "highlighted": true + "group": "Examples" } diff --git a/_sources/feature/geosparqlFeature/bblock.json b/_sources/feature/geosparqlFeature/bblock.json new file mode 100644 index 0000000..89df3a8 --- /dev/null +++ b/_sources/feature/geosparqlFeature/bblock.json @@ -0,0 +1,25 @@ +{ + "name": "Feature with GeoSPARQL geometry", + "abstract": "This example includes an uplift step to use a GeoSPARQL geometry in a GeoJSON object", + "status": "under-development", + "dateTimeAddition": "2024-07-30T00:00:00Z", + "itemClass": "schema", + "register": "ogc-building-block-examples", + "version": "1.0", + "dateOfLastChange": "2023-05-19", + "maturity": "development", + "scope": "unstable", + "tags": [ + "feature", + "examples" + ], + "group": "Examples", + "semanticUplift": { + "additionalSteps": [ + { + "type": "shacl", + "ref": "uplift/geometry.shacl" + } + ] + } +} diff --git a/_sources/feature/geosparqlFeature/context.jsonld b/_sources/feature/geosparqlFeature/context.jsonld new file mode 100644 index 0000000..00a906e --- /dev/null +++ b/_sources/feature/geosparqlFeature/context.jsonld @@ -0,0 +1,9 @@ +{ + "@context": { + "geojson": "https://purl.org/geojson/vocab#", + "geometry": { + "@id": "geojson:geometry", + "@type": "@json" + } + } +} \ No newline at end of file diff --git a/_sources/feature/geosparqlFeature/examples.yaml b/_sources/feature/geosparqlFeature/examples.yaml new file mode 100644 index 0000000..d5eb60a --- /dev/null +++ b/_sources/feature/geosparqlFeature/examples.yaml @@ -0,0 +1,5 @@ +- title: Sample feature + base-uri: http://example.com/features/ + snippets: + - language: json + ref: examples/feature.json \ No newline at end of file diff --git a/_sources/feature/geosparqlFeature/examples/feature.json b/_sources/feature/geosparqlFeature/examples/feature.json new file mode 100644 index 0000000..598ef23 --- /dev/null +++ b/_sources/feature/geosparqlFeature/examples/feature.json @@ -0,0 +1,20 @@ +{ + "id": "f1", + "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -111.67183507997295, + 40.056709946862874 + ], + [ + -111.71, + 40.156709946862874 + ] + ] + }, + "properties": { + "myProp": "Mandatory property example" + } +} diff --git a/_sources/feature/geosparqlFeature/schema.yaml b/_sources/feature/geosparqlFeature/schema.yaml new file mode 100644 index 0000000..8bff8be --- /dev/null +++ b/_sources/feature/geosparqlFeature/schema.yaml @@ -0,0 +1,5 @@ +allOf: + - $ref: bblocks://ogc.geo.features.feature + - properties: + geometry: + type: object \ No newline at end of file diff --git a/_sources/feature/geosparqlFeature/uplift/geometry.shacl b/_sources/feature/geosparqlFeature/uplift/geometry.shacl new file mode 100644 index 0000000..cde61d8 --- /dev/null +++ b/_sources/feature/geosparqlFeature/uplift/geometry.shacl @@ -0,0 +1,34 @@ +@prefix sh: . +@prefix rdf: . +@prefix geojson: . +@prefix : . + +:RectangleRulesShape + a sh:NodeShape ; + sh:targetSubjectsOf geojson:geometry ; + sh:rule [ + a sh:SPARQLRule ; + sh:construct """ + PREFIX geojson: + PREFIX geosparql: + PREFIX rdf: + CONSTRUCT { + $this geosparql:hasGeometry [ + geosparql:asGeoJson ?geojsonLiteral + ] + } + WHERE { + $this geojson:geometry ?geojson . + BIND(STRDT(STR(?geojson), geosparql:geoJSONLiteral) as ?geojsonLiteral) + } + """ ; + + # Only apply to geometries with type rdf:JSON + sh:condition [ + sh:property [ + sh:path geojson:geometry ; + sh:datatype rdf:JSON ; + ] ; + ] ; + ] ; +. \ No newline at end of file