Professional Documents
Culture Documents
Lecture 3.3 Graphical Representations of Knowledge
Lecture 3.3 Graphical Representations of Knowledge
Lecture 3.3 Graphical Representations of Knowledge
CATEGORY:DOG-TYPES
broader
CATEGORY:WORKING-DOGS
subject MAMMAL
type
CATEGORY:MUNICIPALITIES_IN-THE-US
broader
CATEGORY:MUNICIPALITIES_IN-NEW-YORK
broader
CATEGORY:CITIES-IN-NEW-YORK LAKE_ONTARIO
wikipagewikilink CITY
wikipagewikilink
hypernym
ROCHESTER,_NEW_YORK
Here’s a concrete object - but what is it?
WordNet could be expressed as a knowledge graph
from Navigli, R. (2016). Chapter 20. ontologies. Mitkov, R. (Ed.), The Oxford handbook of computational linguistics. Oxford
University Press.
Formalizing Knowledge Graphs
❖ Knowledge graphs are a propositional logic, with
constants and binary predicates
CATEGORY: CITIES-IN-NEW-YORK
subject
located-in located-in
JOE-BEAN-COFFEE ROCHESTER NEW-YORK
serves
COFFEE
❖ is the knowledge base
{LOCATED-IN(JOE-BEAN-COFFEE, ROCHESTER) &
SERVES(JOE-BEAN-COFFEE, COFFEE) &
LOCATED-IN(ROCHESTER, NEW-YORK),
SUBJECT(ROCHESTER, CAT:CITIES-IN-NEW-YORK)}
Formalizing Knowledge Graphs
CATEGORY: CITIES-IN-NEW-YORK
subject
located-in located-in
JOE-BEAN-COFFEE ROCHESTER NEW-YORK
serves
COFFEE
{LOCATED-IN(JOE-BEAN-COFFEE, ROCHESTER) &
SERVES(JOE-BEAN-COFFEE, COFFEE) &
LOCATED-IN(ROCHESTER, NEW-YORK),
SUBJECT(ROCHESTER, CAT:CITIES-IN-NEW-YORK)}
❖ Could define inference rules
LOCATED-IN(?x, ?y) & LOCATED-IN(?y. ?z) =>
LOCATED-IN(?x, ?z)
It’s Hard to capture much knowledge with
triples between constants
❖ We need to start writing sentence fragments as relation
names
❖ John is sitting under the couch
sitting-under
JOHN1 COUCH
LOST ANY COMMONALITY
BETWEEN THE
❖ John is sitting beside the couch PREDICATES
sitting-beside
JOHN1 COUCH
❖ Or indefinite statements
saw
❖ John saw a dog JOHN1 ????
❖ Or quantified statements
saw
❖ John saw many dogs JOHN1 ????
❖ Or commonsense knowledge
???
❖ Dogs bark DOG ????
We’ll address these issues today
Towards a More Adequate Representation:
Semantic Nets
❖ Two types of nodes, representing
❖ predicate/sets (TYPE nodes)
ANIMAL
giving a semantics by mapping to logic
subtype
SUBTYPE(HUMAN, ANIMAL) means
HUMAN
subtype subtype ∀ x HUMAN(x) ⊃ ANIMAL(x)
instance-of instance-of
FEMALE-HUMAN(MARY1)
MARY3 JOHN1
Relations in Semantic Nets
❖ We could follow the strategy in Knowledge Graphs, i.e., introduce
new arc labels
ANIMAL
subtype Problems
HUMAN ❖ likes isn’t representable in the
subtype subtype ontology (e.g., we can’t say likes
FEMALE-HUMAN MALE-HUMAN is an event_of-experience)
❖ can’t attach additional
instance-of instance-of
information, e.g., Mary liked John
MARY3 likes JOHN1 in 2012
❖ can’t represent predicates with
arity greater than 2, e.g., He put
the cat in the house.
Technical Problems and Philosophy
It turns out the solution to this problem lies in the writings of Donald Davidson in
the 1960’s
How many arguments does a predicate LIKE have?
❖ Maybe 2? Mary likes John
❖ Likes(Mary1, John1)
BREAK(B1) & AFFECTED(B1, W1) & WINDOW(W1) & AGENT(B1,M1) & SPEAKER(M1)
& INSTRUMENT(B1, H1) & HAMMER (H1)
… or a slightly more expressive formulation
encode the type in the token node label
B1:BREAK
agent
instrument
affected
M1:SPEAKER
H1:HAMMER
W1:WINDOW
BREAK(B1) & AFFECTED(B1, W1) & WINDOW(W1) & AGENT(B1,M1) & SPEAKER(M1)
& INSTRUMENT(B1, H1) & HAMMER (H1)
Typed Logics
❖ A typed logic allows quantified variables to be type
restricted
❖ e.g., all dogs like a bone
∀ d : DOG
∃ b : BONE
∃ e : LIKE-EVENT Liker(e, d) & Likee(e, b)
❖ logically equivalent to
Universal quantifiers use
∀ d . [ DOG(d) ⊃ implication and existential use
∃ b [BONE (b) & conjunction
∃ e [LIKE-EVENT(e) & Liker(e, d) & Likee(e, b)]]]
Quantification our Semantic Network
“all dogs bark” ∀ d : DOG ∃ e :BARK-EVENT . Barker(e, d)
Note it couldn’t be all dogs & all bark events as not all dogs
are barkers in all backing events
??????:BARK-EVENT
barker
?X:DOG
Dog(Sk137)
What do we know about D137?
We know Dog(Sk137) and Barks(Sk137). We don’t know whether Happy(Sk137)
Skolem to the rescue!
❖ Skolem proved the transformed set of facts is inferentially
equivalent to the original with the quantifier
❖ Important qualifications
SK11(?X):BARK-EVENT
barker
?X:DOG
What can be represented?
SK2(?X, ?Y):LIKES
arg0 arg1
?X:DOG ?Y:BONE
A A
r2
r1 r2
C
B C Entails
r4
r3 r4
E
D E
Graph Matching as Inference
Variables: A graph X is entailed by a another graph Y if
there is a substitution that satisfies the type restriction
that makes X a subset of Y
TYPE1
subtype ? A
T1 A
r2
subtype r2
T11 Entails C
?x:T1
{?x/C} r4
instance-of r3 r4
E
C D E
we can substitute C for
?x:T1 because C is a member of T11 which is
a subset of T1 (thus C satisfies the type restriction)
Querying Graphs
We can query a semantic net with a pattern A by
finding a subgraph that instantiates A
NB: variables are interpreted existentially in queries
A
r2
A
?x:T1
r1 r2
r4
B C:T1 Query/Pattern E
agent
Not expressible in our formalism!
SK1(?E):ANIMAL
∀ e: EAT
∃ x : ANIMAL AGENT(e, x)
Selectional Restrictions: Which is better?
OPTION A OPTION B
?X:BARK ?X:!BARK
agent agent
FIDO:DOG FIDO:DOG
YES! NO! DON’T KNOW!
Inheritance in Semantic Nets
❖ To make examples clearer, we’ll use a simple abbreviation
INSTEAD OF WE WRITE
Sk(?x):CANFLY CANFLY
BIRD
arg0
?x:BIRD
CANFLY
BIRD
subtype
CANARY
instance-of ENTAILS TWEETY FLIES
TWEETY
Inheritance (2)
❖ some inheritance can be viewed as a form of logical
deduction, but consider we probably all agree that
❖ Birds fly
❖ Penguins are birds
BUT, PENGUINS DON’T FLY!!!!!!!!
PENNY
Reminder:
Single Inheritance vs Multiple Inheritance
LIVING-ENTITY
ANIMAL GENDERED-BEING
subtype subtype
HUMAN subtype
FEMALE-BEING
subtype
subtype
subtype MALE-BEING
subtype
FEMALE-HUMAN MALE-HUMAN
instance-of instance-of
MARY JOHN1
Multiple Inheritance
FLY ¬FLY
WINGED-CREATURES LAND-CREATURES
subtype
subtype
PENGUIN
instance-of
Owns(?Seller, Car1)
Owns(Ag1, ?Money) ACTION LIBRARY
INITIAL STATE Value(Car1, ?Money)