generated from opengeospatial/bblock-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move SOSA ontology, rules and tests out of the API/JSON binding
- Loading branch information
1 parent
e02f06c
commit b12ef31
Showing
11 changed files
with
166 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "SOSA Examples", | ||
"highlighted": true, | ||
"abstract": "This Building Block identifies examples from the SOSA specification and supports validation of these examples", | ||
"status": "under-development", | ||
"dateTimeAddition": "2023-04-13T00:00:00Z", | ||
"itemClass": "schema", | ||
"register": "ogc-building-block-register", | ||
"version": "1.0", | ||
"dateOfLastChange": "2023-04-13", | ||
"sources": [ | ||
{ | ||
"title": "Semantic Sensor Network Ontology", | ||
"link": "https://www.w3.org/TR/vocab-ssn/" | ||
} | ||
], | ||
"dependsOn": [ | ||
"ogc.model.cross-domain.sosa" | ||
], | ||
"maturity": "development", | ||
"scope": "development", | ||
"tags": [ | ||
"sosa", | ||
"ssn", | ||
"observations", | ||
"o&m", | ||
"OMS" | ||
], | ||
"group": "SOSA", | ||
"highlighted": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<http://example.com/p1> a <http://example.com/types/Property>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## SOSA Specification Examples | ||
|
||
This building block runs tests against the SOSA specification examples. | ||
|
||
As TTL files these examples are validated against the SHACL rules inherited from the building blocks for elements of the specification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
prefixes: | ||
ex: http://example.org/sosa/ | ||
qudt: http://qudt.org/ | ||
qudt-1-1: http://qudt.org/ | ||
qunit: http://qudt.org/vocab/unit/ | ||
rdfs: http://www.w3.org/2000/01/rdf-schema# | ||
xsd: http://www.w3.org/2001/XMLSchema# | ||
sh: http://www.w3.org/ns/shacl# | ||
owl: http://www.w3.org/2002/07/owl# | ||
sosa: http://www.w3.org/ns/sosa/ | ||
ssn-system: http://www.w3.org/ns/ssn/systems/ | ||
examples: | ||
- title: Example ice-core.ttl | ||
snippets: | ||
- language: ttl | ||
ref: https://w3c.github.io/sdw-sosa-ssn/ssn/rdf/examples/ice-core.ttl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix geojson: <https://purl.org/geojson/vocab#> . | ||
@prefix sosa: <http://www.w3.org/ns/sosa/> . | ||
@base <https://www.ogc.org/rules/sosa/> . | ||
|
||
<#testRequiredTime> | ||
a sh:NodeShape ; | ||
sh:targetClass sosa:Observation ; | ||
sh:targetSubjectsOf sosa:hasResult, sosa:hasSimpleResult ; | ||
sh:message "sosa:resultTime or sosa:phenomenonTime is required, and no more than 1 of each is allowed" ; | ||
sh:or ( [ sh:path ( [ sh:zeroOrMorePath [ sh:oneOrMorePath [ sh:inversePath sosa:hasMember ] ] ] | ||
sosa:phenomenonTime ) ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; ] [ sh:path ( [ sh:zeroOrMorePath [ sh:oneOrMorePath [ sh:inversePath | ||
geojson:features ] ] ] | ||
sosa:phenomenonTime ) ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; ] [ sh:path ( [ sh:zeroOrMorePath [ sh:oneOrMorePath | ||
[ sh:inversePath | ||
sosa:hasMember ] ] ] | ||
sosa:resultTime ) ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; ] [ sh:path ( [ sh:zeroOrMorePath | ||
[ sh:oneOrMorePath | ||
[ sh:inversePath | ||
geojson:features ] ] ] | ||
sosa:resultTime ) ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; ] ) ; | ||
. | ||
|
||
<#testObservedProperty> | ||
a sh:NodeShape ; | ||
sh:targetClass sosa:Observation ; | ||
sh:targetSubjectsOf sosa:hasResult, sosa:hasSimpleResult ; | ||
sh:message "Exactly 1 of sosa:observedProperty is required" ; | ||
sh:property [ sh:path ( [ sh:zeroOrMorePath [ sh:oneOrMorePath [ sh:alternativePath ( [ sh:inversePath | ||
geojson:features ] | ||
[ sh:inversePath | ||
sosa:hasMember ] ) ] ] ] | ||
sosa:observedProperty ) ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; ] ; | ||
. | ||
|
||
|
||
<#testFeatureOfInterest> | ||
a sh:NodeShape ; | ||
sh:targetClass sosa:Observation ; | ||
sh:targetSubjectsOf sosa:hasResult, sosa:hasSimpleResult ; | ||
sh:property [ sh:path ( [ sh:zeroOrMorePath [ sh:oneOrMorePath [ sh:alternativePath ( [ sh:inversePath | ||
geojson:features ] | ||
[ sh:inversePath | ||
sosa:hasMember ] ) ] ] ] | ||
[ sh:alternativePath ( sosa:hasFeatureOfInterest [ sh:inversePath | ||
sosa:isFeatureOfInterestOf ] ) ] ) ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; ] ; | ||
sh:message "Exactly one feature of interest (sosa:hasFeatureOfInterest/sosa:isFeatureOfInterestOf) is required" ; | ||
. | ||
|
||
<#testResult> | ||
a sh:NodeShape ; | ||
sh:targetClass sosa:Observation ; | ||
sh:targetSubjectsOf sosa:hasResult, sosa:hasSimpleResult ; | ||
sh:property [ sh:path [ sh:alternativePath ( sosa:hasResult sosa:hasSimpleResult ) ] ; | ||
sh:minCount 1 ; | ||
sh:maxCount 1 ; ] ; | ||
sh:message "Exactly one of sosa:hasResult or sosa:hasSimpleResult is required per observation" ; | ||
. | ||
|
||
|
||
<#testSimpleResultLiteral> | ||
a sh:NodeShape ; | ||
sh:targetObjectsOf sosa:hasSimpleResult ; | ||
sh:nodeKind sh:IRIOrLiteral ; | ||
sh:message "sosa:hasSimpleResult is a simple Literal" ; | ||
. | ||
|
||
<#testResultNotEmptyNode> | ||
a sh:NodeShape ; | ||
sh:targetSubjectsOf sosa:hasResult-Disabled ; | ||
sh:message "sosa:hasResult not a blank node" ; | ||
sh:sparql [ sh:select """ | ||
PREFIX geojson: <https://purl.org/geojson/vocab#> | ||
SELECT $this (sosa:hasResult as ?path) ?value | ||
WHERE { | ||
$this sosa:hasResult ?value . | ||
FILTER NOT EXISTS { ?value ?p ?o } | ||
} | ||
""" ; ] | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Process building blocks | ||
docker run --pull=always --rm --workdir /workspace -v "$(pwd):/workspace" ghcr.io/opengeospatial/bblocks-postprocess --clean true --base-url http://localhost:9090/register/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker run --rm --pull=always -v "$(pwd):/register" -p 9090:9090 ghcr.io/ogcincubator/bblocks-viewer |