Prepare for Reasoning with SWRL

Susana R. de Novoa

What is SWRL?

Rules and Ontologies
  • SWRL is an acronym for Semantic Web Rule Language.
  • SWRL is intended to be the rule language of the Semantic Web.
  • All rules are expressed in terms of OWL concepts (classes, properties, individuals).
  • Ontology languages do not offer the expressiveness we want → Rules do it well.

What is Jess?

  • Jess system consists of a rule base, fact base, and an execution engine.
  • Has been used in Protégé-based tools, e.g., SWRLJessTab, SweetJess, JessTab.
  • Download Jess: http://herzberg.ca.sandia.gov/
  • Install Jess:
    • Unzip Jess70p2.zip
    • Copy Jess70p2\Jess70p2\lib\jess.jar to
    • [Protégé install Folder]/plugins/edu.stanford.smi.protegex.owl/

SWRL Rules

Rule
  • Contains an antecedent part(body), and a consequent (head).
  • The body and head consist of positive conjunctions of atoms: Atom ^ Atom … → Atom ^ Atom ….
  • An atom is an expression of the form: P(arg1 arg2,...)
    • P is a predicate symbol (classes, properties...)
    • Arguments of the expression: arg1, arg2,… (individuals, data values or variables)

SWRL Atoms

  • Class Atom: Consists of an OWL named class or class expression and a single argument representing an OWL individual. Person(?p)
  • Individual Property atoms: Consists of an OWL object property and two arguments representing OWL individuals. hasBrother(?x, ?y)
  • Data Valued Property atoms: A data valued property atom consists of an OWL data property and two arguments ( OWL individual , data value). hasAge(?x, ?age)
  • Different & Same Individuals atoms: SWRL supports sameAs and differentFrom atoms to determine if individuals refer to the same underlying individual or are distinct, and can use owl:sameAs, owl:allDifferents. sameAs(?x, ?y)
  • Built-in atoms: A built-in is a predicate that takes one or more arguments and evaluates to true if the arguments satisfy the predicate. swrlb:greaterThan(?age, 17)  

SQWRL

  • A rule antecedent can be viewed as a pattern matching specification, i.e., a query
  • With built-ins, language compliant query extensions are possible.

swrlq:select(?p) swrlq:orderBy(?age)

Creating Rules

Creating Rules

Displaying Results

Displaying Results: SWRL

SWRL Tab

Displaying Results: SQWRL

SQWRL Tab

Protege Rules - Examples

In the student-centric learning Maurice developed an ontology providing students just the content they need in a given situation. Focus was here on the communication, e.g. which devices the user had, what kind of bandwidth, in what environment he was listening to the course. We are still looking for tools allowing the user to judge himself, and adapt the course content to his needs.