Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ples

# Conflicts:
#	build.sh
  • Loading branch information
rob-metalinkage committed Aug 1, 2024
2 parents 0720074 + feebc20 commit 5c6d209
Show file tree
Hide file tree
Showing 132 changed files with 2,559 additions and 38,255 deletions.
17 changes: 17 additions & 0 deletions _sources/feature/geojsonFeatureFGLenient/bblock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Custom JSON-FG (lenient) Feature",
"abstract": "This example shows a simple customisation method for a JSON-FG (lenient) feature",
"status": "under-development",
"dateTimeAddition": "2024-07-25T00: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"
}
17 changes: 17 additions & 0 deletions _sources/feature/geojsonFeatureFGLenient/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Custom Feature Type

This building block illustrates a typical "Feature Type" - where an object is modelled as a "Feature with geometry",
but has its own "native schema" - or "domain model". It uses JSON-FG (lenient) as its base.

This is an **interoperable** approach to defining a Feature, allowing re-use of a well-defined domain model.

i.e. the attributes (properties) are managed independently of the packaging container (Feature)

the **propertySet** building block referenced by this container may be used independently of the FeatureModel structure,
and is where semantic annotations are provided.

This building block **inherits** reusable semantic annotations for the Feature structure from a common library,
simplifying implementation.



8 changes: 8 additions & 0 deletions _sources/feature/geojsonFeatureFGLenient/examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- title: GeoJSON - specialisation example.
comment:
This examples shows how to define a customised schema based on an existing building block - in this case the OGC API Features basic GeoJSON Feature response

base-uri: http://example.com/features/
snippets:
- language: json
ref: examples/feature.json
23 changes: 23 additions & 0 deletions _sources/feature/geojsonFeatureFGLenient/examples/feature.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"id": "f1",
"type": "Feature",
"featureType": "app:building",
"coordRefSys": "http://www.opengis.net/def/crs/EPSG/0/5555",
"time": { "interval": ["2014-04-24T10:50:18Z", ".."] },
"geometry": {
"type": "LineString",
"coordinates": [
[
-111.67183507997295,
40.056709946862874
],
[
-111.71,
40.156709946862874
]
]
},
"properties": {
"myProp": "Mandatory property example"
}
}
7 changes: 7 additions & 0 deletions _sources/feature/geojsonFeatureFGLenient/schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"$schema": https://json-schema.org/draft/2020-12/schema
description: 'Example of a sinmple GeoJSON Feature specialisation'
allOf:
- $ref: bblocks://ogc.geo.json-fg.feature-lenient
- properties:
properties:
$ref: ../propertySet/schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.properties.myPropUpper = .properties.myProp | ascii_upcase
20 changes: 20 additions & 0 deletions _sources/feature/geojsonFeatureFGLenient/transforms/sample.shacl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@prefix mymodel: <http://example.org/myModel/> .
@prefix sh: <http://www.w3.org/ns/shacl#>.

<urn:example:LabelToDCTERMS>
a sh:NodeShape ;
sh:targetSubjectsOf mymodel:myProp;
sh:rule [
a sh:SPARQLRule ;
sh:construct """
prefix dcterms: <http://purl.org/dc/terms/>
prefix mymodel: <http://example.org/myModel/>
CONSTRUCT {
$this dcterms:identifier ?myPropUpper
} WHERE {
$this mymodel:myProp ?myProp
BIND(UCASE(?myProp) as ?myPropUpper)
}
"""
] ;
.
25 changes: 25 additions & 0 deletions _sources/feature/geosparqlFeature/bblock.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
}
9 changes: 9 additions & 0 deletions _sources/feature/geosparqlFeature/context.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"@context": {
"geojson": "https://purl.org/geojson/vocab#",
"geometry": {
"@id": "geojson:geometry",
"@type": "@json"
}
}
}
5 changes: 5 additions & 0 deletions _sources/feature/geosparqlFeature/examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- title: Sample feature
base-uri: http://example.com/features/
snippets:
- language: json
ref: examples/feature.json
20 changes: 20 additions & 0 deletions _sources/feature/geosparqlFeature/examples/feature.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
5 changes: 5 additions & 0 deletions _sources/feature/geosparqlFeature/schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
allOf:
- $ref: bblocks://ogc.geo.features.feature
- properties:
geometry:
type: object
34 changes: 34 additions & 0 deletions _sources/feature/geosparqlFeature/uplift/geometry.shacl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix geojson: <https://purl.org/geojson/vocab#> .
@prefix : <urn:ogc-bblocks:examples#> .

:RectangleRulesShape
a sh:NodeShape ;
sh:targetSubjectsOf geojson:geometry ;
sh:rule [
a sh:SPARQLRule ;
sh:construct """
PREFIX geojson: <https://purl.org/geojson/vocab#>
PREFIX geosparql: <http://www.opengis.net/ont/geosparql#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
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 ;
] ;
] ;
] ;
.
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,3 @@ path @id
/properties/IataCode
/properties/IcaoCode
/properties/Name
/MyFeature/type @type
/MyFeature/id @id
/MyFeature/properties @nest
/MyFeature/geometry https://purl.org/geojson/vocab#geometry
/MyFeature/geometry/type @type
/MyFeature/geometry/coordinates https://purl.org/geojson/vocab#coordinates
/MyFeature/geometry/bbox https://purl.org/geojson/vocab#bbox
/MyFeature/geometry/geometries
/MyFeature/geometry/geometries/type @type
/MyFeature/geometry/geometries/coordinates https://purl.org/geojson/vocab#coordinates
/MyFeature/geometry/geometries/bbox https://purl.org/geojson/vocab#bbox
/MyFeature/bbox https://purl.org/geojson/vocab#bbox
/MyFeature/links http://www.w3.org/2000/01/rdf-schema#seeAlso
/MyFeature/links/href http://www.w3.org/ns/oa#hasTarget
/MyFeature/links/rel http://www.iana.org/assignments/relation
/MyFeature/links/anchor
/MyFeature/links/type http://purl.org/dc/terms/type
/MyFeature/links/hreflang http://purl.org/dc/terms/language
/MyFeature/links/title http://www.w3.org/2000/01/rdf-schema#label
/MyFeature/links/length http://purl.org/dc/terms/extent
/MyFeature/properties/id
/MyFeature/properties/type
/MyFeature/properties/IataCode
/MyFeature/properties/IcaoCode
/MyFeature/properties/Name
Loading

0 comments on commit 5c6d209

Please sign in to comment.