Difference between revisions of "Description Logic"

From BC$ MobileTV Wiki
Jump to: navigation, search
(Tools)
 
(5 intermediate revisions by the same user not shown)
Line 12: Line 12:
 
== EXAMPLE ==
 
== EXAMPLE ==
  
'''FACTS - Simpson Family tree'''
+
'''FACTS - Simpson Family tree'''<ref>The Simpson's Family tree: http://en.wikipedia.org/wiki/Simpson_family</ref>
 
<pre>
 
<pre>
 
lastname('simpson').
 
lastname('simpson').
Line 21: Line 21:
 
kitty('snowball II').
 
kitty('snowball II').
 
hasFather('homer','abe').
 
hasFather('homer','abe').
 +
hasMother('homer','mona').
 +
hasFather('marge','clancy').
 
hasMother('marge','jacqueline').
 
hasMother('marge','jacqueline').
 
hasBrother('homer','herb').
 
hasBrother('homer','herb').
Line 27: Line 29:
 
hasSon('homer','bart').
 
hasSon('homer','bart').
 
hasSon('marge','bart').
 
hasSon('marge','bart').
 +
hasAdoptedDaughter('selma','ling').
 
hasDaughter('homer','lisa').
 
hasDaughter('homer','lisa').
 
hasDaughter('marge','lisa').
 
hasDaughter('marge','lisa').
Line 35: Line 38:
 
hasPet('simpson','snowball II').
 
hasPet('simpson','snowball II').
 
areMarried('homer','marge').
 
areMarried('homer','marge').
 +
isUncle(?y,?z) :- hasBrother(?x,?y), hasSon(?x,?z).
 +
isAunt(?y,?z) :- hasSister(?x,?y), hasDaughter(?x,?z).
 +
isGrandfather(?y,?z) :- hasFather(?x,?y), hasSon(?x,?z).
 +
isGrandmother(?y,?z) :- hasMother(?x,?y), hasDaughter(?x,?z).
 
isMale(?x) :- man(?x).
 
isMale(?x) :- man(?x).
 
isFemale(?x) :- woman(?x).
 
isFemale(?x) :- woman(?x).
Line 42: Line 49:
 
isFemale(?x) :- kitty(?x).
 
isFemale(?x) :- kitty(?x).
 
isMale(?y) :- hasSon(?x,?y).
 
isMale(?y) :- hasSon(?x,?y).
isUncle(?y,?z) :- hasBrother(?x,?y), hasSon(?x,?z).
+
isFemale(?y) :- hasDaughter(?x,?y).
isAunt(?y,?z) :- hasSister(?x,?y), hasDaughter(?x,?z).
+
isMale(?y) :- hasAdoptedSon(?x,?y).
isGrandfather(?y,?z) :- hasFather(?x,?y), hasSon(?x,?z).
+
isFemale(?y) :- hasAdoptedDaughter(?x,?y).
isGrandmother(?y,?z) :- hasMother(?x,?y), hasDaughter(?x,?z).
+
isMale(?y) :- hasBrother(?x,?y).
 +
isFemale(?y) :- hasSister(?x,?y).
 +
isMale(?y) :- hasFather(?x,?y).
 +
isFemale(?y) :- hasMother(?x,?y).
 
isFamily(?x) :- areMarried(?x,?y).
 
isFamily(?x) :- areMarried(?x,?y).
 
isFamily(?y) :- areMarried(?x,?y).
 
isFamily(?y) :- areMarried(?x,?y).
 
isFamily(?y) :- hasSon(?x,?y).
 
isFamily(?y) :- hasSon(?x,?y).
 
isFamily(?y) :- hasDaughter(?x,?y).
 
isFamily(?y) :- hasDaughter(?x,?y).
isExtendedFamily(?x) :- isFamily(?x,?y).
+
isExtendedFamily(?y) :- isFamily(?x,?y).
 +
isExtendedFamily(?y) :- hasAdoptedSon(?x,?y).
 +
isExtendedFamily(?y) :- hasAdoptedDaughter(?x,?y).
 
isExtendedFamily(?x) :- isGrandfather(?x,?y).
 
isExtendedFamily(?x) :- isGrandfather(?x,?y).
 
isExtendedFamily(?x) :- isGrandmother(?x,?y).
 
isExtendedFamily(?x) :- isGrandmother(?x,?y).
 
isExtendedFamily(?x) :- isAunt(?x,?y).
 
isExtendedFamily(?x) :- isAunt(?x,?y).
 
isExtendedFamily(?x) :- isUncle(?x,?y).
 
isExtendedFamily(?x) :- isUncle(?x,?y).
isExtendedFamily(?y) :- hasPet(?x,?y).
 
 
</pre>
 
</pre>
  
'''EXAMPLE QUERY #1 - Which Simpsons are male? (infers that Bart and Santa's Little Helper are male from "son" and "dog" relationship)'''
+
'''EXAMPLE QUERY #1 - Which Simpsons are male? (infers that Bart, Homer, Abe, Herb, Santa's Little Helper are male from "son", ,"uncle", "grandfather" relationships, as well as "man" and "dog" fact)'''
 
<pre>
 
<pre>
 
?-isMale(?x).
 
?-isMale(?x).
Line 93: Line 104:
  
 
* '''IRIS Reasoner: http://iris-reasoner.org'''<ref>http://iris-reasoner.org/demo</ref>
 
