Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consumer grade sensor example. #196

Draft
wants to merge 35 commits into
base: gh-pages
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
be61f9a
Part One of examples.
Feb 22, 2024
25d3264
Moved informative examples to informativeExamples/
Feb 23, 2024
8f524da
Moved files to new informativeExamples directory and make URI's a bit…
Feb 23, 2024
9834cdb
Changed 'thisSensor' URL pattern to '12345/Sensor' to better communic…
Feb 29, 2024
bcf910a
Fixed stale reference to thisHumiditySensor andthisTemperatureSensor.…
Feb 29, 2024
09e5172
This is a game called 'I cannot type properly.'
Feb 29, 2024
3417776
Sensor as a deployment example.
Feb 29, 2024
8ec21e6
Start of documentation eye-candy.
Feb 29, 2024
643bd84
Missing date on CoolerMonitoringProcess
Feb 29, 2024
d7d333d
Resolves swapping of featureOfInterest and Property. Thanks @ldesousa
Feb 29, 2024
29c1ff3
Resolves 12345/BatteryHealth vs 2024/02/batteryPack . Thanks @ldesousa
Feb 29, 2024
09520de
Resolves URL name and geometry confusion. Thanks @ldesousa
Feb 29, 2024
4be4102
Changed example to record direct properties and features of the produ…
Mar 7, 2024
2383fec
English spelling, not French.
Mar 13, 2024
bf491fa
Ensure six pack uri makes sense.
Mar 13, 2024
7a8b64d
Fix error with airTemperature being where airRelativeHumidity should be
Mar 13, 2024
ef5ce61
Fix properties as instances as per @ldesousa's comments.
Mar 13, 2024
8f8cc10
Fix error with Truch being Location instead of used.
Mar 14, 2024
7aaaa3b
Hook for informative example section.
Mar 14, 2024
63ea11d
More changes in narrative for discussion.
Mar 14, 2024
f60e99e
Further work on narrative.
Mar 14, 2024
625951a
Commit before merge
Mar 18, 2024
e7a4eec
Pre merge
Mar 18, 2024
a63508c
More additions to the text and fixes to examplar,
Mar 18, 2024
31c9946
Fix identifiers and temperature samples. Thanks @hylkevds
Mar 20, 2024
b01aed5
Add section on deployment and collections.
Mar 20, 2024
a6f36fa
Major cleanup; first full draft.
Mar 20, 2024
01ec23d
Change all ssn: namespaces to sosa: namespaces.
Mar 21, 2024
266f7af
Fix instance URLs.
Mar 23, 2024
fe8fcaa
Ready for another round of review.
Mar 25, 2024
626f986
Reference common modeling section.
Mar 26, 2024
45bb884
Changes according to comments from @ldesousa.
May 15, 2024
a613a63
Merge branch 'gh-pages' into sensor-owner
dr-shorthair May 29, 2024
a4808b7
Merge branch 'dht22-ex9-changes' into sensor-owner
dr-shorthair May 29, 2024
7d88d35
Merge branch 'w3c:gh-pages' into sensor-owner
oldskeptic Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 212 additions & 0 deletions ssn/integrated/examples/InkBird-IBS-TH2-instance.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix qudt: <http://qudt.org/schema/qudt/> .
@prefix unit: <http://qudt.org/vocab/unit/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix schema: <http://schema.org/> .
@prefix gs1: <https://gs1.org/voc/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rel: <http://id.loc.gov/vocabulary/relators/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix equipment: <https://rdf.ag/o/equipment/> .
@prefix geosparql: <http://www.opengis.net/ont/geosparql#> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix beer: <https://rdf.ag/o/beer#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix ssn: <http://www.w3.org/ns/ssn/> .
@prefix ssn-system: <http://www.w3.org/ns/ssn/systems/> .
@prefix ex: <http://example.org/> .

@base <http://example.org/data/> .

# This example represents a specific InkBird IBS-TH2 sensor that is performing
# measurements in multiple locations where the results are owned by different
# entities.

<acmeBreweryCo> a org:Organization, beer:Brewery ;
foaf:name "Acme Brewery Co." .

<acmeBrewerCooler> a equipment:Cooler .

