JSON Schema in RDF
2020.10.02 15:44
JSON Schema in RDF
Thing Description (TD) Ontology
W3C Editor's Draft
- This version:
- https://www.w3.org/2019/wot/td
- Latest published version:
- https://www.w3.org/TR/wot-td-ontology/
- Latest editor's draft:
- https://www.w3.org/2019/wot/td
- Editors:
Copyright © 2020 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply.
Abstract
The Thing Description (TD) ontology is an RDF axiomatization of the TD information model, one of the building blocks of the Web of Things (WoT). Besides providing an alternative to the standard JSON representation format for TD documents, the TD ontology can also be used to process contextual information on Things and for alignments with other WoT-related ontologies.
Status of This Document
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at https://www.w3.org/TR/.
Validation of the document by the Working Group is expected by the end of June 2019.
Publication as an Editor's Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
This document is governed by the 1 March 2019 W3C Process Document.
1. Introduction
The TD ontology is an idiomatic RDF axiomatization of the TD information model [WOT-THING-DESCRIPTION], which can be used to describe WoT things and their interaction affordances. The TD ontology imports the hypermedia controls ontology. However, although the TD information model also includes terms for data schemas and security configurations, the TD ontology does not force the use of the corresponding JSON schema and WoT security vocabularies. Other schema languages like SHACL [shacl] can thus be leveraged to describe WoT Things.
2. Terminology
The fundamental WoT terminology such as Thing, Consumer, Thing Description (TD), Interaction Model, Interaction Affordance, Property, Action, Event, Protocol Binding, Servient, etc. is defined in Section 3 of the WoT Architecture specification [WOT-ARCHITECTURE].
The Thing Description terminology such as TD Information Model, TD Document, Term (Vocabulary Term), etc. is defined in Section 3 of the WoT Thing Description specification [WOT-THING-DESCRIPTION].
3. Axiomatization
3.1 Classes
3.1.1 ArraySchema
IRI: https://www.w3.org/2019/wot/json-schema#ArraySchema
array
assigned to type
in DataSchema
instances.
Sub-class of | jsonschema:DataSchema |
In the domain of | jsonschema:items jsonschema:maxItems jsonschema:minItems |
3.1.2 BooleanSchema
IRI: https://www.w3.org/2019/wot/json-schema#BooleanSchema
boolean
. This subclass is indicated by the value boolean
assigned to type
in DataSchema
instances.
Sub-class of | jsonschema:DataSchema |
3.1.3 DataSchema
IRI: https://www.w3.org/2019/wot/json-schema#DataSchema
3.1.4 IntegerSchema
IRI: https://www.w3.org/2019/wot/json-schema#IntegerSchema
integer
. This subclass is indicated by the value integer
assigned to type
in DataSchema
instances.
Sub-class of | jsonschema:DataSchema |
In the domain of | jsonschema:maximum jsonschema:minimum |
3.1.5 NullSchema
IRI: https://www.w3.org/2019/wot/json-schema#NullSchema
null
. This subclass is indicated by the value null
assigned to type
in DataSchema
instances. This Subclass describes only one acceptable value, namely null
. It can be used as part of a oneOf
declaration, where it is used to indicate, that the data can also be null
.
Sub-class of | jsonschema:DataSchema |
3.1.6 NumberSchema
IRI: https://www.w3.org/2019/wot/json-schema#NumberSchema
number
. This subclass is indicated by the value number
assigned to type
in DataSchema
instances.
Sub-class of | jsonschema:DataSchema |
In the domain of | jsonschema:maximum jsonschema:minimum |
3.1.7 ObjectSchema
IRI: https://www.w3.org/2019/wot/json-schema#ObjectSchema
object
. This subclass is indicated by the value object
assigned to type
in DataSchema
instances.
Sub-class of | jsonschema:DataSchema |
In the domain of | jsonschema:properties jsonschema:required |
3.1.8 StringSchema
IRI: https://www.w3.org/2019/wot/json-schema#StringSchema
string
. This subclass is indicated by the value string
assigned to type
in DataSchema
instances.
Sub-class of | jsonschema:DataSchema |
In the domain of | jsonschema:format |
3.2 Object Properties
3.2.1 allOf
IRI: https://www.w3.org/2019/wot/json-schema#allOf
Domain includes | jsonschema:DataSchema |
Range includes | jsonschema:DataSchema |
3.2.2 anyOf
IRI: https://www.w3.org/2019/wot/json-schema#anyOf
Domain includes | jsonschema:DataSchema |
Range includes | jsonschema:DataSchema |
3.2.3 items
IRI: https://www.w3.org/2019/wot/json-schema#items
Domain includes | jsonschema:ArraySchema |
Range includes | jsonschema:DataSchema |
3.2.4 oneOf
IRI: https://www.w3.org/2019/wot/json-schema#oneOf
Domain includes | jsonschema:DataSchema |
Range includes | jsonschema:DataSchema |
3.2.5 properties
IRI: https://www.w3.org/2019/wot/json-schema#properties
Domain includes | jsonschema:ObjectSchema |
Range includes | jsonschema:DataSchema |
3.3 Datatype Properties
3.3.1 const
IRI: https://www.w3.org/2019/wot/json-schema#const
Domain includes | jsonschema:DataSchema |
3.3.2 enum
IRI: https://www.w3.org/2019/wot/json-schema#enum
Domain includes | jsonschema:DataSchema |
3.3.3 format
IRI: https://www.w3.org/2019/wot/json-schema#format
Domain includes | jsonschema:StringSchema |
3.3.4 maxItems
IRI: https://www.w3.org/2019/wot/json-schema#maxItems
Domain includes | jsonschema:ArraySchema |
3.3.5 maximum
IRI: https://www.w3.org/2019/wot/json-schema#maximum
Domain includes | jsonschema:IntegerSchema jsonschema:NumberSchema |
3.3.6 minItems
IRI: https://www.w3.org/2019/wot/json-schema#minItems
Domain includes | jsonschema:ArraySchema |
3.3.7 minimum
IRI: https://www.w3.org/2019/wot/json-schema#minimum
Domain includes | jsonschema:IntegerSchema jsonschema:NumberSchema |
3.3.8 propertyName
IRI: https://www.w3.org/2019/wot/json-schema#propertyName
Domain includes | jsonschema:DataSchema |
3.3.9 readOnly
IRI: https://www.w3.org/2019/wot/json-schema#readOnly
Domain includes | jsonschema:DataSchema |
3.3.10 required
IRI: https://www.w3.org/2019/wot/json-schema#required
Domain includes | jsonschema:ObjectSchema |
3.3.11 writeOnly
IRI: https://www.w3.org/2019/wot/json-schema#writeOnly
Domain includes | jsonschema:DataSchema |
4. Alignments
The TD ontology shares commonalities with other WoT-related vocabularies, in particular with SOSA [vocab-ssn] and schema.org. Alignments between these vocabularies are provided in a human-readable way in the following.
4.1 SOSA
All alignments with SOSA are also available here in OWL: td-sosa.ttl.
Alignment of td:Thing
with SOSA:
Sub-Class | Super-Class |
---|---|
td:Thing |
sosa:Sensor orsosa:Actuator orsosa:Platform orsosa:FeatureOfInterest |
td:Thing andsosa:FeatureOfInterest |
ssn:hasProperty some (( sosa:isObservedBy some sosa:Sensor ) or( sosa:isActedOnBy some sosa:Actuator )) |
td:Thing andsosa:Sensor |
sosa:observes somesosa:ObservableProperty |
td:Thing andsosa:Actuator |
sosa:actsOnProperty somesosa:ActuatableProperty |
td:Thing andsosa:Platform |
sosa:hosts some (( sosa:Sensor andsosa:observes somesosa:ObservableProperty ) or ( sosa:Actuator andsosa:actsOnProperty somesosa:ActuatableProperty ) ) |
Alignment of td:InteractionAffordance
with SOSA:
Sub-Class | Super-Class |
---|---|
td:PropertyAffordance andtd:hasForm somehctl:hasOperationType valuetd:readProperty |
ssn:forProperty some sosa:ObservableProperty |
td:PropertyAffordance andtd:hasForm somehctl:hasOperationType valuetd:writeProperty |
ssn:forProperty some sosa:ActuatableProperty |
td:ActionAffordance |
ssn:forProperty somesosa:ActuatableProperty |
td:EventAffordance |
ssn:forProperty somesosa:ObservableProperty |
4.2 Schema.org
The alignments with schema.org's actions are also available here in OWL: td-sdo.ttl.
Sub-Class | Super-Class |
---|---|
td:InteractionAffordance |
schema:Action andschema:actionStatus value schema:PotentialActionStatus |
Sub-Property | Super-Property |
---|---|
td:hasInteractionAffordance |
schema:potentialAction |
5. Usage Examples
5.1 Thing Description JSON-LD 1.1 Instance to RDF Dataset
The following example shows a TD instance from Example 1 Thing Description specification [WOT-THING-DESCRIPTION] in JSON-LD 1.1 (JSON-LD 1.1 tab) and in a RDF dataset (RDF tab).
The RDF dataset contains the corresponding Thing Description IRIs as defined in this document. This IRI mapping is provided by the Thing Description context file https://www.w3.org/2019/wot/td/v1
. For instance, the field actions
is transformed to <https://www.w3.org/2019/wot/td#hasActionAffordance>
.
5.2 Merging Thing Descriptions
The following example includes two TD documents in the standard TD JSON representation format [WOT-THING-DESCRIPTION], identified by a unique electronic product code [RFC5134].
If these two documents are being merged together with contextual information in the form of an RDF graph that uses the same identifiers, it is possible to retrieve form metadata of these TDs depending on the relations that exist between Things. Here, the two Things share information on room 101 of some example building.
5.3 Internal State of a Thing
It is possible for affordances of different kinds to have the same effect. For instance, an affordance to a writable property may be equivalent to an affordance to invoke an action that changes the property value. Similarly, for every observable property, there may be an equivalent affordance to subscribe to an event that occurs at every property value change.
WoT clients can avoid having to deal with these discrepancies by using the generic td:hasInteractionAffordance
predicate. They can then decide to perform an action based solely on the operation type of the form embedded in the affordance object.
5.4 Specifying Affordances by Device Classes
It is possible to use the TD ontology to extend the definition of well-known subclasses of Thing
by defining expected affordances that Things of such types should present. The following example specifies that every temperature sensor presents an affordance to a temperature property (expressed in the SAREF vocabulary [smartM2M]).
A. References
A.1 Informative references
- [RFC5134]
- A Uniform Resource Name Namespace for the EPCglobal Electronic Product Code (EPC) and Related Standards. M. Mealling. IETF. January 2008. Informational. URL: https://tools.ietf.org/html/rfc5134
- [shacl]
- Shapes Constraint Language (SHACL). Holger Knublauch; Dimitris Kontokostas. W3C. 20 July 2017. W3C Recommendation. URL: https://www.w3.org/TR/shacl/
- [smartM2M]
- ETSI TS 103 264 V2.1.1 (2017-03): SmartM2M; Smart Appliances; Reference Ontology and oneM2M Mapping. ETSI. March 2017. Published. URL: http://www.etsi.org/deliver/etsi_ts/103200_103299/103264/02.01.01_60/ts_103264v020101p.pdf
- [vocab-ssn]
- Semantic Sensor Network Ontology. Armin Haller; Krzysztof Janowicz; Simon Cox; Danh Le Phuoc; Kerry Taylor; Maxime Lefrançois. W3C. 19 October 2017. W3C Recommendation. URL: https://www.w3.org/TR/vocab-ssn/
- [WOT-ARCHITECTURE]
- Web of Things (WoT) Architecture. Matthias Kovatsch; Ryuichi Matsukura; Michael Lagally; Toru Kawaguchi; Kunihiko Toumura; Kazuo Kajimoto. W3C. 9 April 2020. W3C Recommendation. URL: https://www.w3.org/TR/wot-architecture/
- [WOT-THING-DESCRIPTION]
- Web of Things (WoT) Thing Description. Sebastian Käbisch; Takuki Kamiya; Michael McCool; Victor Charpenay; Matthias Kovatsch. W3C. 9 April 2020. W3C Recommendation. URL: https://www.w3.org/TR/wot-thing-description/
[출처] https://www.w3.org/2019/wot/json-schema
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.