Prepare for Reasoning with SWRL

This lecture was originally prepared by Susana Rodriguez de Novoa. Having moved to Protege 4.x, we have not seen how to apply semantic web rules (SWRL) or semantic web rule queries (SQWRL).

= Done prior to the lecture =
 * Create your ontology in Protege 4.3 (or Web Protege)
 * have a simple ontology ready with a SPARQL query
 * formulate your real query in words and tell what you would expect

= Test yourself, answer these questions =
 * What is SWRL?
 * How many Atom types are provided by SWRL?
 * What is a Class atom? What is an Individual Property atom?
 * Does SWRL adopt the Open World Assumption?
 * Does SWRL support OWL Full? and RDF?

(Revisit the "rules" for the ontologies from everyone)

= Lecture notes =

Lecture notes 2014

 * Notes: [[Media:UNIK4710-L9-v14.pdf]]
 * Video:mms://lux.unik.no/UNIK4710-JN/UNIK-20140328.wmv

Lecture notes 2013

 * Notes: [[Media:UNIK4710-L6-v13.pdf]], [[Media:UNIK4710-L6-v13-part2.pdf]]

Lecture notes 2012

 * Notes: [[Media:UNIK4710-L6-v12.pdf]]

= Presentations =

Presentations 2012

 * [[Media:Semantic_Knowledge_mangement_Arne.ppt]]

Presentations 2013
= Other Info =
 * 'Protégé: SWRL and SQWRL' by Susana, [[Media:UNIK4710-SWRL_Presentation.ppt]], [[Media:UNIK4710-SWRL_Presentation.pdf]]


 * title: Prepare for Reasoning with SWRL
 * author: Susana R. de Novoa
 * subfooter: UNIK4710/UNIK9710

= ⌘ What is SWRL?=
 * 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=
 * 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 = swrlq:select(?p) swrlq:orderBy(?age)
 * A rule antecedent can be viewed as a pattern matching specification, i.e., a query
 * With built-ins, language compliant query extensions are possible.

= ⌘ Creating Rules = = ⌘ Displaying Results =

⌘ Displaying Results: SQWRL


= ⌘ Protege Rules - Examples =
 * Pizza Example: [[Media:pizza_SWRL_SQWRL.zip]]
 * Student-centric learning: http://wiki.unik.no/index.php/Courses/UNIK4710; download Scenario: Student-centric learning by Maurice (.owl.zip)
 * Ontology Example:[[Media:Ontology_SWRL_SQWRL.zip]]

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.