Skip to content

ExtensionsBuiltInLibrary

zippyrate edited this page Sep 10, 2014 · 2 revisions

The SWRL Extensions built-in library is one of the SWRLAPI Built-in Libraries. It contains experimental convenience methods. It allows users to, for example, directly create new individuals in a rule.

The built-ins in this library are defined by the SWRLX Ontology. The default prefix is swrlx.

The following are the methods defined by this library:

  • makeOWLThing This built-in provides a controlled way of creating OWL individuals in a rule. It takes two or more arguments. The first argument should be an unbound variable; an OWL individual created by the built-in will be bound to this variable. The second and subsequent arguments represent a pattern. For each set of values matching this pattern the built-in will create an OWL individual of type OWL:Thing and bind it to the first argument. So, for example, the built-in atom swrlx:makeOWLThing(?x, ?y) will cause an individual to be created and bound to ?x for every value of variable ?y matched in a rule; the built-in atom swrlx:makeOWLThing(?x, ?y, ?z) will cause an individual to be created and bound to ?x for all value combinations of ?y and ?z in a rule. If the first argument is already bound when the built-in is called, this method returns true and no individual is created. This method effectively allows the more direct introduction of existentials in SWRL rules. While SWRL does theoretically allow the use of existentials with OWL's owl:someValuesFrom restriction (cf. Section 2.1 of the SWRL Submission), existential formulations using this restriction are far from convenient. However, while not convenient, existential created in this way are theoretically safe. In contrast, existentials created using this built-in will be beyond the immediate reach of OWL classifiers. They should probably not be stored permanently in an OWL ontology.

Examples

For every individual of class Person in an ontology create an individual of class Patient and move the values of a person's hasSSN property to the associated patient's hasPID property:

Person(?person) ^ hasSSN(?person, ?ssn) ^ swrlx:makeOWLThing(?patient, ?person) → Patient(?patient) ^ hasPID(?patient, ?ssn)