Skip to content

Commit a2398ae

Browse files
authored
Merge pull request #410 from w3c/LongExampleAcme
Rebuilt long beer example.
2 parents 9f5a239 + 3ae2a8a commit a2398ae

24 files changed

Lines changed: 1958 additions & 8 deletions

ssn/chapters/CompleteExamples.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<h2>Extended Examples</h2>
22

33
<p>
4-
A set of extended examples of instances using the SSN ontology are available in the <a href="https://github.com/w3c/sdw-sosa-ssn/tree/gh-pages/ssn/rdf/examples">examples folder</a>.
4+
A set of extended examples of instances using the SOSA ontology are available in the <a href="https://github.com/w3c/sdw-sosa-ssn/blob/gh-pages/ssn/rdf/examples">examples folder</a>.
55
</p>
66

7+
8+
9+
10+
711
<!---
812
913
<section id="tree-height">

ssn/chapters/Origins.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
<!-- <section id="origins"> -->
2-
31
<h3>Origins of SSN and SOSA</h3>
42

53
<h4>OGC Sensor Web Enablement</h4>
@@ -70,6 +68,4 @@ <h4>New editions</h4>
7068
OGC Connected Systems project have contributed some ideas particularly around actuation.
7169
Finally, direct experience with SSN has uncovered a variety of more minor issues that have been addressed or
7270
accommodated.
73-
</p>
74-
75-
<!-- </section> -->
71+
</p>
55.5 KB
Loading
13.9 KB
Loading
52.2 KB
Loading
40.7 KB
Loading

ssn/rdf/examples/ACME-Beer-Example.md

