Repository navigation
How to model an adapter
In the following we describe step by step how to semantically describe an adapter and its resources. At the beginning we have to define used prefixes:
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix omn: <http://open-multinet.info/ontology/omn#> .
@prefix motorgarage: <http://open-multinet.info/ontology/resource/motorgarage#> .
@prefix motor: <http://open-multinet.info/ontology/resource/motor#> .
@prefix omn-lifecycle: <http://open-multinet.info/ontology/omn-lifecycle#> .
@prefix omn-federation: <http://open-multinet.info/ontology/omn-federation#> .
@prefix wgs: <http://www.w3.org/2003/01/geo/wgs84_pos#> .Then we have to describe the adapter itself. The semantic description consists of Subject representing the described entity, Predicate presenting entity’s property and Object presenting the associated value. In our example, the Subject of the following triples is MotorGarage . It has many properties to describe it such as a which is an abbreviation for the property rdf:type . The value of this property is owl:Class . This triple means that MotorGarage is from type Class. If properties are belonging to the same Subject, the triples are separated by semicolons. The third triples in the following example means that MotorGarage is a Adapter. The fourth and last triples describing the adapter means that MotorGarage implements a Motor. Motor is the resource managed by this adapter. Note that this part of the description finishes with dot. It means that the description of previous Subject is finished.
motorgarage:MotorGarage
a owl:Class ;
rdfs:label "MotorGarage"@en ;
rdfs:subClassOf omn:Adapter ;
omn-lifecycle:implements motor:Motor .After describing the adapter we have to describe the resources managed by this adapter. In the following example we see that we have a Resource from type Class, its label is Motor and is implemented by MotorGarage which is our adapter:
motor:Motor
a owl:Class ;
rdfs:label "Motor"@en ;
rdfs:subClassOf omn:Resource ;
omn-lifecycle:implementedBy motorgarage:MotorGarage .Our Motor has many properties: manufacturer, throttle, isDynamic, rpm and maxRpm. The domain of each property is the Motor. This means the subject of such a triples should be an instance of the resource Motor. The value of the properties could be string or integer or boolean or something else. In case of the property manufacturer the type is string. It could be configured by using rdfs:range
motor:manufacturer a owl:DatatypeProperty ; a owl:FunctionalProperty ; rdfs:domain motor:Motor ; rdfs:label "manufacturer"@en ; rdfs:range xsd:string .motor:throttle a owl:DatatypeProperty ; a owl:FunctionalProperty ; rdfs:domain motor:Motor ; rdfs:label "throttle"@en ; rdfs:range xsd:integer .motor:isDynamic a owl:DatatypeProperty ; a owl:FunctionalProperty ; rdfs:domain motor:Motor ; rdfs:label "dynamic"@en ; rdfs:range xsd:boolean .motor:rpm a owl:DatatypeProperty ; a owl:FunctionalProperty ; rdfs:domain motor:Motor ; rdfs:label "rounds per minutes"@en ; rdfs:range xsd:integer .motor:maxRpm a owl:DatatypeProperty ; a owl:FunctionalProperty ; rdfs:domain motor:Motor ; rdfs:label "maximum rounds per minute"@en ; rdfs:range xsd:integer .