From d19bf784c50fd650b7650db0930e5ecc3263dc7c Mon Sep 17 00:00:00 2001 From: Sebastian Kaebisch Date: Tue, 15 Sep 2020 15:04:57 +0200 Subject: [PATCH 1/4] geo location metadata --- index.template.html | 80 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/index.template.html b/index.template.html index 1767f3f78..4eb9e996e 100644 --- a/index.template.html +++ b/index.template.html @@ -3173,7 +3173,14 @@

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. +

+ +
+

Example I: Version and Unit Annotations

+ +

+ 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 @@

Semantic Annotations

} +
+
+

Example II: State Annotations

+

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 @@

Semantic Annotations

of the lamp.

+
+
+

Example III: Geolocation Annotations

+ +

+ 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"}]
+        },
+
+        ...
+    },
+    ...
+}
+
+ + +
From 753ee6f42c81baac986f7ac81f0b64e3e53ced19 Mon Sep 17 00:00:00 2001 From: Sebastian Kaebisch Date: Thu, 17 Sep 2020 17:52:27 +0200 Subject: [PATCH 2/4] update examples based on feedback --- index.template.html | 71 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 54 insertions(+), 17 deletions(-) diff --git a/index.template.html b/index.template.html index 4eb9e996e..2f9438f00 100644 --- a/index.template.html +++ b/index.template.html @@ -3298,15 +3298,15 @@

Example II: State Annotations

Example III: Geolocation Annotations

- 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, abd elevation 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, + and elevationin 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" }
+        }
+        }
+  },
+    ...
+}
+
From ca56de7bc8612477a4fe0e28f06dd09c213e23b9 Mon Sep 17 00:00:00 2001 From: Sebastian Kaebisch Date: Thu, 17 Sep 2020 17:53:48 +0200 Subject: [PATCH 3/4] update context --- index.template.html | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/index.template.html b/index.template.html index 2f9438f00..859e7c725 100644 --- a/index.template.html +++ b/index.template.html @@ -3369,12 +3369,7 @@

Example III: Geolocation Annotations

 {
-    "@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 Kaebisch 
Date: 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"}] }, - ... }, ...