<alice> a foaf:Person, prov:Agent ;
foaf:name "Alice" .

<acmeDelivery> a org:Organization ;
foaf:name "Acme Delivery Co." .

<acmeTruck> a ex:RefrigeratedTruck .

<acmeSupermarket> a <org:Organization> ;
foaf:name "Acme Supermarket Co." .

<acmeSupermarketCooler> a <equipment:Cooler> .

# An instance of a six pack of Porter Beers
<acmePorterSixPack> a beer:Porter, gs1:Product ;
gs1:lot "00001" .

# Alice packages the Beer.

<someTH2> a equipment:InkBird-IBS-TH2 ;
rel:own <acmeBreweryCo> ; # Sensor may be returned.
rdfs:label "InkBird Sensor that Alice bought to track beer storage."@en ;
sosa:hosts <thisBatterySensor>, <thisHumiditySensor>, <thisTemperatureSensor> ;
equipment:deviceAddress "00:00:00:00:00:00" .

<packingSixPack> a prov:Activity ;
rdfs:comment "When Alice packaged Porter bottles into the box, she added a InkBird logger to check that the beer wasn't getting too warm in transit and storage." ;
prov:wasAssociatedWith <alice> ;
prov:used <someTH2> ;
prov:startedAtTime "2024-02-20T01:35:00Z"^^xsd:dateTime;
prov:endedAtTime "2024-02-20T01:40:00Z"^^xsd:dateTime;
prov:atLocation <acmeBreweryCo> ;
prov:generated <acmePorterSixPack> .

# These definitions look redundant; but you are now dealing with the physical instance of the sensor
# not its definition.

<batteryPack> a equipment:IBSTH2Battery;
rdfs:label "IBSTH2 Battery. 2 AAA Batteries. 3.0V Nominal."@en ;
skos:editorialNote "Alice doesn't quite believe the battery lifetime claims, so she's tracking every set of batteries she uses and a new battery instances is generated each time." ;
dcterms:created "2024-02-20T01:35:45Z"^^xsd:dateTime .

<thisBatterySensor> a equipment:IBSTH2BatteryVoltageSensor;
rdf:comment "This is the instance of the physical sensor instance."@en ;
sosa:observes <batteryPack> .

<thisBatterysHealth> rdfs:subClass equipment:IBSTH2BatteryHealth ;
ssn:isPropertyOf <batteryPack> .

<thisHumiditySensor> a equipment:IBSTH2HumiditySensor ;
rdf:comment "This is the instance of the humidity sensor instance."@en .

<thisTemperatureSensor> a equipment:IBSTH2TemperatureSensor ;
rdf:comment "This is the instance of the temperature sensor instance."@en .

<airTemperatureOfProduct> rdfs:subClassOf equipment:airTemperature ;
ssn:isPropertyOf <acmePorterSixPack> .

<airRelativeHumidityOfProduct> rdfs:subClassOf equipment:airRelativeHumidity;
ssn:isPropertyOf <acmePorterSixPack> .
#
# Sensor activates and records temperature while in the brewery cooler.

<observation1a> a sosa:Observation ;
rel:own <acmeBreweryCo> ;
sosa:observedProperty <airTemperatureOfProduct> ;
sosa:madeBySensor <thisTemperatureSensor> ;
sosa:hasFeatureOfInterest <acmePorterSixPack> ;
sosa:resultTime "2024-02-20T01:35:45Z"^^xsd:dateTime ;
sosa:hasSimpleResult "12"^^unit:DEG_C .

<observation1b> rdf:type sosa:Observation ;
rel:own <acmeBreweryCo> ;
sosa:observedProperty <airRelativeHumidityOfProduct> ;
sosa:madeBySensor <thisHumiditySensor> ;
sosa:hasFeatureOfInterest <acmePorterSixPack> ;
sosa:resultTime "2024-02-20T01:35:45Z"^^xsd:dateTime ;
sosa:hasSimpleResult "60"^^unit:PERCENT .

# The battery is a special case because it's property is linked to the battery, not to the environment.

