A Graph-Based Knowledge Representation pgp and

GBKR
A Graph‐Based
p
Knowledge
g Representation
p
and Reasoning Model
M. Chein ICEIS 2010
1
Agenda
• Knowledge
K
l d Representation
R
t ti and Reasoning
dR
i
• GBKR model
• Relationships
p with Logics
g
and other computational models
M. Chein ICEIS 2010
2
Knowledge Representation & Reasoning (1)
• Knowledge‐based Systems – Knowledge Base (Ontology, facts, …)
Base (Ontology facts )
– Reasoning mechanism
• Requirements
q
for a KR&R Formalism
– Formal semantics (esp. Logical)
– Structured representation of knowledge
of knowledge
– Good computational properties
M. Chein ICEIS 2010
3
Knowledge Representation & Reasoning (2)
f(e)
f(K)
e
K
Inference
mechanism
e’’
Logical
prover
p
sound
f(e’)
complete
M. Chein ICEIS 2010
4
Knowledge Representation & Reasoning (3)
Structured representation of knowledge
• Semantically related pieces of knowledge should be
ggathered together
g
• Distinction between ontological knowledge and factual
knowledge
g
• Rules (e.g. for expressing implicit knowledge)
• Constraints
M. Chein ICEIS 2010
5
Knowledge Representation & Reasoning (4)
Good computational properties
• Efficient algorithms
• Human computer interface
M. Chein ICEIS 2010
6
GBKR Sketchy Genealogy
Peirce Logics
Databases
Artificial Intelligence
g
Sowa 76 and 84
Graphical
Interface to Logics
Diagrammatic
Logics
Graph‐Based
Knowledge
Representation
GBKR Basic graph 1
GBKR
2
Boy: Paul
sisterOf
1
Child
1
1
playWith
playWith
2
2
Firetruck
1
1
on
attr
2
2
Color: red
Mat
M. Chein ICEIS 2010
8
GBKR Basic graph 2 GBKR
Boy: Paul
Boy: Paul
2
sisterOf
sisterOf
1
Child
Child
sisterOf
Boy: Paul
Child
M. Chein ICEIS 2010
9
GBKR n‐ary relation
GBKR
FirstName
Identifier
1
Salary
8
3
empl_Record
7
6
Depart
FamName
2
4
Address
5
Function
M. Chein ICEIS 2010
Age
10
GBKR binary role relations
GBKR
FirstName
Identifier
FamName
firstName
id
familyName
salary
Salary
Employee_record
Address
add
depart
p
function
Depart
age
Age
Function
M. Chein ICEIS 2010
11
GBKR vocabulary 1
GBKR
Top
Object
Toy
Train
RacingCar
Person
Car
Woman
Action
Man
Attribute
Color
Firetruck
Individuals : Paul is a Boy, Doudou is a Cuddly_Toy, Garfield is a Cat …
M. Chein ICEIS 2010
12
GBKR vocabulary 2
GBKR
Link2
act
wash
relativeOf
playWith childOf
Link3
between
hold
possess
parentOf
Linkn
act3
give
Signature
g
motherof : Woman, Person
,
M. Chein ICEIS 2010
13
GBKR vocabulary 3
Vocabulary: a light‐weight ontology
•
•
•
•
•
hierachies of concept types (classes) and relations
hierarchical orders: any
orders: any partial order
partial order
« a kind of » is distinct form « is instance of »
n‐ary relations, n ≥
relations n ≥ 1
signature of relations (e.g. domain and range for binary)
M. Chein ICEIS 2010
14
GBKR qquery/answer
y/
1 playTogether
Boy: Paul
Person
motherOf
Person
act
Child: Paul
Person
wash
GBKR query/answer
GBKR /
2
Child
act
Color: red
attr
Toy
on
Car
Mat
on
Color: red
attr
Boy: Paul
playWith
Firetruck
on
sisterOf
Mat
playWith
Child
M. Chein ICEIS 2010
GBKR graph homomorphism 1
GBKR
H
G
x
f
f(x)
f(y)
y
xy arc in G ⇒ f(x)f(y) arc in H
M. Chein ICEIS 2010
17
GBKR graph homomorphism 2
GBKR
c
f(c)
k
k
r
f(r)
()
label(c)≥ label(f(c)) (e.g. Person ≥ (Boy, Paul))
label(r)≥
( ) label(f(r)) (e.g. act
( ( )) ( g
≥p
playWith)
y
)
M. Chein ICEIS 2010
18
GBKR graph homomorphism 3
GBKR
Subsumption relation between graphs
G subsumes H if there is a hom
G subsumes H if there
a hom from G to H
G to H
Fundamental for structuring
for structuring a set of graphs
a set of graphs
Preorder
Minimal (irredundant) graph
Minimal (irredundant) graph
Basis for other operations
Basis for other
M. Chein ICEIS 2010
19
GBKR graph homomorphism 4
GBKR
Is there an homomorphism
Is there
an homomorphism from G to H?
G to H?
NP‐complete
NP
l
‐ Efficient backtrack algorithms
‐ Polynomial cases: G is
P l
i l
G i a tree, tree‐width
t
t
idth bounded
b
d d
Polynomial in data complexity
P
l
i li d t
l it
‐ Size of G not considered
M. Chein ICEIS 2010
20
GBKR rules 1
GBKR
• Fundamental component in knowledge‐based systems
• If hypothesis H then
H then conclusion C
conclusion C
• If a piece of knowledge H is present
then the piece
the piece of knowledge
of knowledge C can
C can be added
• Represent general implicit knowledge
• Forward chaining
• Backward chaining
M. Chein ICEIS 2010
21
GBKR rules 2
IF
Person
hasParent
Person
THEN
hasUncle
Person
Person
hasBrother
Person
GBKR rules 3
Person
hasParent
Person
hasUncle
hasBrother
Person
GBKR rules 4
IF
Person
hasUncle
Person
THEN
hasParent
Person
hasBrother
Person
Person
GBKR rules 4
Person
hasUncle
hasParent
Person
hasBrother
Person
GBKR rules 5
G
Person
hasParent
Person
hasParent
Person
hasParent
Person
hasParent
Person
GBKR rules 7
G
Person
hasParent
hasBrother
hasBrother
hasUncle
Girl: Mary
Person
Man: Peter
hasUncle
hasParent
hasBrother
Person
hasBrother
Person
Person
Person
hasBrother
GBKR rules 6
G
• Equivalent to TGDs
Equivalent to TGDs in relational
in relational databases
• New results obtained with graph viewpoint
• Backward chaining
• Computability/Complexity
GBKR constraints
GBKR
worksWith
Head
HeadOfGroup
Head
Secretary
in
Head
Office
in
near
Person
Head
Person
Head
in
in
Head
Office
Office
Head
M. Chein ICEIS 2010
29
GBKR other constructs
GBKR
Conjunctive types
Equality
N
Nested
d graphs
h
Atomic negation
g
Type definitions
O
Operations: joins, …
ti
j i
M. Chein ICEIS 2010
30
GBKR hierarchy of models
GBKR
F an initial world , V a vocabulary, C a set of constraints, R a set of inference rules, E a set of evolution rules (to make
evolve a consistent world into a new consistent one)
FF is
is Q deducible
Q deducible from (F,V)?
FC does F satisfies C and is Q deducible from
(F,V)?
FR is Q deducible from (Fk ,V)? where Fk is a R‐
derivation of F
FCR d
FCR does
(F R) ti fi C and is
(F,R) satisfies
C d i Q deducible
Q d d ibl from
f
(F,R)?
FCE does (F,E) satisfies
FCE does
(F,E) satisfies C and is
C and is Q deducible
Q deducible from
(F,E)?
FRCE deduction pb asks wether F can evolve into a consistent world satisfying the goal Q.
M. Chein ICEIS 2010
31
Pause!
M. Chein ICEIS 2010
32
GBKR FOL semantics 1 GBKR
sisterOf(x,Paul)
Boy(Paul)
Paul
2
Boy: Paul
1
sisterOf
Child(x)
1
playWith(Paul,z)
l With(P l )
1
playWith
()
Firetruck(z)
2
playWith
z
1
attr
tt ( d)
attr(z,red)
playWith(x,z)
2
Firetruck
1
on
2
red
x
Child
on(z,y)
( )
2
Mat
Color: red
y
Mat(y)
Color(red)
Φ(G)=∃x∃y∃zChild(x)∧Mat(y)∧Firetruck(z)∧Boy(Paul)∧Color(red)∧
sisterOf(x, Paul)∧playWith(Paul, z)∧playWith(x, z)∧attr(z, red)∧on(z,y)
M. Chein ICEIS 2010
33
GBKR FOL semantics 2 Person
act
Person
playTogether
Boy: Paul
Boy: Paul
Person
motherOf
(∀xBoy(x)→Person(x)) ∧(∀x∀yplayTogether(x,y)→act(x,y)) ∧
∃x (Boy(Paul)∧Person(x)∧playTogether(Paul,x)∧motherOf(x,Paul) ) →
∃x ∃yPerson(x)∧Person(y) ∧ act(x,y) GBKR FOL semantics 3 Person
hasUncle
hasParent
Person
hasBrother
Person
(
∀ ∀ (Person(x) ∧Person(y) ∧hasUncle(x,y))→
∀x∀y
(P
( ) P
( ) h U l ( ))
)
∃zPerson(z) ∧ hasParent(x,z)∧hasBrother(z,y)
GBKR FOL semantics 4 hasUncle
Girl: Mary
Girl: Mary
Man: Peter
Man: Peter
hasParent
hasBrother
Person
Person
hasUncle
hasParent
Person
hasBrother
Person
∀x(Girl(x)→Person(x))∧ ∀x(Man(x)→Person(x)) ∧
∀x∀y(Person(x)∧Person(y)∧hasUncle(x,y) →∃zPerson(z)∧hasParent(x,z)∧hasBrother(z,y))∧
Girl(Mary) ∧Man(Peter) ∧hasUncle(Mary,Peter)
→
∃zPerson(z)∧hasParent(Mary,z)∧hasBrother(z,Peter)
GBKR Soundness and completeness
GBKR
Φ(e)
( )
Φ(K)
e
K
Homomorphism-based
reasoning mechanism
Logical
prover
sound
e’’
Φ(e’)
complete
p
M. Chein ICEIS 2010
37
GBKR equivalent formalisms 2
GBKR
Large variety of graphs
Directed ggraphs, undirected
p ,
ggraphs, p ,
multigraphs, labeled graphs, hypergraphs
Transformations of one kind to another
Polynomial reductions for homomorphism problems
P i
Parsimonious
i
equivalence
i l
b t
between
some of them
f th
especially:
i ll
Homomorphism for GBKR graphs and Homomorphism for simple unlabeled
for simple unlabeled (directed or undirected) graphs
or undirected) graphs
M. Chein ICEIS 2010
38
GBKR equivalent formalisms 3
GBKR
Relational structures and relational
structures and relational databases
Q y evaluation p
Query
problem
Instance: a database instance D and a conjunctive query q
Question: Does D contain an answer to q?
Query containment problem
Instance: two queries q and q
Instance: two
q and q’??
Question: for any D does q(D) contain q’(D)?
These pbs are polynomially equivalent to GBKR graph hom
M. Chein ICEIS 2010
39
GBKR equivalent formalisms 4
GBKR
Constraint satisfaction problem
Variables
x1, …, xxn
Domains
D1, …, Dn
Constraints C1,, …, C
, k
Solution: an assigment of the variables satisfying the constraints
Parsimonious reduction between CSP and BH‐homomorphism
M. Chein ICEIS 2010
40
Graph(ical) Models
Graph(ical) Models
•
•
•
•
SSemantic
i Networks
N
k
Entity Relationship Model
Entity‐Relationship Model
KL One
KL‐One
UML
M. Chein ICEIS 2010
41
Topic Maps
M. Chein ICEIS 2010
42
Cognitive Maps
Cognitive Maps
M. Chein ICEIS 2010
43
Concept Maps
Concept Maps
M. Chein ICEIS 2010
44
RDF/S
M. Chein ICEIS 2010
45
Strengths •
•
•
•
•
•
•
Formal semantics (FOL or model theory)
Structured representation of knowledge
Good computational properties
Good computational
Numerous algos
Diagrammatic/Linear
Vi l
Visual aspects GUI easily
t GUI
il interpreted
i t
t d
Support for intuition
pp
M. Chein ICEIS 2010
46
Weaknesses
• Diagrammatic/Linear
– Ambiguity in interpretation, a formal (linear !) semantics is needed
• Visual aspects
– difficulty large or automatically built graphs
• Support for intuition
pp
– imprecision (modality)
Difficultyy to build a relevant ontology
gy
M. Chein ICEIS 2010
47
COGUI
http://www lirmm fr/cogui/
http://www.lirmm.fr/cogui/
GUI, developed in Java, for building GBKR knowledge bases g
COGXML format, COGITANT compatible
There is a translator from and to RDF(S)
COGITANT
http://cogitant.sourceforge.net/
Library of C++ classes build applications based on the GBKR model. Classes for each object of the model (vocabulary graph rule
Classes for each object of the model (vocabulary, graph, rule, constraint...)
p
(
p
,
and for the main operations of the model (homomorphism, application of rules...).
M. Chein ICEIS 2010
48
Thank yyou for your
y
attention!
M. Chein ICEIS 2010
49
GBKR equivalent formalisms 1
GBKR
Parsimonious reduction
A polynomial reduction from P1 to P2 is parsimonious if
the number of solutions of any YES instance of P1 is equal to
the number of solutions of its corresponding YES instance of P2
Parsimonious equivalence
Two problems P1 and P2 are parsimoniously
P1 and P2 are parsimoniously equivalent if if
each of them is parsimoniously reducible to the other
M. Chein ICEIS 2010
50
Description Logics
Description Logics
• Rooted in frames and semantic networks
q
ancestors
• Remedyy critiques on their
‐ distinction between ontology and facts
‐ provided with FOL semantics
FOL semantics
• Small intersection
‐ rooted
t d trees
t
with
ith binary
bi
relations l ti
‐ DL tailored for the comparison ELIRO1
M. Chein ICEIS 2010
51
Difficulty to build
to build a knowledge
a knowledge base
manually and a fortiori automatically
M. Chein ICEIS 2010
52
GBKR hierarchy of models
GBKR
F
FC
FR
F?
is Q deducible from (F,V)?
F
F
describes an initial world and V a vocabulary
does F satisfies C and is Q deducible from (F,V)?
C
constraints define the consistency of a world
is Q deducible from (Fk ,V) where Fk is a R-derivation of R inference rules complete the description of any world
FCR does (F,R) satisfies C and is Q deducible from (F,R)?
FCE does (F,E) satisfies C and is Q deducible from (F,E)?
E evolution rules try to make evolve a consistent
world into a new consistent one
FRCE
Th d d ti pb
The deduction
b asks
k wether
th F can evolve
l into
i t a consistent world satisfying
the goal Q.
M. Chein ICEIS 2010
53