Reasoning with Rules
SWRL as Example
Jan Pettersen Nytun, UIA
1
Reasoning with Rules SWRL as Example Jan Pettersen Nytun, UIA 1 - - PowerPoint PPT Presentation
Reasoning with Rules SWRL as Example Jan Pettersen Nytun, UIA 1 JPN, UiA 2 What is a rule? Consist of premise and a conclusion. Meaning: In any situation where the premise applies the conclusion must also hold. premise conclusion
1
JPN, UiA 2
JPN, UiA 3
4
From Wikipedia, the free encyclopedia
JPN, UiA 5
Not as strong as for deductive reasoning
S O P
From Wikipedia, the free encyclopedia
JPN, UiA 6
JPN, UiA 7
also Called Deductive Logic, Logical Deduction
JPN, UiA 8
From Wikipedia, the free encyclopedia
JPN, UiA 9
JPN, UiA 10
JPN, UiA 11
From Wikipedia, the free encyclopedia
JPN, UiA 12
[https://explorable.com/inductive-reasoning]
Theories have to be tested and hypotheses answered before the scientific community accepts them as truth.
JPN, UiA 13
would be unsurprising that the grass is wet. Therefore, by abductive reasoning, the possibility that it rained last night is reasonable. Some other process could have also resulted in a wet grass, such as sprinklers. Consequently, abducing that it rained last night from the observation of wet grass can lead to a false conclusion.
From Wikipedia, the free encyclopedia
JPN, UiA 14
JPN, UiA 15
ref.: https://www.quora.com/What-is-a-good-example-of-abductive-reasoning
16
JPN, UiA 17
Knowledge Representation, Part II, JPN, UiA 18
hasParent(?x,?parent) ∧ hasBrother(?parent,?uncle) ⇒ hasUncle(?x,?uncle)
Example of rule using The Semantic Web Rule Language (SWRL):
19
JPN, UiA 20
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ
JPN, UiA 21
atom ^ atom .... → atom ^ atom
head body body and head consist of positive conjunctions of atoms (only AND between atoms)
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ
JPN, UiA 22
All variables in SWRL are treated as universally quantified (), with their scope limited to a given rule.
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ hasParent(?x,?parent) ∧ hasBrother(?parent,?uncle) ⇒ hasUncle(?x,?uncle)
E.g., given: This rule applies for all ?x, all ?parent and all ?uncle.
23
JPN, UiA 24
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ
JPN, UiA 25
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ
JPN, UiA 26
JPN, UiA 27
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ
JPN, UiA 28
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ
JPN, UiA 29
Arguments representing OWL individuals. Examples: sameAs(?x, ?y) sameAs(Fred, Freddy)
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ
JPN, UiA 30
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ
JPN, UiA 31
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ
SWRL support user-defined built-ins. A built-in is a predicate that takes one or more arguments and evaluates to true if the arguments satisfy the predicate. SWRL contained many built-ins. Example - Person with an age of greater than 17 is an adult is: :
Person(?p) ^ hasAge(?p, ?age) ^ swrlb:greaterThan(?age, 17) -> Adult(?p) (swrlb is a namespace)
JPN, UiA 32
Person(?p) ^ hasNumber(?p, ?number) ^ swrlb:startsWith(?number, "+") hasInternationalNumber(?p, true)
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ
JPN, UiA 33
Ref.: https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ
34
JPN, UiA 35
Example:
JPN, UiA 36
JPN, UiA 37
:authorOf rdf:type owl:ObjectProperty . :Book rdf:type owl:Class . :Person rdf:type owl:Class . :BookAuthor rdf:type owl:Class ;
[ owl:intersectionOf ( :Person [ rdf:type owl:Restriction ;
] ) ; rdf:type owl:Class ] . :aDollsHouse rdf:type owl:NamedIndividual , :Book . :ibsen rdf:type owl:NamedIndividual , :Person ; :authorOf :aDollsHouse , :peerGynt . :notAnAuthorPerson rdf:type owl:NamedIndividual , :Person . :peerGynt rdf:type owl:NamedIndividual , :Book .
JPN, UiA 38
JPN, UiA 39
JPN, UiA 40
JPN, UiA 41
After pressing
JPN, UiA 42
JPN, UiA 43
JPN, UiA 44
45
JPN, UiA 46
JPN, UiA 47
JPN, UiA 48
JPN, UiA 49
JPN, UiA 50
JPN, UiA 51
JPN, UiA 52
JPN, UiA 53
JPN, UiA 54
JPN, UiA 55
JPN, UiA 56
Add the following to test:
JPN, UiA 57
“Everything that can be ordered as a dish actually is a dish.”
Jan Pettersen Nytun, UiA, page 58
Foundations of Semantic Web Technologies, Pascal Hitzler, Markus Krötzsch, Sebastian Rudolph, Chapman & Hall/CRC, 2009
http://www.powershow.com/view4/5a7f2a- OGRlM/SWRL_Semantic_Web_Rule_Language_powerpoint_ppt_presentation
Help SWRL Protégé 5: https://github.com/protegeproject/swrlapi/wiki