• No results found

2.4 Concrete syntaxes for semantic mapping

2.4.2 SWRL

Semantic Web Rule Language (SWRL) [Horrocks 2004] is a rule language used to express the rules in an ontology in addition to concept definitions. This syntax is based on a combination of OWL and RuleML [Boley 2011], which is a sublanguage of the Rule Markup Language. The syntax includes a high-level abstract syntax for Horn-like rules [Horn 1951] and uses the following vocabularies: XSD, OWLX, RuleML, SWRLX, and SWRLB. These vocabularies offer good expressiveness to describe mappings that may require expressing data range constraints or data value transformations (arithmetic operation). However, this syntax is difficult to generate for its rigidity that often requires domain experts to have intensive training on writing rules. Fig. 2-20 shows an example of a conditional mapping type that has a constraint on the value of a datatype property (data range) using SWRL syntax. In this example, ‘Femto’ class instances that have the property ‘UMTS_Handover_Failure_Rate’ value greater than or equal to 40 and less than or equal to 60, and the property ‘MTS_Handover_Failure_Rate’ value greater than or equal to 40 and less than or equal to 60 are the instances of ‘MediumHandoverFemto’ class.

<swrl:Imp> <swrl:body>

<swrl:AtomList><rdf:first> <swrl:ClassAtom>

27 <swrl:argument1 rdf:resource=“#x”/>

</swrl:ClassAtom></rdf:first><rdf:rest><swrl:AtomList><rdf:first> <swrl:DatavaluedPropertyAtom>

<swrl:propertyPredicate rdf:resource=“#UMTS_Handover_Failure_Rate”/> <swrl:argument1 rdf:resource=“#x”/>

<swrl:argument2 rdf:resource=“#v1”/>

</swrl:DatavaluedPropertyAtom></rdf:first><rdf:rest><swrl:AtomList><rdf:first> <swrl:DatavaluedPropertyAtom>

<swrl:propertyPredicate rdf:resource=“#MTS_Handover_Failure_Rate”/> <swrl:argument1 rdf:resource=“#x”/>

<swrl:argument2 rdf:resource=“#v2”/>

</swrl:DatavaluedPropertyAtom></rdf:first><rdf:rest><swrl:AtomList><rdf:first> <swrl:BuiltinAtom>

<swrl:builtin rdf:resource=“http://www.w3.org/2003/11/swrlb#greaterThanOrEqual”/> <swrl:arguments><rdf:List><rdf:first rdf:resource=“#v1”/><rdf:rest><rdf:List>

<rdf:first rdf:datatype=“http://www.w3.org/2001/XMLSchema#long”>40</rdf:first> <rdf:rest rdf:resource=“http://www.w3.org/1999/02/22-rdf-syntax-ns#nil”/>

</rdf:List></rdf:rest></rdf:List> </swrl:arguments>

</swrl:BuiltinAtom></rdf:first><rdf:rest><swrl:AtomList><rdf:first> <swrl:BuiltinAtom>

<swrl:builtin rdf:resource=“http://www.w3.org/2003/11/swrlb#lessThanOrEqual”/> <swrl:arguments>

<rdf:List><rdf:rest><rdf:List>

<rdf:first rdf:datatype=“http://www.w3.org/2001/XMLSchema#long”>60</rdf:first> <rdf:rest rdf:resource=“http://www.w3.org/1999/02/22-rdf-syntax-ns#nil”/>

</rdf:List></rdf:rest><rdf:first rdf:resource=“#v1”/></rdf:List></swrl:arguments> </swrl:BuiltinAtom></rdf:first><rdf:rest><swrl:AtomList><rdf:first>

<swrl:BuiltinAtom>

<swrl:builtin rdf:resource=“http://www.w3.org/2003/11/swrlb#greaterThanOrEqual”/> <swrl:arguments><rdf:List><rdf:first rdf:resource=“#v2”/><rdf:rest><rdf:List>

