From d19bf784c50fd650b7650db0930e5ecc3263dc7c Mon Sep 17 00:00:00 2001
From: Sebastian Kaebisch Semantic Annotations
- As an example, the TD snippet given below extends the version information container + Next subsections shows some sample usage of different kind of ontologies in Thing Descriptions. +
+ ++ The TD snippet given below extends the version information container by adding version numbers for the hardware and firmware of the Thing, and uses values from external Vocabularies for the Thing and for the data schema unit: SAREF, @@ -3215,6 +3222,10 @@
In many cases, TD Context Extensions may be used to annotate pieces of a data schema, to be able to semantically process the state information of the physical world object, @@ -3282,6 +3293,73 @@
+ For some use cases like in building, agraculture, or smart city location based data is required. This + information can be provided in the Thing Description in different ways and can be relyed on + different kind of location ontologies depending or purpose (e.g., indoor, outdoor). Sample vocabulary + can be used such as [[WGS84]] or [[schema.org]]. Also see [[sdw-bp]]. +
+ +
+ The TD snippet below uses lat
and long
from the [[WGS84]] ontology to
+ provide latitude and longitude metadata at Thing's top level.
+
+{ + "@context": [ + "https://www.w3.org/2019/wot/td/v1", + { + "wgs84": "http://www.w3.org/2003/01/geo/wgs84_pos#" + } + ], + "@type": "Thing", + "wgs84:lat" : "26.58", + "wgs84:long" : "297.83", + ... + "properties": { + ... + +} ++ + +
+ In some use cases geo based metadata have to be provided at the interaction level, e.g., + if the Thing Descriptions reflect a virtuel Thing since it combines multiple Things. + Geo laction based data can be provided at he interaction level as shown in the next sample: +
+ ++{ + "@context": [ + "https://www.w3.org/2019/wot/td/v1", + { + "iot": "http://schema.org#" + } + ], + ... + "properties": { + "status": { + "iot:longitude": "40.75", + "iot:latitude": "73.98", + "iot:elevation": "15", + "type": "string", + "forms": [{"href": "https://mylamp.example.com/status"}] + }, + + ... + }, + ... +} ++ + +
- For some use cases like in building, agraculture, or smart city location based data is required. This + For many use cases like in building, agraculture, or smart city location based data is required. This information can be provided in the Thing Description in different ways and can be relyed on - different kind of location ontologies depending or purpose (e.g., indoor, outdoor). Sample vocabulary - can be used such as [[WGS84]] or [[schema.org]]. Also see [[sdw-bp]]. + different kind of location ontologies (e.g.,[[WGS84]], [[schema.org]) depending on purpose (e.g., indoor, outdoor). + Also see [[sdw-bp]].
The TD snippet below uses lat
and long
from the [[WGS84]] ontology to
- provide latitude and longitude metadata at Thing's top level.
+ provide static latitude and longitude metadata at Thing's top level.
@@ -3314,12 +3314,12 @@Example III: Geolocation Annotations
"@context": [ "https://www.w3.org/2019/wot/td/v1", { - "wgs84": "http://www.w3.org/2003/01/geo/wgs84_pos#" + "geo": "http://www.w3.org/2003/01/geo/wgs84_pos#" } ], "@type": "Thing", - "wgs84:lat" : "26.58", - "wgs84:long" : "297.83", + "geo:lat" : "26.58", + "geo:long" : "297.83", ... "properties": { ... @@ -3329,9 +3329,9 @@Example III: Geolocation Annotations
- In some use cases geo based metadata have to be provided at the interaction level, e.g., - if the Thing Descriptions reflect a virtuel Thing since it combines multiple Things. - Geo laction based data can be provided at he interaction level as shown in the next sample: + In some use cases location based metadata have to be provided at the interaction level, e.g., + as provided as a Property that returns the latest
longitude
,latitude
, abdelevation
values + based on [[schema.org]]:@@ -3339,17 +3339,20 @@+Example III: Geolocation Annotations
"@context": [ "https://www.w3.org/2019/wot/td/v1", { - "iot": "http://schema.org#" + "schema": "http://schema.org#" } ], ... "properties": { - "status": { - "iot:longitude": "40.75", - "iot:latitude": "73.98", - "iot:elevation": "15", - "type": "string", - "forms": [{"href": "https://mylamp.example.com/status"}] + "position": { + "type": "object", + "properties": { + "@type" : "schema:GeoCoordinates", + "longitude": { "type": "number" }, + "latitude": { "type": "number" }, + "elevation": { "type": "number" } + }, + "forms": [{"href": "https://robot.example.com/position"}] }, ... @@ -3358,6 +3361,40 @@Example III: Geolocation Annotations
}+ In the case it is desired to have a different name for, e.g.,
+ +longitude
,latitude
, + andelevation
in the data model,jsonld:context
can be used to link + terms to specific vocabulary from a ontology (also see [[json-schema]], Section 3.3 Defining a JSON-LD context for data instances): ++{ + "@context": [ + "https://www.w3.org/2019/wot/td/v1", + { + "schema": "http://schema.org#" + } + ], + ... + "properties": { + "position": { + "jsonld:context": { + "schema": "http://schema.org/" + "long": "schema:longitude", + "lat": "schema:latitude", + "height": "schema:elevation" + }, + "type": "object", + "properties": { + "long": { "type": "number" }, + "lat": { "type": "number" }, + "height": { "type": "number" } + } + } + }, + ... +} +
{ - "@context": [ - "https://www.w3.org/2019/wot/td/v1", - { - "schema": "http://schema.org#" - } - ], + "@context": "https://www.w3.org/2019/wot/td/v1", ... "properties": { "position": { From e4971470d6d8bd7633efd7f194590e689a0b717f Mon Sep 17 00:00:00 2001 From: Sebastian KaebischDate: Fri, 18 Sep 2020 08:29:48 +0200 Subject: [PATCH 4/4] fix in example --- index.template.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/index.template.html b/index.template.html index 859e7c725..caf9f23c4 100644 --- a/index.template.html +++ b/index.template.html @@ -3346,15 +3346,14 @@ Example III: Geolocation Annotations
"properties": { "position": { "type": "object", - "properties": { - "@type" : "schema:GeoCoordinates", + "@type" : "schema:GeoCoordinates", + "properties": { "longitude": { "type": "number" }, - "latitude": { "type": "number" }, + "latitude": { "type": "number" }, "elevation": { "type": "number" } }, "forms": [{"href": "https://robot.example.com/position"}] }, - ... }, ...