Skip to content

Commit b12ef31

Browse files
Move SOSA ontology, rules and tests out of the API/JSON binding
1 parent e02f06c commit b12ef31

File tree

11 files changed

+166
-9
lines changed

11 files changed

+166
-9
lines changed

_sources/all/bblock.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"name": "Cross Domain Model - All modules",
2+
"name": "Cross Domain Model (Complete)",
3+
"highlighted": true,
34
"abstract": "All modules of the Cross Domain model",
45
"status": "under-development",
56
"dateTimeAddition": "2023-09-18T00:00:00Z",
@@ -12,12 +13,13 @@
1213
"ogc.model.cross-domain.sosa",
1314
"ogc.model.cross-domain.prov",
1415
"ogc.model.cross-domain.geosparql",
15-
"ogc.model.cross-domain.datacube"
16+
"ogc.model.cross-domain.datacube",
17+
"ogc.geo.geodcat.geodcat"
1618
],
1719
"sources": [
1820
],
1921
"scope": "dev",
2022
"tags": [
21-
"Closure"
23+
"Closure", "Semantic Model"
2224
]
2325
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "SOSA Examples",
3+
"highlighted": true,
4+
"abstract": "This Building Block identifies examples from the SOSA specification and supports validation of these examples",
5+
"status": "under-development",
6+
"dateTimeAddition": "2023-04-13T00:00:00Z",
7+
"itemClass": "schema",
8+
"register": "ogc-building-block-register",
9+
"version": "1.0",
10+
"dateOfLastChange": "2023-04-13",
11+
"sources": [
12+
{
13+
"title": "Semantic Sensor Network Ontology",
14+
"link": "https://www.w3.org/TR/vocab-ssn/"
15+
}
16+
],
17+
"dependsOn": [
18+
"ogc.model.cross-domain.sosa"
19+
],
20+
"maturity": "development",
21+
"scope": "development",
22+
"tags": [
23+
"sosa",
24+
"ssn",
25+
"observations",
26+
"o&m",
27+
"OMS"
28+
],
29+
"group": "SOSA",
30+
"highlighted": false
31+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<http://example.com/p1> a <http://example.com/types/Property>.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## SOSA Specification Examples
2+
3+
This building block runs tests against the SOSA specification examples.
4+
5+
As TTL files these examples are validated against the SHACL rules inherited from the building blocks for elements of the specification
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
prefixes:
2+
ex: http://example.org/sosa/
3+
qudt: http://qudt.org/
4+
qudt-1-1: http://qudt.org/
5+
qunit: http://qudt.org/vocab/unit/
6+
rdfs: http://www.w3.org/2000/01/rdf-schema#
7+
xsd: http://www.w3.org/2001/XMLSchema#
8+
sh: http://www.w3.org/ns/shacl#
9+
owl: http://www.w3.org/2002/07/owl#
10+
sosa: http://www.w3.org/ns/sosa/
11+
ssn-system: http://www.w3.org/ns/ssn/systems/
12+
examples:
13+
- title: Example ice-core.ttl
14+
snippets:
15+
- language: ttl
16+
ref: https://w3c.github.io/sdw-sosa-ssn/ssn/rdf/examples/ice-core.ttl

_sources/sosa/bblock.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "SOSA/SSN",
3+
"highlighted": true,
34
"abstract": "Sensors, Observations, Sampling and Actuation (ISO 19156 Observations and Measurements) Ontology ",
45
"status": "under-development",
56
"dateTimeAddition": "2023-09-18T00:00:00Z",
@@ -9,13 +10,15 @@
910
"dateOfLastChange": "2023-09-18",
1011
"link": "https://github.com/opengeospatial/bblock-template",
1112
"dependsOn": [
12-
],
13+
],
1314
"sources": [
1415
{
1516
"title": "SOSA/SSN Specification",
1617
"link": "https://www.w3.org/TR/vocab-ssn/"
1718
}
1819
],
1920
"scope": "dev",
20-
"tags": ["DCAT", "profile"]
21+
"tags": [
22+
"OMS"
23+
]
2124
}