Lines changed: 625 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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 xsd: <http://www.w3.org/2001/XMLSchema#> .
4+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
5+
@prefix unit: <http://qudt.org/vocab/unit/> .
6+
@prefix qudt: <http://qudt.org/schema/qudt/> .
7+
@prefix sosa-env: <http://www.w3.org/ns/sosa/system-environment-properties#> .
8+
@prefix beer: <https://rdf.ag/o/beer#> .
9+
@prefix sosa: <http://www.w3.org/ns/sosa/> .
10+
@prefix sensor: <https://example.org/sensor/> .
11+
@base <http://example.org/data/> .
12+
13+
# A (virtual) sample of air within the six pack
14+
<10/PO202402/21/0001/acmePorterSixPackAirSample> a sosa:Sample ;
15+
rdfs:label "Air within the six pack"@en ;
16+
sosa:isSampleOf <10/PO202402/21/0001/acmePorterSixPack> .
17+
18+
# A (virtual) sample of the beer from the six pack, implicitly assumes that the
19+
# sample is representative of the contents of all bottles.
20+
<10/PO202402/21/0001/acmePorterSixPackBeerSample> a sosa:FeatureOfInterest, sosa:Sample, beer:Porter ;
21+
rdfs:label "A (virtual) sample of beer within the six pack"@en ;
22+
sosa:isSampleOf <10/PO202402/21/0001/acmePorterSixPack> .
23+
24+
# We define this as the beer temperature, but ontologically it is a
25+
# generic definition for the temperature of the sample.
26+
<10/PO202402/21/0001/BeerTemperature> a sosa:Property ;
27+
qudt:hasUnit unit:DEG_C ;
28+
sosa:isPropertyOf <10/PO202402/21/0001/acmePorterSixPackBeerSample> ;
29+
rdfs:label "Biertemperatur"@de, "Beer Temperature"@en, "Température de la bière"@fr ;
30+
skos:definition "Temperature of Beer."@en .
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
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 xsd: <http://www.w3.org/2001/XMLSchema#> .
4+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
5+
@prefix qudt: <http://qudt.org/schema/qudt/> .
6+
@prefix unit: <http://qudt.org/vocab/unit/> .
7+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
8+
@prefix schema: <http://schema.org/> .
9+
@prefix gs1: <https://gs1.org/voc/> .
10+
@prefix prov: <http://www.w3.org/ns/prov#> .
11+
@prefix rel: <http://id.loc.gov/vocabulary/relators/> .
12+
@prefix sosa-env: <http://www.w3.org/ns/sosa/system-environment-properties#> .
13+
@prefix dcterms: <http://purl.org/dc/terms/> .
14+
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .
15+
@prefix org: <http://www.w3.org/ns/org#> .
16+
@prefix beer: <https://rdf.ag/o/beer#> .
17+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
18+
@prefix sosa: <http://www.w3.org/ns/sosa/> .
19+
@prefix ex: <http://example.org/> .
20+
@prefix sensor: <https://example.org/sensor/> .
21+
@base <http://example.org/data/> .
22+
# This example represents a specific InkBird IBS-TH2 sensor that is performing
23+
# measurements in multiple locations where the results are owned by different
24+
# entities. In the scenario used here a local brewery makes use of the sensor to track the
25+
# temperature of their beer as it is packaged, stored, shipped and displayed for sale.
26+
27+
<acmeBreweryCo> a org:Organization, beer:Brewery ;
28+
foaf:name "Acme Brewery Co." .
29+
30+
<acmeBrewerCooler> a ex:Cooler .
31+
32+
<alice> a foaf:Person, prov:Agent ;
33+
foaf:name "Alice" .
34+
35+
<acmeDelivery> a org:Organization ;
36+
foaf:name "Acme Delivery Co." .
37+
38+
<acmeTruck> a ex:RefrigeratedTruck .
39+
40+
<acmeSupermarket> a <org:Organization> ;
41+
foaf:name "Acme Supermarket Co." .
42+
43+
<acmeSupermarketCooler> a <ex:Cooler> .
44+
45+
# A six pack as packaged and sold by Acme Brewery Co.
46+
47+
<acmePorterSixPack> a beer:Porter, gs1:Product, schema:Product ;
48+
skos:definition "A six pack of Acme Porter."@en .
49+
50+
# A specific (instance) six pack of Acme Porter Beers
51+
# We use GS1-style lot and serial numbers as part of the
52+
# identifier to highlight that the carton is a physical instance.
53+
54+
<10/PO202402/21/0001/acmePorterSixPack> a schema:IndividualProduct;
55+
rdfs:subClassOf <acmePorterSixPack>;
56+
gs1:packaging <0001/ProductPackaging>;
57+
gs1:hasBatchLotNumber "PO202402" ;
58+
gs1:hasSerialNumber "0001" .
59+
60+
# A sample of air within the six pack
61+
<10/PO202402/21/0001/acmePorterSixPackAirSample> a sosa:Sample ;
62+
rdfs:label "Air within the six pack"@en ;
63+
sosa:isSampleOf <10/PO202402/21/0001/acmePorterSixPack> .
64+
65+
# A (virtual) sample of the beer from the six pack, implicitly assumes that the
66+
# sample is representative from all bottles.
67+
<10/PO202402/21/0001/acmePorterSixPackBeerSample> a sosa:FeatureOfInterest, sosa:Sample, beer:Porter ;
68+
rdfs:label "A (virtual) sample of beer within the six pack"@en ;
69+
sosa:isSampleOf <10/PO202402/21/0001/acmePorterSixPack> .
70+
71+
<0001/ProductPackaging> a gs1:PackagingDetails, sosa:FeatureOfInterest ;
72+
rdfs:label "An instance of a beer carton used to package a six pack."@en .
73+
74+
# We define this as the beer temperature, but ontologically it is a
75+
# generic definition for the temperature of the sample.
76+
<10/PO202402/21/0001/BeerTemperature> a sosa:Property ;
77+
qudt:hasUnit unit:DEG_C ;
78+
sosa:isPropertyOf <10/PO202402/21/0001/acmePorterSixPackBeerSample> ;
79+
rdfs:label "Biertemperatur"@de, "Beer Temperature"@en, "Température de la bière"@fr ;
80+
skos:definition "Temperature of Beer."@en .
81+
82+
# Alice packages the Beer.
83+
84+
<12345/someTH2> a sensor:IBS-TH2-Plus, schema:IndividualProduct ;
85+
rel:own <acmeBreweryCo> ; # Sensor may be returned.
86+
rdfs:label "InkBird Sensor that Alice bought to track beer storage."@en ;
87+
sosa:hasSubSystem <12345/HumiditySensor>, <12345/TemperatureSensor> ;
88+
gs1:hasSerialNumber "12345" ;
89+
ex:deviceAddress "12:34:56:12:34:56" .
90+
91+
<00001/packingSixPack> a prov:Activity, sosa:Deployment ;
92+
rdfs:comment "When Alice packaged Porter bottles into the box, she added an InkBird logger to check that the beer wasn't getting too warm in transit or storage." ;
93+
prov:wasAssociatedWith <alice> ;
94+
prov:used <12345/someTH2> ;
95+
prov:used <0001/ProductPackaging> ;
96+
prov:startedAtTime "2024-02-20T01:35:00Z"^^xsd:dateTime;
97+
prov:endedAtTime "2024-02-20T01:40:00Z"^^xsd:dateTime;
98+
prov:atLocation <acmeBreweryCo> ;
99+
prov:generated <10/PO202402/21/0001/acmePorterSixPack> .
100+
101+
# These definitions look redundant; but they represent the specific, physical instantiation of the sensors.
102+
103+
<12345/HumiditySensor> a sensor:IBS-TH2-Plus-H ;
104+
rdf:comment "This is the instance of the humidity sensor instance."@en .
105+
106+
<12345/TemperatureSensor> a sensor:IBS-TH2-Plus-T ;
107+
rdf:comment "This is the instance of the temperature sensor instance."@en .
108+
#
109+
# Sensor activates and records temperature while in the brewery cooler.
110+
111+
<1a/observation> a sosa:Observation ;
112+
rel:own <acmeBreweryCo> ;
113+
sosa:observedProperty sosa-env:AmbientTemperature ;
114+
sosa:hasUltimateFeatureOfInterest <10/PO202402/21/0001/acmePorterSixPackBeerSample> ;
115+
sosa:madeBySensor <12345/TemperatureSensor> ;
116+
sosa:hasFeatureOfInterest <10/PO202402/21/0001/acmePorterSixPackAirSample> ;
117+
sosa:resultTime "2024-02-20T01:35:45Z"^^xsd:dateTime ;
118+
sosa:hasResult [
119+
a qudt:QuantityValue ;
120+
qudt:hasUnit unit:DEG_C ;
121+
qudt:value 12.0 ;
122+
] ;
123+
.
124+
<1b/observation> rdf:type sosa:Observation ;
125+
rel:own <acmeBreweryCo> ;
126+
sosa:observedProperty sosa-env:AmbientHumidity;
127+
sosa:hasUltimateFeatureOfInterest <0001/ProductPackaging>;
128+
sosa:madeBySensor <12345/HumiditySensor> ;
129+
sosa:hasFeatureOfInterest <10/PO202402/21/0001/acmePorterSixPackAirSample> ;
130+
sosa:resultTime "2024-02-20T01:35:45Z"^^xsd:dateTime ;
131+
sosa:hasResult [
132+
a qudt:QuantityValue ;
133+
qudt:hasUnit unit:PERCENT ;
134+
qudt:value 60 ;
135+
] ;
136+
.
137+
<breweryObserver> a prov:Activity ;
138+
rdfs:comment "Brewery operating system logging process." ;
139+
prov:atLocation <acmeBreweryCo> ;
140+
prov:generated <1a/observation> ;
141+
prov:generated <1b/observation> ;
142+
prov:wasStartedBy <alice> . # She turned it on last time.
143+
144+
#
145+
# Product is loaded on the truck
146+
#
147+
148+
149+
<67a/observation> a sosa:Observation, prov:Entity ;
150+
rel:own <acmeBreweryCo> ;
151+
rel:own <acmeDelivery> ;
152+
sosa:observedProperty <10/PO202402/21/0001/BeerTemperature> ;
153+
sosa:hasUltimateFeatureOfInterest <10/PO202402/21/0001/acmePorterSixPackBeerSample> ;
154+
sosa:madeBySensor <12345/TemperatureSensor> ;
155+
sosa:hasFeatureOfInterest <10/PO202402/21/0001/acmePorterSixPackAirSample> ;
156+
sosa:resultTime "2024-02-22T04:15:05Z"^^xsd:dateTime ;
157+
sosa:hasResult [
158+
a qudt:QuantityValue ;
159+
qudt:hasUnit unit:DEG_C ;
160+
qudt:value 19.0 ;
161+
] ;
162+
.
163+
<67b/observation> rdf:type sosa:Observation,prov:Entity ;
164+
rel:own <acmeBreweryCo> ;
165+
rel:own <acmeDelivery> ;
166+
sosa:observedProperty ex:airRelativeHumidity ;
167+
sosa:hasUltimateFeatureOfInterest <0001/ProductPackaging>;
168+
sosa:madeBySensor <12345/HumiditySensor> ;
169+
sosa:hasFeatureOfInterest <10/PO202402/21/0001/acmePorterSixPackAirSample> ;
170+
sosa:resultTime "2024-02-22T04:15:05Z"^^xsd:dateTime ;
171+
sosa:hasResult [
172+
a qudt:QuantityValue ;
173+
qudt:hasUnit unit:PERCENT ;
174+
qudt:value 74 ;
175+
] ;
176+
.
177+
<123/TruckObserver> a prov:Activity ;
178+
rdfs:comment "Truck onboard monitoring system" ;
179+
prov:used <acmeTruck> ;
180+
prov:generated <67a/observation> ;
181+
prov:generated <67b/observation> ;
182+
prov:startedAtTime "2024-02-22T04:15:05Z"^^xsd:dateTime ;
183+
prov:endedAtTime "2024-02-22T05:55:38Z"^^xsd:dateTime ;
184+
prov:wasStartedBy <driver> ;
185+
prov:atLocation <gpsLocation> .
186+
187+
# This is the output from the truck's GPS receiver. We only get coordinates
188+
# from it.
189+
190+
<gpsLocation> a prov:Location, geosparql:Geometry;
191+
geosparql:asWKT "POINT(-79.35553 43.66372)"^^geosparql:wktLiteral .
192+
193+
#
194+
# Product is now in display cooler at supermarket. Ownership of product has
195+
# changed and observation data is now only being recorded / owned by supermarket.
196+
#
197+
198+
<98a/observation> rdf:type sosa:Observation,prov:Entity ;
199+
rel:own <acmeSupermarket> ;
200+
sosa:observedProperty <10/PO202402/21/0001/BeerTemperature> ;
201+
sosa:hasUltimateFeatureOfInterest <10/PO202402/21/0001/acmePorterSixPackBeerSample> ;
202+
sosa:madeBySensor <12345/TemperatureSensor> ;
203+
sosa:hasFeatureOfInterest <10/PO202402/21/0001/acmePorterSixPackAirSample> ;
204+
sosa:resultTime "2024-02-22T06:00:13Z"^^xsd:dateTime ;
205+
sosa:hasResult [
206+
a qudt:QuantityValue ;
207+
qudt:hasUnit unit:DEG_C ;
208+
qudt:value 12 ;
209+
] ;
210+
.
211+
<98b/observation> rdf:type sosa:Observation,prov:Entity ;
212+
rel:own <acmeSupermarket> ;
213+
sosa:observedProperty ex:airRelativeHumidity ;
214+
sosa:hasUltimateFeatureOfInterest <0001/ProductPackaging> ;
215+
sosa:madeBySensor <12345/HumiditySensor> ;
216+
sosa:hasFeatureOfInterest <10/PO202402/21/0001/acmePorterSixPackAirSample> ;
217+
sosa:resultTime "2024-02-22T06:00:13Z"^^xsd:dateTime ;
218+
sosa:hasResult [
219+
a qudt:QuantityValue ;
220+
qudt:hasUnit unit:PERCENT ;
221+
qudt:value 55 ;
222+
] ;
223+
.
224+
<CoolerMonitoringProcess> a prov:Activity ;
225+
rdfs:comment "Smart cooler monitoring system" ;
226+
prov:startedAtTime "2024-02-22T06:00:13Z"^^xsd:dateTime ;
227+
prov:atLocation <acmeSupermarketCooler> ;
228+
prov:generated <98a/observation> ;
229+
prov:generated <98b/observation> ;
230+
prov:wasStartedBy <acmeSupermarket> .
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 xsd: <http://www.w3.org/2001/XMLSchema#> .
4+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
5+
@prefix qudt: <http://qudt.org/schema/qudt/> .
6+
@prefix schema: <http://schema.org/> .
7+
@prefix prov: <http://www.w3.org/ns/prov#> .
8+
@prefix sosa-env: <http://www.w3.org/ns/sosa/system-environment-properties#> .
9+
@prefix sosa: <http://www.w3.org/ns/sosa/> .
10+
@prefix ex: <http://example.org/> .
11+
@prefix sensor: <https://example.org/sensor/> .
12+
@base <http://example.org/data/> .
13+
# Represent all data as Observation collections.
14+
15+
<acmePorterSixPackObservations> a sosa:ObservationCollection;
16+
sosa:hasMember <observation1a>, <observation1b>;
17+
sosa:hasMember <observation67a>, <observation67b> ;
18+
sosa:hasMember <observation98a>, <observation98b> .
19+
20+
# Beer in the cooler.
21+
22+
<acmeCoolerObservaions> a sosa:ObservationCollection;
23+
sosa:hasMember <observation1a>, <observation1b> .
24+
25+
# Beer in the delivery truck.
26+
27+
<acmeTruckObservations> a sosa:ObservationCollection;
28+
sosa:hasMember <observation67a>, <observation67b> .
29+
30+
# Beer in the supermarket cooler.
31+
32+
<acmeSupermarketCoolerObservations> a sosa:ObservationCollection;
33+
sosa:hasMember <observation98a>, <observation98b> .

0 commit comments

Comments
 (0)