<observation1c> rdf:type sosa:Observation ;
rel:own <acmeBreweryCo> ;
sosa:observedProperty <batteryPack>;
sosa:madeBySensor <thisBatterySensor> ;
sosa:hasFeatureOfInterest <thisBatterysHealth> ;
sosa:resultTime "2024-02-20T01:35:45Z"^^xsd:dateTime ;
sosa:hasSimpleResult "99"^^unit:PERCENT .

<breweryObserver> a prov:Activity ;
rdfs:comment "Brewery operating system logging process." ;
prov:atLocation <acmeBreweryCo> ;
prov:generated <observation1a> ;
prov:generated <observation1b> ;
prov:generated <observation1c> ;
prov:wasStartedBy <alice> . # She turned it on last time.

#
# Product is loaded on the truck
#


<observation67a> a sosa:Observation, prov:Entity ;
rel:own <acmeBreweryCo> ;
rel:own <acmeDelivery> ;
sosa:observedProperty <airTemperatureOfProduct> ;
sosa:madeBySensor <thisTemperatureSensor> ;
sosa:hasFeatureOfInterest <acmePorterSixPack> ;
sosa:resultTime "2024-02-22T04:15:05Z"^^xsd:dateTime ;
sosa:hasSimpleResult "19"^^unit:DEG_C .

<observation67b> rdf:type sosa:Observation,prov:Entity ;
rel:own <acmeBreweryCo> ;
rel:own <acmeDelivery> ;
sosa:observedProperty <airRelativeHumidityOfProduct> ;
sosa:madeBySensor <thisHumiditySensor> ;
sosa:hasFeatureOfInterest <acmePorterSixPack> ;
sosa:resultTime "2024-02-22T04:15:05Z"^^xsd:dateTime ;
sosa:hasSimpleResult "74"^^unit:PERCENT .

<observation67c> rdf:type sosa:Observation,prov:Entity ;
rel:own <acmeBreweryCo> ;
rel:own <acmeDelivery> ;
sosa:observedProperty <batteryPack>;
sosa:madeBySensor <thisBatterySensor> ;
sosa:hasFeatureOfInterest <thisBatterysHealth> ;
sosa:resultTime "2024-02-22T04:15:05Z"^^xsd:dateTime ;
sosa:hasSimpleResult "99"^^unit:PERCENT .

<TruckObserver> a prov:Activity ;
rdfs:comment "Truck onboard monitoring system" ;
prov:atLocation <acmeTruck> ;
prov:generated <observation67a> ;
prov:generated <observation67b> ;
prov:generated <observation67c> ;
prov:startedAtTime "2024-02-22T04:15:05Z"^^xsd:dateTime ;
prov:endedAtTime "2024-02-22T05:55:38Z"^^xsd:dateTime ;
prov:wasStartedBy <driver> ;
prov:atLocation <parkingLot> .

<parkingLot> a prov:Location, geosparql:Geometry;
geosparql:asWKT "POINT(-79.35553 43.66372)"^^geosparql:wktLiteral .

#
# Product is now in display cooler at supermarket. Ownership of product has
# changed and observation data is now only being recorded / owned by supermarket.
#

<observation98a> rdf:type sosa:Observation,prov:Entity ;
rel:own <acmeSupermarket> ;
sosa:observedProperty <airTemperatureOfProduct> ;
sosa:madeBySensor <thisTemperatureSensor> ;
sosa:hasFeatureOfInterest <acmePorterSixPack> ;
sosa:resultTime "2024-02-22T06:00:13Z"^^xsd:dateTime ;
sosa:hasSimpleResult "12"^^unit:DEG_C .

<observation98b> rdf:type sosa:Observation,prov:Entity ;
rel:own <acmeSupermarket> ;
sosa:observedProperty <airRelativeHumidityOfProduct> ;
sosa:madeBySensor <thisHumiditySensor> ;
sosa:hasFeatureOfInterest <acmePorterSixPack> ;
sosa:resultTime "2024-02-22T06:00:13Z"^^xsd:dateTime ;
sosa:hasSimpleResult "55"^^unit:PERCENT .