<rdf:first rdf:datatype=“http://www.w3.org/2001/XMLSchema#long”>40</rdf:first> <rdf:rest rdf:resource=“http://www.w3.org/1999/02/22-rdf-syntax-ns#nil”/>

</rdf:List></rdf:rest></rdf:List> </swrl:arguments>

</swrl:BuiltinAtom></rdf:first><rdf:rest><swrl:AtomList><rdf:rest

rdf:resource=“http://www.w3.org/1999/02/22-rdf-syntax-ns#nil”/><rdf:first><swrl:BuiltinAtom> <swrl:builtin rdf:resource=“http://www.w3.org/2003/11/swrlb#lessThanOrEqual”/>

<swrl:arguments><rdf:List><rdf:first rdf:resource=“#v2”/><rdf:rest><rdf:List> <rdf:first rdf:datatype=“http://www.w3.org/2001/XMLSchema#long”>60</rdf:first> <rdf:rest rdf:resource=“http://www.w3.org/1999/02/22-rdf-syntax-ns#nil”/> </rdf:List></rdf:rest></rdf:List> </swrl:arguments> </swrl:BuiltinAtom> </rdf:first></swrl:AtomList></rdf:rest></swrl:AtomList></rdf:rest></swrl:AtomList></rdf:rest></sw rl:AtomList></rdf:rest></swrl:AtomList></rdf:rest></swrl:AtomList></rdf:rest></swrl:AtomList> </swrl:body> <swrl:head> <swrl:AtomList><rdf:first> <swrl:ClassAtom>

<swrl:classPredicate rdf:resource=“#MediumHandoverFemto”/> <swrl:argument1 rdf:resource=“#x”/>

</swrl:ClassAtom></rdf:first><rdf:rest rdf:resource=“http://www.w3.org/1999/02/22-rdf-syntax- ns#nil”/></swrl:AtomList>

</swrl:head> </swrl:Imp>

28

Fig. 2-21 shows an example of a transformation mapping type that transforms the data value of a property (unit transformation) using SWRL syntax. In this example, the property ‘MTS_Handover_Failure_Rate’ value of the instance in ‘Femto’ class will be assigned by the transformation of values of the ‘hasNPMData’ instance properties ‘VS_HHO_AttBsrUmtsIntraFreq’ and ‘VS_HHO_SuccBsrUmtsIntraFreq’ by the arithmetic operation ((1 subtract by (‘VS_HHO_SuccBsrUmtsIntraFreq’ value divide by ‘VS_HHO_AttBsrUmtsIntraFreq’ value)) multiply by 100).

<swrl:Imp> <swrl:body>

<swrl:AtomList><rdf:first><swrl:ClassAtom><swrl:classPredicate rdf:resource=“http://www.owl- ontologies.com/Ontology1304066878.owl#Femto”/><swrl:argument1 rdf:resource=“http://www.owl- ontologies.com/Ontology1304066878.owl#x”/></swrl:ClassAtom></rdf:first><rdf:rest><swrl:AtomL ist><rdf:rest><swrl:AtomList><rdf:first><swrl:DatavaluedPropertyAtom><swrl:propertyPredicate rdf:resource=“http://www.owl-

ontologies.com/Ontology1304066878.owl#VS_HHO_AttBsrUmtsIntraFreq”/><swrl:argument1 rdf:resource=“http://www.owl-ontologies.com/Ontology1304066878.owl#pm1”/><swrl:argument2 rdf:resource=“http://www.owl-

ontologies.com/Ontology1304066878.owl#v0”/></swrl:DatavaluedPropertyAtom></rdf:first><rdf:res t><swrl:AtomList><rdf:rest><swrl:AtomList><rdf:first>

<swrl:BuiltinAtom><swrl:builtin rdf:resource=“&swrlb;divide”/>

<swrl:arguments rdf:parseType=“Collection”><rdf:Description rdf:about=“http://www.owl- ontologies.com/Ontology1304066878.owl#div1”/><rdf:Description rdf:about=“http://www.owl- ontologies.com/Ontology1304066878.owl#v1”/><rdf:Description rdf:about=“http://www.owl- ontologies.com/Ontology1304066878.owl#v0”/></swrl:arguments></swrl:BuiltinAtom></rdf:first>< rdf:rest><swrl:AtomList><rdf:first>

