To jest stara wersja strony!
Before the Lab
Read:
Reasoning on the Web - summary:
queries
DL reasoning
rules over ontologies
-
SWRL Semantic Web Rule Language based on OWL
OWL 2 RL - new version of OWL, additional constructs for expressing rules in the ontology
Lab instruction
DL Reasoning
-
-
Browse sample ontologies with
OwlSight (using Pellet as a DL reasoner)
SWRL
In this exercise we will use Protege editor with the SWRLTab plugin.
Depending on the configurations, Pellet/Jess may be used to execute SWRL rules.
-
Download
family ontology with rules. Open it in Protege, anayze the rules. Enable JessTab (Project→Configure) and run the rules iteratively. Check the inferred axioms.
Open Protege editor and enable SWRL Tab (Project→Configure in Protege 3.4.4)
Implement an example
expert system - an expert system for recognizing animals:
define Classes used in the system (look for isa
predicate): Mammal, Bird, Carnivore, etc.
define characteristics of the animals (There Is More Than One Way To Do It!)
as Properties, e.g.: has
as Classes, e.g. Swims
Make assertions about individuals, e.g. has(dennis,hair). parent(dennis,diana). Swims(denzel).
Define rules of the system
Express the initial data as appropriate assertions
Run Pellet/Jess to execute the rules. Observe the inferred facts. Execute the rule engine iteratively, till no more information can be concluded.
extra task: add more rules to the system, use built-in SWRL predicates.
Examples
rule id1:
[1: has(X,hair)]
==>
[assert(isa(X,mammal)),
retract(all)].
has(?x,„hair”) → Mammal(?x)
rule id4:
[1: flies(X),
2: lays_eggs(X)]
==>
[assert(isa(X,bird)),
retract(all)].
Flies(?x) ∧ Lays_eggs(?x) → Bird(?x)
Initial data
initial_data([
has(dennis,hair),
has(dennis,hoofs),
has(dennis,black_stripes),
parent(dennis,diana)
]).
Rules in OWL2RL
Read: OWL 2 and Rules slides
Control questions:
If Protege 4.1. is available:
Run Protege: protege4
Create a new ontology in Protege
-
extra task: if there is enough time, model the animals expert system in OWL 2 RL
If you want to know more
Further reading:
Test cases for OWL2 (incl.OWL2RL):