_sources/sosa/examples/place-expressions.ttl

Whitespace-only changes.

_sources/sosa/rules.shacl

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3+
@prefix sh: <http://www.w3.org/ns/shacl#> .
4+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
5+
@prefix geojson: <https://purl.org/geojson/vocab#> .
6+
@prefix sosa: <http://www.w3.org/ns/sosa/> .
7+
@base <https://www.ogc.org/rules/sosa/> .
8+
9+
<#testRequiredTime>
10+
a sh:NodeShape ;
11+
sh:targetClass sosa:Observation ;
12+
sh:targetSubjectsOf sosa:hasResult, sosa:hasSimpleResult ;
13+
sh:message "sosa:resultTime or sosa:phenomenonTime is required, and no more than 1 of each is allowed" ;
14+
sh:or ( [ sh:path ( [ sh:zeroOrMorePath [ sh:oneOrMorePath [ sh:inversePath sosa:hasMember ] ] ]
15+
sosa:phenomenonTime ) ;
16+
sh:minCount 1 ;
17+
sh:maxCount 1 ; ] [ sh:path ( [ sh:zeroOrMorePath [ sh:oneOrMorePath [ sh:inversePath
18+
geojson:features ] ] ]
19+
sosa:phenomenonTime ) ;
20+
sh:minCount 1 ;
21+
sh:maxCount 1 ; ] [ sh:path ( [ sh:zeroOrMorePath [ sh:oneOrMorePath
22+
[ sh:inversePath
23+
sosa:hasMember ] ] ]
24+
sosa:resultTime ) ;
25+
sh:minCount 1 ;
26+
sh:maxCount 1 ; ] [ sh:path ( [ sh:zeroOrMorePath
27+
[ sh:oneOrMorePath
28+
[ sh:inversePath
29+
geojson:features ] ] ]
30+
sosa:resultTime ) ;
31+
sh:minCount 1 ;
32+
sh:maxCount 1 ; ] ) ;
33+
.
34+
35+
<#testObservedProperty>
36+
a sh:NodeShape ;
37+
sh:targetClass sosa:Observation ;
38+
sh:targetSubjectsOf sosa:hasResult, sosa:hasSimpleResult ;
39+
sh:message "Exactly 1 of sosa:observedProperty is required" ;
40+
sh:property [ sh:path ( [ sh:zeroOrMorePath [ sh:oneOrMorePath [ sh:alternativePath ( [ sh:inversePath
41+
geojson:features ]
42+
[ sh:inversePath
43+
sosa:hasMember ] ) ] ] ]
44+
sosa:observedProperty ) ;
45+
sh:minCount 1 ;
46+
sh:maxCount 1 ; ] ;
47+
.
48+
49+
50+
<#testFeatureOfInterest>
51+
a sh:NodeShape ;
52+
sh:targetClass sosa:Observation ;
53+
sh:targetSubjectsOf sosa:hasResult, sosa:hasSimpleResult ;
54+
sh:property [ sh:path ( [ sh:zeroOrMorePath [ sh:oneOrMorePath [ sh:alternativePath ( [ sh:inversePath
55+
geojson:features ]
56+
[ sh:inversePath
57+
sosa:hasMember ] ) ] ] ]
58+
[ sh:alternativePath ( sosa:hasFeatureOfInterest [ sh:inversePath
59+
sosa:isFeatureOfInterestOf ] ) ] ) ;
60+
sh:minCount 1 ;
61+
sh:maxCount 1 ; ] ;
62+
sh:message "Exactly one feature of interest (sosa:hasFeatureOfInterest/sosa:isFeatureOfInterestOf) is required" ;
63+
.
64+
65+
<#testResult>
66+
a sh:NodeShape ;
67+
sh:targetClass sosa:Observation ;
68+
sh:targetSubjectsOf sosa:hasResult, sosa:hasSimpleResult ;
69+
sh:property [ sh:path [ sh:alternativePath ( sosa:hasResult sosa:hasSimpleResult ) ] ;
70+
sh:minCount 1 ;
71+
sh:maxCount 1 ; ] ;
72+
sh:message "Exactly one of sosa:hasResult or sosa:hasSimpleResult is required per observation" ;
73+
.
74+
75+
76+
<#testSimpleResultLiteral>
77+
a sh:NodeShape ;
78+
sh:targetObjectsOf sosa:hasSimpleResult ;
79+
sh:nodeKind sh:IRIOrLiteral ;
80+
sh:message "sosa:hasSimpleResult is a simple Literal" ;
81+
.
82+
83+
<#testResultNotEmptyNode>
84+
a sh:NodeShape ;
85+
sh:targetSubjectsOf sosa:hasResult-Disabled ;
86+
sh:message "sosa:hasResult not a blank node" ;
87+
sh:sparql [ sh:select """
88+
PREFIX geojson: <https://purl.org/geojson/vocab#>
89+
SELECT $this (sosa:hasResult as ?path) ?value
90+
WHERE {
91+
$this sosa:hasResult ?value .
92+
FILTER NOT EXISTS { ?value ?p ?o }
93+
}
94+
""" ; ]
95+
.