<observation98c> rdf:type sosa:Observation,prov:Entity ;
rel:own <acmeSupermarket> ;
sosa:observedProperty <batteryPack>;
sosa:madeBySensor <thisBatterySensor> ;
sosa:hasFeatureOfInterest <thisBatterysHealth> ;
sosa:resultTime "2024-02-22T06:00:13Z"^^xsd:dateTime ;
sosa:hasSimpleResult "99"^^unit:PERCENT .

<CoolerMonitoringProcess> a prov:Activity ;
rdfs:comment "Smart cooler monitoring system" ;
prov:atLocation <acmeSupermarketCooler> ;
prov:generated <observation98a> ;
prov:generated <observation98b> ;
prov:generated <observation98c> ;
prov:wasStartedBy <acmeSupermarket> .
145 changes: 145 additions & 0 deletions ssn/integrated/examples/InkBird-IBS-TH2.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix qudt: <http://qudt.org/schema/qudt/> .
@prefix unit: <http://qudt.org/vocab/unit/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix schema: <http://schema.org/> .
@prefix gs1: <https://gs1.org/voc/> .
@prefix equipement: <https://rdf.ag/o/equipement/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix ssn: <http://www.w3.org/ns/ssn/> .
@prefix ssn-system: <http://www.w3.org/ns/ssn/systems/> .
@base <https://rdf.ag/o/equipement/> .

# This example is a specification for a common over-the-shelf temperature and humidity sensor

<InkBird-IBS-TH2> a owl:Class, gs1:Product ;
rdfs:label "Inkbird IBS-TH2"@en ;
rdfs:subClassOf sosa:Platform, equipement:Equipment, <https://w3id.org/seas/BluetoothCommunicationDevice> ;
gs1:pip <https://inkbird.com/products/hygrometer-ibs-th2> ;
sosa:hosts <IBSTH2BatteryVoltageSensor>, <IBSTH2HumiditySensor>, <IBSTH2TemperatureSensor> ;
ssn:implements <InkBird-IBS-TH2-Procedure> ;
gs1:brand <InkBird> .

<InkBird> a gs1:Brand ;
rdfs:label "Inkbird"@en ;
rdfs:comment "This is a commercial product."@en ;
gs1:brandName "Inkbird"@en .

<HWAddress> a owl:DatatypeProperty ;
rdfs:label "Device Hardware Address"@en ;
rdfs:range <InkBird-IBS-TH2> .

<IBSTH2Battery>
a owl:Class ;
rdfs:label "IBSTH2 Battery. 2 AAA Batteries. 3.0V Nominal."@en ;
skos:definition "A generic description of the battery pack that needs to be installed in it."@en ;
rdfs:subClassOf sosa:FeatureOfInterest .

<IBSTH2BatteryLimits>
skos:editorialNote "Of course, we'd never receive a 0% battery reading..."@en ;
schema:maxValue "100" ;
schema:minValue "0" ;
schema:unitCode unit:PERCENT ;
a schema:PropertyValue, ssn:Property, ssn-system:Accuracy ;
rdfs:label "IBSTH2 Battery Limits"@en .

<IBSTH2BatteryVoltageSensor> a owl:Class ;
skos:editorialNote "Percentage is derived from the battery voltage."@en ;
rdfs:label "IBSTH2 Battery Voltage"@en ;
rdfs:subClassOf sosa:Sensor ;
ssn-system:hasOperatingRange <IBSTH2BatteryLimits> ;
ssn:implements <InkBird-IBS-TH2-Procedure> ;
sosa:observes <IBSTH2Battery> .

<IBSTH2BatteryHealth>
schema:unitCode unit:PERCENT ;
a sosa:ObservableProperty, ssn:Property ;
rdfs:label "Battery Health"@en ;
skos:definition "Battery Health expressed as a percentage."@en .


<IBSTH2HumiditySensor> a owl:Class ;
rdfs:label "Inkbird IBS-TH2 built-in Humidity Sensor"@en ;
rdfs:subClassOf sosa:Sensor ;
sosa:observes <airRelativeHumidity> ;
ssn-system:hasOperatingRange <IBSTH2HumiditySensorLimits>, <IBSTH2TemperatureSensorLimits> ;
ssn:implements <InkBird-IBS-TH2-Procedure> ;
ssn-system:hasSystemCapability <IBSTH2HumiditySensorCapability> .

