6.8 _<ontology>_ Operations
6.8.1 Introduction
Each <ontology> resource represents an ontology under management in the oneM2M system. It may contain the full representation or the IRI reference of the managed ontology. It is managed by simple CRUD operations as ordinary resource or by more advanced SPARQL operations (contained in the payload of the Update and Retrieve) at the granularity of RDF-triple level.
6.8.2 Create <ontology>
This procedure shall be used for deleting an existing <ontology> resource.
Table 6.8.2-1:<ontology> CREATE
<ontology> CREATE | <ontology> CREATE |
---|---|
Associated Reference Point | Mca, Mcc and Mcc' |
Information in Request message | All parameters defined in table 8.1.2-2 in oneM2M TS-0001 [1] apply with the specific details for: Content: The resource content shall provide the information as defined in clause 9.6.51 in oneM2M TS-0001 [1]. |
Processing at Originator before sending Request | According to clause 10.1.2 in oneM2M TS-0001 [1]. |
Processing at Receiver | According to clause 10.1.2 in oneM2M TS-0001 [1] with the specific details as follows: The Hosting CSE shall check that the ontologyContent attribute conforms to the syntax as defined in the ontologyFormat attribute. |
Information in Response message | According to clause 10.1.2 in oneM2M TS-0001 [1]. |
Processing at Originator after receiving Response | According to clause 10.1.2 in oneM2M TS-0001 [1]. |
Exceptions | According to clause 10.1.2 in oneM2M TS-0001 [1]. |
6.8.3 Retrieve <ontology>
This procedure shall be used for deleting an existing_<ontology>_ resource.
Table 6.8.3-1: :<ontology>_ RETRIEVE
<ontology> RETRIEVE | <ontology> RETRIEVE |
---|---|
Associated Reference Point | Mca, Mcc and Mcc'. |
Information in Request message | All parameters defined in table 8.1.2-2 in oneM2M TS-0001 [1]. |
Processing at Originator before sending Request | According to clause 10.1.3 in oneM2M TS-0001 [1]. |
Processing at Receiver | According to clause 10.1.3 in oneM2M TS-0001 [1]. |
Information in Response message | All parameters defined in table 8.1.3-1 in oneM2M TS-0001 [1] apply. |
Processing at Originator after receiving Response | According to clause 10.1.3 in oneM2M TS-0001 [1]. |
Exceptions | According to clause 10.1.3 in oneM2M TS-0001 [1]. |
6.8.4 Update <ontology>
This procedure shall be used for deleting an existing_<ontology>_ resource.
Table 6.8.4-1: <ontology> UPDATE
<ontology> UPDATE | <ontology> UPDATE |
---|---|
Associated Reference Point | Mca, Mcc and Mcc' |
Information in Request message | All parameters defined in table 8.1.2-2 in oneM2M TS-0001 [1] shall apply with the specific details for the Content request parameter which may contain the new ontology information in one of the following ways: the full representation of the new ontology triples in the ontologyContent attribute; or the new IRI of the ontology in the ontologyContent attribute; or the partial representation of the new ontology as described in SPARQL statements [2] in the semanticOpExec attribute in the case that the ontologyFormat is not 'IRI'. |
Processing at Originator before sending Request | According to clause 10.1.4 in oneM2M TS-0001 [1]. |
Processing at Receiver | According to clause 10.1.4 in oneM2M TS-0001 [1] with the specific details as follows: Check if both semanticOpExec attribute and ontologyContent attribute exist in the the Content request parameter, if so, return an error code. In the case that the Content request parameter contains partial representation of the new ontology as described in SPARQL statements [2] in the semanticOpExec attribute, and the ontologyFormat is not set to 'IRI', the Hosting CSE shall update the ontologyContent attribute according to the execution result of the SPARQL statements [2]. In the case that the Content request parameter contains the ontologyContent attribute, the Hosting CSE shall check that the ontologyContent attribute conforms to the syntax as defined in the ontologyFormat attribute. |
Information in Response message | According to clause 10.1.4 in oneM2M TS-0001 [1]. |
Processing at Originator after receiving Response | According to clause 10.1.4 in oneM2M TS-0001 [1]. |
Exceptions | According to clause 10.1.4 in oneM2M TS-0001 [1]. |
6.8.5 Delete <ontology>
Table 6.8.5-1: <ontology> DELETE
__< ontology > DELETE | __< ontology > DELETE |
---|---|
Associated Reference Point | Mca, Mcc and Mcc' |
Information in Request message | All parameters defined in table 8.1.2-2 in oneM2M TS-0001 [1] apply. |
Processing at Originator before sending Request | According to clause 10.1.5 in oneM2M TS-0001 [1]. |
Processing at Receiver | According to clause 10.1.5 in oneM2M TS-0001 [1]. |
Information in Response message | According to clause 10.1.5 in oneM2M TS-0001 [1]. |
Processing at Originator after receiving Response | According to clause 10.1.5 in oneM2M TS-0001 [1]. |
Exceptions | According to clause 10.1.5 in oneM2M TS-0001 [1]. |
6.8.6 Semantic query on <ontology> resource via Retrieve
Table 6.8.6-1: Semantic query on <ontology> resource via RETRIEVE
Semantic query on <ontology> resource via RETRIEVE | Semantic query on <ontology> resource via RETRIEVE |
---|---|
Associated Reference Point | Mca, Mcc and Mcc' |
Information in Request message | All parameters defined in table 8.1.2-2 in oneM2M TS-0001 [1] apply. In addition, the semantic query request shall be issued as a RETRIEVE operation with: A SPARQL query statement in the semanticsFilter condition tag of the Filter Criteria request parameter. A Result Content request parameter with the value set to 'semantic-content'. A Semantic Query Indicator request parameter with the value set to 'TRUE'. See more details in clause 7.5. |
Processing at Originator before sending Request | According to clause 10.1.3 in oneM2M TS-0001 [1]. |
Processing at Receiver | According to clause 10.1.3 in oneM2M TS-0001 [1] with the following specific details: The hosting CSE shall execute the SPARQL query statement against the content attribute of the <ontology> resource and return the SPARQL result to the Originator. If the content attribute contains IRI of an external ontology, the hosting CSE shall retrieve the referenced ontology following the IRI and perform the SPARQL query against it. If the content attribute contains the RDF triples, the SPARQL query can be performed directly against it. |
Information in Response message | According to clause 10.1.3 in oneM2M TS-0001 [1]. |
Processing at Originator after receiving Response | According to clause 10.1.3 in oneM2M TS-0001 [1]. |
Exceptions | According to clause 10.1.3 in oneM2M TS-0001 [1]. |
Semantic query defined in clause 7.5 shall be used for retrieving the semantic information (triples) from an <ontology> resource.
Some SPARQL query statement examples are given as follows:
- get all classes of an ontology:
- SELECT ?subject WHERE { ?subject rdfs:subClassOf+ owl:Thing }
- get all object | data properties of ontology:
- SELECT ?subject WHERE { {?subject rdf:type+ owl:ObjectProperty } UNION {?subject rdf:type+ owl:DatatypeProperty } }
- get direct subclasses of class A:
- SELECT ?subject WHERE { ?subject rdfs:subClassOf saref:Command }
- get also transitive subclasses class A:
- e.g. if information from instances of class A is requested, all subclasses of class A also need to be included as they are also instances of class A;
- SELECT ?subject WHERE { ?subject rdfs:subClassOf + saref:Command }
- get all the superclasses of class A:
- e.g. if for derived ontologies the class of the base ontology needs to be found from which the class is derived, for example to apply rules defined for the base ontology, e.g. for creating a resource structure;
- SELECT ?object WHERE { saref:SetAbsoluteLevelCommand rdfs:subClassOf + ?object }
- get all object | data properties where class A is in the domain:
- e.g. to find out what properties an instance of class A can possibly have;
- SELECT ?subject ?object WHERE { ?subject rdfs:domain saref:Service }
- get all object | data properties where class A is in the range:
- SELECT ?subject ?object WHERE { ?subject rdfs:range saref:Command }
- get all sub-properties of a property A:
- e.g. if information concerning property A is requested all sub-properties of A also need to be included;
- SELECT ?subject WHERE { ?subject rdfs:subPropertyOf om:singular_unit
- get classes that are equivalent to class A:
- SELECT ?class WHERE {{ saref:Device owl:equivalentClass ?class} UNION {?class owl:equivalentClass saref:Device}}
Editor's note: correct the code in step 8 (missing closing bracket)