284
Internet of Things (IoT)
is the interoperation. Developing a language for sharing rules is often seen as a key step
in reaching this goal.
Expressing all relations using OWL 2 language is very difficult. For example, OWL
cannot express the relation child of married parents, because there is no way in OWL 2 to
express the relation between resources with which a resource has relations. By adding
SWRL rules (Horrocks et al. 2004) to an ontology, the expressivity of OWL can be extended.
SWRL rules are similar to rules in DATALOG or Prolog languages. SWRL allows users to
write rules expressed in terms of OWL concepts to reason about OWL individuals. Using
the rules, new knowledge can be inferred from existing knowledge bases. There are many
built-ins which will provide an extension mechanism whereby the modeling language
can be enhanced with domain-specific built-ins. The predicates can be class expressions,
property expressions, data range restrictions, sameIndividual, differentIndividuals, core
SWRL built-ins, and user-defined SWRL built-ins.
SWRL rules with class expressions
The following rule uses a class expression:
Observces(?sensor, health), produces(?sensor,?measurement) →
BodyTemperature(?measurement)
SWRL rules with data range restrictions
The following rule uses a data range restriction:
BodyTemperature(?measurement), hasValue (?measurement,?v), integer[> 36, < 38]( ?v) →
NormalBodyTemperature(?measurement)
The following rule uses the core built-ins:
Precipitation(?measurement),hasValue(?measurement,?v),hasUnit(?measurement, Milimet
erPerHour),swrlb:greaterThan(?v,20),swrlb:lessThan(?v,50) →
HeavyRain((?measurement)
Table 13.6 shows the built-Ins which are defined for various comparisons.
TABLE 13.6
Built-Ins for Comparisons
Built-Ins
Syntax with Comment
swrlb:equal
swrlb:equal(?x,?y)
If argument1 and argument2 are same
swrlb:notEqual
swrlb:notEqual(?x,?y)
If argument1 and argument2 are not same
It is the negation of swrlb:equal
swrlb:lessThan
swrlb:lessThan(?x,?y)
If argument1 is less than argument2
swrlb:lessThanOrEqual
swrlb:lessThanOrEqual(?x,?y)
If argument1 is less than or equal to argument2
swrlb:greaterThan
swrlb:greaterThanOrEqual(?x,?y)
If argument1 is greater than argument2
swrlb:greaterThanOrEqual
swrlb:greaterThanOrEqual(?x,?z)
if argument1 is greater than or equal to argument2
Précédent

- 308/358

Suivant