* '''IRIS Reasoner: http://iris-reasoner.org'''<ref>http://iris-reasoner.org/demo</ref>
 +
* RACER: http://www.ifis.uni-luebeck.de/~moeller/racer/index.html
 
* DL-Learner: http://sourceforge.net/projects/dl-learner/
 
* DL-Learner: http://sourceforge.net/projects/dl-learner/
 
* Description Logic - Complexity of Reasoning (calculator/tool): http://www.cs.man.ac.uk/~ezolin/dl/
 
* Description Logic - Complexity of Reasoning (calculator/tool): http://www.cs.man.ac.uk/~ezolin/dl/
 
  
 
== Resources ==
 
== Resources ==
Line 111: Line 122:
 
== External Links ==
 
== External Links ==
  
* [[wikipedia:Description Logic]]
+
* [[wikipedia: Description Logic]]
 +
* [[wikipedia: Abox]]
 
* Back to the Future with Description Logics: http://www.mkbergman.com/?p=470
 
* Back to the Future with Description Logics: http://www.mkbergman.com/?p=470
 
* Thinking ‘Inside the Box’ with Description Logics: http://www.mkbergman.com/?p=466
 
* Thinking ‘Inside the Box’ with Description Logics: http://www.mkbergman.com/?p=466

Latest revision as of 05:14, 24 March 2019

Description Logic (commonly abbreviated DL) is a set of mathematical rules and expressions for describing an action or set of outcomes, based on a particular set of inputs, as defined by principles of mathematical.


Specifications


EXAMPLE

FACTS - Simpson Family tree[2]

lastname('simpson').
lastname('bouvier').
man('homer').
woman('marge').
dog('santas little helper').
kitty('snowball II').
hasFather('homer','abe').
hasMother('homer','mona').
hasFather('marge','clancy').
hasMother('marge','jacqueline').
hasBrother('homer','herb').
hasSister('marge','patty').
hasSister('marge','selma').
hasSon('homer','bart').
hasSon('marge','bart').
hasAdoptedDaughter('selma','ling').
hasDaughter('homer','lisa').
hasDaughter('marge','lisa').
hasDaughter('homer','maggie').
hasDaughter('marge','maggie').
hasMaidenName('marge','bouvier').
hasPet('simpson','santas little helper').
hasPet('simpson','snowball II').
areMarried('homer','marge').
isUncle(?y,?z) :- hasBrother(?x,?y), hasSon(?x,?z).
isAunt(?y,?z) :- hasSister(?x,?y), hasDaughter(?x,?z).
isGrandfather(?y,?z) :- hasFather(?x,?y), hasSon(?x,?z).
isGrandmother(?y,?z) :- hasMother(?x,?y), hasDaughter(?x,?z).
isMale(?x) :- man(?x).
isFemale(?x) :- woman(?x).
isMale(?x) :- dog(?x).
isFemale(?x) :- bitch(?x).
isMale(?x) :- cat(?x).
isFemale(?x) :- kitty(?x).
isMale(?y) :- hasSon(?x,?y).
isFemale(?y) :- hasDaughter(?x,?y).
isMale(?y) :- hasAdoptedSon(?x,?y).
isFemale(?y) :- hasAdoptedDaughter(?x,?y).
isMale(?y) :- hasBrother(?x,?y).
isFemale(?y) :- hasSister(?x,?y).
isMale(?y) :- hasFather(?x,?y).
isFemale(?y) :- hasMother(?x,?y).
isFamily(?x) :- areMarried(?x,?y).
isFamily(?y) :- areMarried(?x,?y).
isFamily(?y) :- hasSon(?x,?y).
isFamily(?y) :- hasDaughter(?x,?y).
isExtendedFamily(?y) :- isFamily(?x,?y).
isExtendedFamily(?y) :- hasAdoptedSon(?x,?y).
isExtendedFamily(?y) :- hasAdoptedDaughter(?x,?y).
isExtendedFamily(?x) :- isGrandfather(?x,?y).
isExtendedFamily(?x) :- isGrandmother(?x,?y).
isExtendedFamily(?x) :- isAunt(?x,?y).
isExtendedFamily(?x) :- isUncle(?x,?y).

EXAMPLE QUERY #1 - Which Simpsons are male? (infers that Bart, Homer, Abe, Herb, Santa's Little Helper are male from "son", ,"uncle", "grandfather" relationships, as well as "man" and "dog" fact)

?-isMale(?x).


EXAMPLE QUERY #2 - Who has a son? (Explicitly stated)

?-hasSon(?x).


EXAMPLE QUERY #3 - Who are in the Simpson family? (infered from son/daughter/marriage reciprocal relationships)

?-isFamily(?x).


EXAMPLE QUERY #4 - Who are the Simpson's pets? (Explicity stated)

?-isPet('simpson').


EXAMPLE QUERY #5 - Who are in the Simpson's "extended" family? (infered from family relationship and Pets, Grandparents, etc)

?-isExtendedFamily(?x).



Tools

Resources


Tutorials


External Links

References

  1. wikipedia: Prolog syntax and semantics
  2. The Simpson's Family tree: http://en.wikipedia.org/wiki/Simpson_family
  3. http://iris-reasoner.org/demo

See Also

Rule Engine | Semantic Web | AI | Machine Learning