+

RDFS Semantics,
Inference techniques and
Sesame
Mariano Rodriguez-Muro,
Free University of Bozen-Bolzano
+

Disclaimer


License


This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 License
(http://cre...
+

Reading material


Foundations of Semantic Web Chapter 3.



Semantic Web for the Working Ontologist. Chapter 8
http:...
+

Core concepts


Systems that perform inference are often called reasoning
engines or reasoners.



Reasoner engine
a ...
+

Giving semantics to RDFS



Implementing semantics for RDFS



Overview



Using RDFS inference with Sesame
+
RDFS rule-based semantics
+

RDFS rule-based semantics


Example: Type propagation through rdfs:subClassOf described
as a rule
[IF]
?class1 rfds:su...
+

RDFS rule-based semantics


The RDFS specification defines RDFS semantics in terms of 26
rules grouped as follows:


...
RDFS Entailment Rules
+
Name

Condition

Conclusion

rdfs1

uuu aaa lll.

_:nnn rdf:type rdfs:Literal .

where lll is a pl...
RDFS Entailment Rules (cont.)
+
Name

Condition

Conclusion

rdfs8

uuu rdf:type rdfs:Class .

uuu rdfs:subClassOf rdfs:Re...
RDFS extensional entailment rules
+
Name

Condition

Conclusion

ext1

uuu rdfs:domain vvv .
vvv rdfs:subClassOf zzz

uuu ...
+

Datatype entailment rules

Name

Condition

Conclusion

rdfsD1

ddd rdf:type rdfs:Datatype .
uuu aaa "sss"^^ddd .

_:nn...
+

Other semantics for RDFS


RDFS rule-based semantics are SYNTACTIC, easy to
understand, implemented everywhere



Syn...
+

Rule-based inference


Basic idea, describe all mandatory inferences as rules.



A rule describes how new informatio...
+

Implementing RDFS
semantics
+

Implementing RDFS semantics


Most (really, almost all) reasoners that implement RDFS
semantics use one (or both) of t...
+

Forward chaining


Objective: Is fact X implied by the data?



How: Pre-compute all implied facts, then just check i...
+

Forward chaining


How it works


Works at “load” time



Infers new facts based on the existing ones



Continues ...
+

Forward chaining, cons and pros


Pros



Rules are already given by the RDFS rule-based semantics





Easy to im...
+

Forward chaining (cont.)
+

Forward chaining, cons and pros


Pros






Cons







Easy to implement
Rules are already given by the RDF...
+

Backward chaining


Objective: is fact X implied by the data?



How: Compute the facts that would be necessary for f...
+

Forward chaining, cons and pros


Pros



No data is generated, no extra loading time





Easy to implement
Simpl...
+

Forward or Backward



Key aspects in deciding for forward
or backward chaining:


Loading time



Query time



Sp...
+

Any other ways to implement with
RDFS semantics


There are other, more efficient methods



Not implemented in commo...
+
RDFS reasoning in Sesame
Easy
+

Sesame RDFS Sail


RDFS entailments are implemented using a SAIL



The sail is a ForwardChainingRDFSInferencer


On...
+

Sesame RDFS Sail


RDFS entailments are implemented using a SAIL



The sail is a ForwardChainingRDFSInferencer


On...
+

Setting it up


Create the repository of your choice and attach the sail

Repository myRepository = new SailRepository...
+

Sesame RDFS in the console


In the console, simply create the pre-configured repos:


in-memory-rdfs



native-rdfs...
+

Sesame and reasoning


Sesame’s native support for inferences is poor, only RDFS



Performance is not great



Opti...
Upcoming SlideShare
Loading in …5
×

SWT Lecture Session 6 - RDFS semantics, inference techniques, sesame rdfs

1,093 views

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,093
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
23
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termintion
  • soundness, completeness, termination
  • soundness, completeness, termintion
  • SWT Lecture Session 6 - RDFS semantics, inference techniques, sesame rdfs

    1. 1. + RDFS Semantics, Inference techniques and Sesame Mariano Rodriguez-Muro, Free University of Bozen-Bolzano
    2. 2. + Disclaimer  License  This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License (http://creativecommons.org/licenses/by-sa/3.0/)
    3. 3. + Reading material  Foundations of Semantic Web Chapter 3.  Semantic Web for the Working Ontologist. Chapter 8 http://proquest.safaribooksonline.com/book/-/9780123859655
    4. 4. + Core concepts  Systems that perform inference are often called reasoning engines or reasoners.  Reasoner engine a system that infers new information based on the contents of a knowledgebase. This can be accomplished using rules and a rule engine, triggers on a database or RDF store, decision trees, tableau algorithms, or even programmatically using hard-coded business logic  A reasoner must be compliant to the semantics of the ontology language it supports  Hence, an ontology language must state it’s semantics in a formal way
    5. 5. + Giving semantics to RDFS  Implementing semantics for RDFS  Overview  Using RDFS inference with Sesame
    6. 6. + RDFS rule-based semantics
    7. 7. + RDFS rule-based semantics  Example: Type propagation through rdfs:subClassOf described as a rule [IF] ?class1 rfds:subClassOf ?class2 AND ?instance rdf:type ?class1 [THEN] ?instance rdf:type ?class2  Subclass transitivity as a rule [IF] ?class1 rfds:subClassOf ?class2 AND ?class2 rfds:subClassOf ?class3 [THEN] ?class1 rdf:type ?class3
    8. 8. + RDFS rule-based semantics  The RDFS specification defines RDFS semantics in terms of 26 rules grouped as follows:  RDFS entailment rules core rules, simple “reasonable” entailments (incomplete w.r.t. domain/range/subPropertyOf and subClassOf)  RDFS rdfsensional rules complete the rule set w.r.t. to domain/range/subPropertyOf and subClassOf  Datatype entailment rules covers inference related to datatype’s lexical forms  See http://www.w3.org/TR/rdf-mt/#rules  See Section 3.3 of Foundations of Semantic Web
    9. 9. RDFS Entailment Rules + Name Condition Conclusion rdfs1 uuu aaa lll. _:nnn rdf:type rdfs:Literal . where lll is a plain literal (with or without a language tag). where _:nnn identifies a blank node allocated to lll by rule rule lg. rdfs2 aaa rdfs:domain xxx . uuu aaa yyy . uuu rdf:type xxx . rdfs3 aaa rdfs:range xxx . uuu aaa vvv . vvv rdf:type xxx . rdfs4a uuu aaa xxx . uuu rdf:type rdfs:Resource . rdfs4b uuu aaa vvv. vvv rdf:type rdfs:Resource . rdfs5 uuu rdfs:subPropertyOf vvv . vvv rdfs:subPropertyOf xxx . uuu rdfs:subPropertyOf xxx . rdfs6 uuu rdf:type rdf:Property . uuu rdfs:subPropertyOf uuu . rdfs7 aaa rdfs:subPropertyOf bbb . uuu aaa yyy . uuu bbb yyy .
    10. 10. RDFS Entailment Rules (cont.) + Name Condition Conclusion rdfs8 uuu rdf:type rdfs:Class . uuu rdfs:subClassOf rdfs:Resource . rdfs9 uuu rdfs:subClassOf xxx . vvv rdf:type uuu . uuu rdf:type xxx . rdfs10 uuu rdf:type rdfs:Class . uuu rdfs:subClassOf uuu . rdfs11 uuu rdfs:subClassOf vvv . vvv rdfs:subClassOf xxx . uuu rdfs:subClassOf xxx . rdfs12 uuu rdf:type rdfs:ContainerMembershipProperty . uuu rdfs:subPropertyOf rdfs:member . rdfs13 uuu rdf:type rdfs:Datatype . uuu rdfs:subClassOf rdfs:Literal .
    11. 11. RDFS extensional entailment rules + Name Condition Conclusion ext1 uuu rdfs:domain vvv . vvv rdfs:subClassOf zzz uuu rdfs:domain zzz . ext2 uuu rdfs:range vvv . vvv rdfs:subClassOf zzz . uuu rdfs:range zzz . ext3 uuu rdfs:domain vvv . www rdfs:subPropertyOf uuu . www rdfs:domain vvv . ext4 uuu rdfs:range vvv . www rdfs:subPropertyOf uuu . www rdfs:range vvv . ext5 rdf:type rdfs:subPropertyOf www . www rdfs:domain vvv . rdfs:Resource rdfs:subClassOf vvv . ext6 rdfs:subClassOf rdfs:subPropertyOf www . www rdfs:domain vvv . rdfs:Class rdfs:subClassOf vvv . ext7 rdfs:subPropertyOf rdfs:subPropertyOf www . www rdfs:domain vvv . rdf:Property rdfs:subClassOf vvv . ext8 rdfs:subClassOf rdfs:subPropertyOf www . www rdfs:range vvv . rdfs:Class rdfs:subClassOf vvv . ext9 rdfs:subPropertyOf rdfs:subPropertyOf www . www rdfs:range vvv . rdf:Property rdfs:subClassOf vvv .
    12. 12. + Datatype entailment rules Name Condition Conclusion rdfsD1 ddd rdf:type rdfs:Datatype . uuu aaa "sss"^^ddd . _:nnn rdf:type ddd . where _:nnn identifies a blank node allocated to "sss"^^ddd by rule rule lg. rdfsD2 ddd rdf:type rdfs:Datatype . uuu aaa "sss"^^ddd . uuu aaa "ttt"^^ddd rdfsD3 ddd rdf:type rdfs:Datatype . eee rdf:type rdfs:Datatype . uuu aaa "sss"^^ddd . uuu aaa "ttt"^^eee .  Note, infinite number of rules!  Semantics by rules is easy to understand (most of them), but “hacky”
    13. 13. + Other semantics for RDFS  RDFS rule-based semantics are SYNTACTIC, easy to understand, implemented everywhere  Syntactic rules are prone to incompleteness (several passes were necessary to fix RDFS rule-based semantics)  Sometimes not-intuitive  RDFS also has model-theoretic semantics, clear semantics based on set theory  Won’t see them in this course, see Chapter 3 in Foundations of Semantic Web
    14. 14. + Rule-based inference  Basic idea, describe all mandatory inferences as rules.  A rule describes how new information based on the current state of the data/knowledge base. IF a holds in the data Then b holds in the data Pre-condition conclusion  Rule based inference cannot be used for ANY language., (key factors, non-determinism and termination)  They are enough to capture the semantics of RDFS
    15. 15. + Implementing RDFS semantics
    16. 16. + Implementing RDFS semantics  Most (really, almost all) reasoners that implement RDFS semantics use one (or both) of the following techniques  Forward chaining Deduction calculus for all the rules in the RDFS rules.  Backward chaining Looking for all possible facts from which we may derive the conclusion
    17. 17. + Forward chaining  Objective: Is fact X implied by the data?  How: Pre-compute all implied facts, then just check if fact X is there  How it works    Works at “load” time Infers new facts based on the existing ones Continues applying inferences until reaching a fix point (graphs are sets)  New facts are added “immediately” to the repository  Natural match to RDFS rule-based semantics
    18. 18. + Forward chaining  How it works  Works at “load” time  Infers new facts based on the existing ones  Continues applying inferences until reaching a fix point (graphs are sets)  New facts are added “immediately” to the repository  Natural match to RDFS rule-based semantics Complex interactions in forward chaining
    19. 19. + Forward chaining, cons and pros  Pros   Rules are already given by the RDFS rule-based semantics   Easy to implement Retrieval is FAST (also query answering) Cons  Adds a lot of new information (maybe not necessary)  Extra space  Extra time  Updates are VERY complicated (truth maintenance)
    20. 20. + Forward chaining (cont.)
    21. 21. + Forward chaining, cons and pros  Pros     Cons      Easy to implement Rules are already given by the RDFS rule-based semantics Retrieval is FAST (also query answering) Adds a lot of new information (maybe not necessary) Extra space Extra time Updates are VERY complicated (truth maintenance) Possible optimizations: application order, parallelism (often incomplete)
    22. 22. + Backward chaining  Objective: is fact X implied by the data?  How: Compute the facts that would be necessary for fact X to be implied, verify if any of those conditions is true.
    23. 23. + Forward chaining, cons and pros  Pros   No data is generated, no extra loading time   Easy to implement Simple update management or truth maintenance Cons    Retrieval is slower Fast query time may require complex optimization techniques Possible optimizations: caching, low level indexes
    24. 24. + Forward or Backward  Key aspects in deciding for forward or backward chaining:  Loading time  Query time  Space constraints  Updates
    25. 25. + Any other ways to implement with RDFS semantics  There are other, more efficient methods  Not implemented in common frameworks  More to come in this course
    26. 26. + RDFS reasoning in Sesame Easy
    27. 27. + Sesame RDFS Sail  RDFS entailments are implemented using a SAIL  The sail is a ForwardChainingRDFSInferencer  On load time it will perform forward chaining
    28. 28. + Sesame RDFS Sail  RDFS entailments are implemented using a SAIL  The sail is a ForwardChainingRDFSInferencer  On load time it will perform forward chaining
    29. 29. + Setting it up  Create the repository of your choice and attach the sail Repository myRepository = new SailRepository( new ForwardChainingRDFSInferencer( new MemoryStore())); myRepository.initialize();  As with any forward chaining inference engine, load time will be affected by the use of this sail
    30. 30. + Sesame RDFS in the console  In the console, simply create the pre-configured repos:  in-memory-rdfs  native-rdfs-types
    31. 31. + Sesame and reasoning  Sesame’s native support for inferences is poor, only RDFS  Performance is not great  Options on large scenarios: OWLIM

    ×