bblocks-config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ name: Cross-domain model
33

44
# Short abstract for this collection (optional)
55
abstract: |
6-
Defines a cross-domain semantic model by articulating a series of profiles and dependencies on available standards and a minimum set of constraints for application in the spatio-temporal domain.
6+
Defines a reusable baseline "cross-domain semantic model" by defining a series of profiles and dependencies on available standards and where appropriate a set of constraints for application of such standards in the spatio-temporal domain.
77
88
# Description for this collection (optional)
99
description: |
1010
11-
These building blocks allow for transparent reuse of a range of semantic models published by OGC and other international standards organisations that may be used to define semantics models for application domains.
11+
These models are defined as ["building blocks"](https://ogcincubator.github.io/bblocks-docs/) to allow for transparent reuse of a range of semantic models published by OGC and other international standards organisations (SDO) that may be used to define semantic models for application domains in a consistent and interoperable way.
1212
13-
Application domains will typically define profiles of these core models to meet specific needs. Infrastructures may define profiles to support commonality of implementation necessary to exploit infrastructure services.
13+
Application domains will typically define profiles of these core models to meet specific needs. Infrastructures supporting application domains may define more general profiles to support commonality of implementation necessary to exploit infrastructure services.
1414
1515
The Cross-domain model underpins proposed domain models for Agriculture, Oceans and AG4DG.
1616
By defining these models using this common cross-domain model the interoperability between such domains is enhanced, and made transparent to applications.
@@ -25,14 +25,15 @@ description: |
2525
This will dramatically reduce the complexity of defining and testing domain models in a consistent fashion.
2626
2727
Many such restrictions will relate to the way these models are combined -
28-
for example the way GeoDCAT, PROV, RDF-Datacube and SOSA may be combined to standardised the way observational data is described using available standards.
28+
for example the way GeoDCAT, PROV, RDF-Datacube and SOSA may be combined to standardise the way observational data is described using available standards.
2929
3030
# Customize the following prefix (will be prepended to the path of the building blocks):
3131
identifier-prefix: ogc.model.cross-domain.
3232

3333
# List of imports ("default" is an alias for the main OGC Building Blocks Register)
3434
imports:
3535
- default
36+
- https://ogcincubator.github.io/geodcat-ogcapi-records/
3637

3738

3839
# SPARQL configuration (optional)

build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Process building blocks
2+
docker run --pull=always --rm --workdir /workspace -v "$(pwd):/workspace" ghcr.io/opengeospatial/bblocks-postprocess --clean true --base-url http://localhost:9090/register/

view.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker run --rm --pull=always -v "$(pwd):/register" -p 9090:9090 ghcr.io/ogcincubator/bblocks-viewer

0 commit comments

Comments
 (0)