<IBSTH2HumiditySensorAccuracy>
schema:maxValue "0.5" ;
schema:minValue "-0.5" ;
schema:unitCode unit:Percent ;
a schema:PropertyValue, ssn:Property, ssn-system:Accuracy ;
skos:definition "The accuracy of the humidity sensor is +-0.5 °C in normal temperature and humidity conditions."@en .

<IBSTH2HumiditySensorCapability>
a schema:PropertyValue, ssn:Property, ssn-system:SystemCapability ;
skos:definition "The capabilities of the humidity sensor in normal temperature and humidity conditions."@en ;
ssn-system:hasSystemProperty <IBSTH2HumiditySensorAccuracy> ;
ssn-system:inCondition <IBSTH2HumiditySensorNormalLimits>, <IBSTH2TemperatureSensorNormalLimits> .

<IBSTH2HumiditySensorLimits>
a ssn-system:OperatingRange ;
rdfs:label "Inkbird IBS-TH2 Humidity Sensor Limits"@en ;
ssn-system:inCondition <IBSTH2HumiditySensorNormalLimits> .

<IBSTH2HumiditySensorNormalLimits>
schema:maxValue "100" ;
schema:minValue "0" ;
schema:unitCode unit:PERCENT ;
a schema:PropertyValue, ssn-system:Condition .

<IBSTH2TemperatureSensor>
a owl:Class ;
rdfs:label "Inkbird IBS-TH2 built-in Temperature Sensor"@en ;
rdfs:subClassOf sosa:Sensor ;
sosa:observes <airTemperature> ;
ssn-system:hasOperatingRange <IBSTH2HumiditySensorLimits>, <IBSTH2TemperatureSensorLimits> ;
ssn:implements <InkBird-IBS-TH2-Procedure> ;
ssn-system:hasSystemCapability <IBSTH2TemperatureSensorCapability> .

<IBSTH2TemperatureSensorAccuracy>
schema:maxValue "0.5" ;
schema:minValue "-0.5" ;
schema:unitCode unit:DEG_C ;
a schema:PropertyValue, ssn:Property, ssn-system:Accuracy ;
skos:definition "The accuracy of the temperature sensor is +-0.5 °C in normal temperature and humidity conditions."@en .

<IBSTH2TemperatureSensorCapability>
a schema:PropertyValue, ssn:Property, ssn-system:SystemCapability ;
skos:definition "The capabilities of the temperature sensor in normal temperature and humidity conditions."@en ;
ssn-system:hasSystemProperty <IBSTH2TemperatureSensorAccuracy> ;
ssn-system:inCondition <IBSTH2HumiditySensorNormalLimits>, <IBSTH2TemperatureSensorNormalLimits> .

<IBSTH2TemperatureSensorLimits>
a ssn-system:OperatingRange ;
rdfs:label "Inkbird IBS-TH2 Temperature Sensor Limits"@en ;
ssn-system:inCondition <IBSTH2TemperatureSensorNormalLimits> .

<IBSTH2TemperatureSensorNormalLimits>
schema:maxValue "60" ;
schema:minValue "-40" ;
schema:unitCode unit:DEG_C ;
a schema:PropertyValue, ssn-system:Condition .

<InkBird-IBS-TH2-Procedure> a sosa:Procedure ;
foaf:isPrimaryTopicOf <https://fcc.report/FCC-ID/2AYZD-IBSTH2/5436475.pdf> ;
skos:editorialNote "This is the manufacturer's data sheet as submitted to the FCC."@en .

<airRelativeHumidity>
schema:unitCode unit:PERCENT ;
a sosa:ObservableProperty, ssn:Property ;
rdfs:label "Humidité Relative"@fr, "Relative Humidity"@en, "Relative Luftfeuchtigkeit"@de ;
skos:definition "The amount of water vapor present in air expressed as a percentage of the amount needed for saturation at the same temperature."@en .

<airTemperature>
schema:unitCode unit:DEG_C ;
a sosa:ObservableProperty, ssn:Property ;
rdfs:label "Lufttemperatur"@de, "Air Temperature"@en, "Température Ambiante"@fr ;
skos:definition "Temperature of the air."@en .