04c. RDF Logic
04c. RDF Logic
Resource Description
Framework and Logic
Plaban Kumar Bhowmick
Assistant Professor
Centre of Excellence in Artificial Intelligence
Indian Institute of Technology Kharagpur
Entailment in RDF(S)
Simple Entailment
RDF Entailment
RDFS-Entailment
Convention of Variable Names
Blank
Predicate Subject Object Literal
Node
𝑢𝑎 𝑥 . 2. If is already contained
𝑠𝑒 2 • Rule is applicable if has been
¿:𝑛𝑎 𝑥. introduced by weakening the same
URI, literal or blank node
Examples of Simple Entailment
Virat is the captain of Indian
Cricket Team
⊨ Indian
captain
Cricket Team has a
𝑒𝑥 :𝑚𝑒𝑛𝑡𝑜𝑟𝑠 𝑒𝑥 :𝑐𝑎𝑝𝑡𝑎𝑖𝑛 𝑂𝑓
𝑒𝑥 : 𝑟𝑎𝑣𝑖 ¿ :𝑖𝑑 1 𝑒𝑥 : 𝐼𝑛𝑑𝑖𝑎𝑛𝑇𝑒𝑎𝑚
Ravi mentors the captain of Indian
Team
Example of Simple
Entailment
𝑒𝑥 :𝑚𝑒𝑛𝑡𝑜𝑟𝑠 𝑒𝑥 :𝑐𝑎𝑝𝑡𝑎𝑖𝑛 𝑂𝑓
𝑒𝑥 : 𝑟𝑎𝑣𝑖 ¿ :𝑖𝑑 1 𝑒𝑥 : 𝐼𝑛𝑑𝑖𝑎𝑛𝑇𝑒𝑎𝑚
Ravi mentors the captain of Indian
Team
𝑒𝑥 :𝑐𝑎𝑝𝑡𝑎𝑖𝑛 𝑂𝑓
𝑒𝑥 :𝑚𝑜𝑟𝑔𝑎𝑛 𝑒𝑥 : 𝐸𝑛𝑔𝑙𝑎𝑛𝑑𝑇𝑒𝑎𝑚
𝑒𝑥 :𝑐𝑎𝑝𝑡𝑎𝑖𝑛 𝑂𝑓
¿ :𝑖𝑑 1 𝑒𝑥 : 𝐸𝑛𝑔𝑙𝑎𝑛𝑑𝑇𝑒𝑎𝑚
𝑒𝑥 :𝑚𝑒𝑛𝑡𝑜𝑟𝑠 𝑒𝑥 :𝑐𝑎𝑝𝑡𝑎𝑖𝑛 𝑂𝑓
𝑒𝑥 : 𝑟𝑎𝑣𝑖 ¿ :𝑖𝑑 1 𝑒𝑥 : 𝐼𝑛𝑑𝑖𝑎𝑛𝑇𝑒𝑎𝑚
𝑒𝑥 :𝑐𝑎𝑝𝑡𝑎𝑖𝑛 𝑂𝑓
𝑒𝑥 : 𝐸𝑛𝑔𝑙𝑎𝑛𝑑𝑇𝑒𝑎𝑚
Theorem: Simple Entailment
A graph simply entails a graph , if can be
extended to a graph by virtue of the rules and
such that is contained in
G1 ⊨ G2
𝒔𝒆 𝟏
𝒔𝒆 𝟐
⊆ ❑
𝐺 ={〈 𝑠 2 𝑖 , 𝑝2 𝑖 , 𝑜2 𝑖 〉 }
2
G’1
′
𝐺 ={〈 𝑠 1𝑖 ,𝑝 1 𝑖 , 𝑜1 𝑖 〉 }
1
Example: Simple Entailment
Theorem
Ronaldo is a Portuguese footballer who has played in Manchester
United having head coach as Alex Ferguson and won the Ballon
d’Or
wikidata:Q11571 wikidata_prop:P166
G1
wikidata:Q166177
wikidata:Q11571
wikidata_prop:P735
wikidata_prop:P1532
wikidata_prop:P735 wikip:P54 wiki:Q18656
wikip:P286
𝐺1 =¿ (wiki:ronaldo
“Portugal”)
(wiki:ronaldo
wikip:citizenship
wikip:occupation
wiki:football_player)
(wiki:ronaldo wikip:award wiki:Ballon
d’Or)
(wiki:ronaldo wikip:member
wiki:Manchester United)
(wiki:Manchester United wikip:head_coach wiki:Alex
Ferguson)
Example: Simple
Entailment
G2
wiki:football_player wikip:award
wiki:Ballon d'Or
wikip:occupation
wikip:head_coach
(_:id1 wikip:occupation
𝐺 2=¿ wiki:football_player)
(_:id1
(_:id1
wikip:award
wikip:member
wiki:Ballon d’Or)
_:id2)
(_:id2 wikip:head_coach wiki:Alex Ferguson)
Example: Simple Entailment
Theorem
𝑢𝑎 𝑥 𝑢𝑎 𝑥
𝑠𝑒 1
𝑠𝑒 2 𝑢 𝑎: 𝑛
¿:𝑛𝑎 𝑦
(wiki:ronaldo wikip:given_name
′
𝐺 =¿
1
“Ronaldo”)
(wiki:ronaldo
“Portugal”)
wikip:citizenship
(wiki:ronaldo wikip:occupation
wiki:football_player)
(wiki:ronaldo wikip:award
wiki:Ballon d’Or)
′
𝐺2⊆ 𝐺
(wiki:ronaldo wikip:member
wiki:Manchester United)
1 (wiki:Manchester United wikip:head_coach
wiki:Alex Ferguson)
(_:id1 wikip:occupation
wiki:football_player)
RDF Entailment
❑ 𝑟𝑑𝑓𝑎𝑥
𝑢𝑎 𝑥
RDF Entailment Rules
𝑢𝑎 𝑙.
Literal 𝑙𝑔
Generalization 𝑢 𝑎: 𝑛 .
𝑢𝑎 𝑦 .
Property Rule 𝑟𝑑𝑓 1
𝑎𝑟𝑑𝑓 : 𝑡𝑦𝑝𝑒 𝑟𝑑𝑓 : 𝑃𝑟𝑜𝑝𝑒𝑟𝑡𝑦 .
𝑢𝑎𝑙 .
Literal Rule 𝑟𝑑𝑓 2
¿ :𝑛𝑟𝑑𝑓 :𝑡𝑦𝑝𝑒 𝑟𝑑𝑓 : 𝑋𝑀𝐿𝐿𝑖𝑡𝑒𝑟𝑎𝑙 .
Theorem: RDF
Entailment
A graph RDF entails a graph , if can be
extended to a graph by virtue of the rules ,
and such that simply entails
𝒍𝒈
G1 ⊨ G2
𝒓𝒅𝒇𝒂𝒙
𝒓𝒅𝒇 𝟏 t ails
En
𝒓𝒅𝒇 𝟐
G’1 Si ⊨
m
pl
e
Rules for RDFS
Entailment
RDFS axiomatic triple
Entailment
rule
❑ 𝑟𝑑𝑓𝑠𝑎𝑥
𝑢𝑎 𝑥
Axiomatic RDFS Triples (1/3)
The following triples are always RDFS-entailed:
Property restriction
(domain restr)
(range restr)
Rules for RDFS
Entailment
Everything is a resource
Rules for RDFS
Entailment
Subproperty rule
Subproperty is transitive
Subproperty is reflexive
Subclass is reflexive
rdfs:subClassO
f
rdfs:ContainerMembershipProperty
rdf:type
pe
e
yp
ty
t
:
f:
rdf
rd
rdf:_1 rdf:type
rdf:_2 rdf:_n
rdfs:subPropertyOf
rdfs:member
Theorem: RDFS
Entailment
A graph RDFS entails a graph , if can be
extended to a graph by virtue of the rules , as
well as to and such that simply entails
𝒈𝒍
𝒍𝒈 G1 ⊨ G2
𝒓𝒅𝒇𝒂𝒙
𝒓𝒅𝒇 𝟏 t ails
En
𝒓𝒅𝒇 𝟐
𝒓𝒅𝒇 𝟏−𝟏𝟑 G’1 Si ⊨
m
pl
e
RDFS Deduction
Example
rdfs:ContainerMembershipProperty
rdf:type
rdfs:subPropertyOf
rdfs:domain rdfs:range
:SmartPhoneCompany :hasAllrounderMember
RDF
S
rdf:type RDF
:Sponsors :hasAllrounderMember
:Oppo :IndianCricketTeam :Hardik
Input Graph ()
:SmartPhoneCompany :AllRounder
rdf:type rdf:type
:Sponsors rdfs:member
12
RDFS Entailment
Deduction
𝑎 𝑟𝑑𝑓𝑠 : 𝑠𝑢𝑏𝑃𝑟𝑜𝑝𝑒𝑟𝑡𝑦𝑂𝑓 𝑏 . 𝑢 𝑎 𝑦 .
𝑟𝑑𝑓𝑠 7
𝑢𝑏 𝑦 .
RDFS Entailment Deduction
:SmartPhoneCompany
rdf:type
:Sponsors
_:n _:n1
RDFS Entailment
Deduction
:IndianCricketTeam :h𝑎𝑠𝐴𝑙𝑙𝑅𝑜𝑢𝑛𝑑𝑒𝑟𝑀𝑒𝑚𝑏𝑒𝑟 : 𝐻𝑎𝑟𝑑𝑖𝑘
_ :n 1 :h𝑎𝑠𝐴𝑙𝑙𝑅𝑜𝑢𝑛𝑑𝑒𝑟𝑀𝑒𝑚𝑏𝑒𝑟 : 𝐻𝑎𝑟𝑑𝑖𝑘 se2
:SmartPhoneCompany :AllRounder
rdf:type rdf:type
:Sponsors rdfs:member
:hasAllrounderMember
_:n _:n1 :Hardik
_:n2
RDFS Entailment
Deduction
:Oppo rdf:type :Company.
:Oppo :Sponsors :IndianCricketTeam.
:IndianCricketTeam :hasAllrounderMember :Hardik.
:hasAllrounderMember rdfs:subPropertyOf :hasTeamMember.
:hasAllrounderMember rdfs:domain :CricketTeam.
:hasAllrounderMember rdfs:range :AllRounder.
:hasTeamMember rdf:type rdfs:ContainerMembershipProperty.
_:n rdf:type :SmartPhoneCompany
_:n :sponsors :IndianCricketTeam
_:n :sponsors _:n1
_:n1 rdfs:member :Hardik
_:n1 :hasAllroundMember :Hardik
:Hardik rdf:type :Allrounder
_:n1 rdfs:member _:n2
_:n2 rdf:type :Allrounder ′
𝐺 1
RDFS Entailment
Deduction
_:n rdf:type :SmartPhoneCompany
_:n :sponsors _:n1
_:n1 rdfs:member _:n2 𝐺2
_:n2 rdf:type :Allrounder
′
𝐺2⊆ 𝐺 1
Coming Up Next…..
SPARQL
SPARQL Protocol and RDF Query
Language