<swrl:BuiltinAtom><swrl:builtin rdf:resource=“&swrlb;multiply”/>

<swrl:arguments><rdf:Description><rdf:type rdf:resource=“&rdf;List”/><rdf:first rdf:resource=“http://www.owl-

ontologies.com/Ontology1304066878.owl#ans”/><rdf:rest><rdf:Description><rdf:type rdf:resource=“&rdf;List”/><rdf:first rdf:datatype=“&xsd;long”>100</rdf:first><rdf:rest rdf:parseType=“Collection”><rdf:Description rdf:about=“http://www.owl-

ontologies.com/Ontology1304066878.owl#sub1”/></rdf:rest></rdf:Description></rdf:rest></rdf:Desc ription></swrl:arguments></swrl:BuiltinAtom></rdf:first><rdf:rest><swrl:AtomList><rdf:rest rdf:resource=“&rdf;nil”/><rdf:first>

<swrl:BuiltinAtom><swrl:builtin rdf:resource=“&swrlb;subtract”/>

<swrl:arguments><rdf:Description><rdf:type rdf:resource=“&rdf;List”/><rdf:first rdf:resource=“http://www.owl-

ontologies.com/Ontology1304066878.owl#sub1”/><rdf:rest><rdf:Description><rdf:type rdf:resource=“&rdf;List”/><rdf:first rdf:datatype=“&xsd;long”>1</rdf:first><rdf:rest rdf:parseType=“Collection”><rdf:Description rdf:about=“http://www.owl- ontologies.com/Ontology1304066878.owl#div1”/></rdf:rest></rdf:Description></rdf:rest></rdf:Desc ription></swrl:arguments></swrl:BuiltinAtom></rdf:first></swrl:AtomList> </rdf:rest></swrl:AtomList> </rdf:rest></swrl:AtomList> </rdf:rest><rdf:first><swrl:DatavaluedPropertyAtom><swrl:propertyPredicate rdf:resource=“http://www.owl-

ontologies.com/Ontology1304066878.owl#VS_HHO_SuccBsrUmtsIntraFreq”/><swrl:argument1 rdf:resource=“http://www.owl-ontologies.com/Ontology1304066878.owl#pm1”/><swrl:argument2 rdf:resource=“http://www.owl-

ontologies.com/Ontology1304066878.owl#v1”/></swrl:DatavaluedPropertyAtom></rdf:first></swrl: AtomList>

29 </rdf:rest></swrl:AtomList>

</rdf:rest><rdf:first><swrl:IndividualPropertyAtom><swrl:propertyPredicate rdf:resource=“http://www.owl-

ontologies.com/Ontology1304066878.owl#hasNPMData”/><swrl:argument2

rdf:resource=“http://www.owl-ontologies.com/Ontology1304066878.owl#pm1”/><swrl:argument1 rdf:resource=“http://www.owl- ontologies.com/Ontology1304066878.owl#x”/></swrl:IndividualPropertyAtom></rdf:first></swrl:At omList> </rdf:rest></swrl:AtomList> </swrl:body> <swrl:head> <swrl:AtomList><rdf:rest rdf:resource=“&rdf;nil”/><rdf:first><swrl:DatavaluedPropertyAtom><swrl:propertyPredicate rdf:resource=“http://www.owl-

ontologies.com/Ontology1304066878.owl#MTS_Handover_Failure_Rate”/><swrl:argument2 rdf:resource=“http://www.owl-ontologies.com/Ontology1304066878.owl#ans”/><swrl:argument1 rdf:resource=“http://www.owl- ontologies.com/Ontology1304066878.owl#x”/></swrl:DatavaluedPropertyAtom></rdf:first></swrl:A tomList> </swrl:head> </swrl:Imp>

Figure 2-21 SWRL syntax example for transformation mapping type

Related documents