SPARQL and OWL How to Answer Conjunctive Queries

  • Slides: 15
Download presentation
SPARQL and OWL: How to Answer Conjunctive Queries with an Expressive Ontology Language Birte

SPARQL and OWL: How to Answer Conjunctive Queries with an Expressive Ontology Language Birte Glimm

Querying Ontologies Client Application DL Reasoner Query Language OWL Ontology

Querying Ontologies Client Application DL Reasoner Query Language OWL Ontology

The Reasoner’s Task • We do not just want to retrieve explicitly stated knowledge

The Reasoner’s Task • We do not just want to retrieve explicitly stated knowledge • Reasoner should also infer implicitly stated knowledge • We do not have complete information (Open World Assumption) • We have to check entailment and an ontology can have several (possibly infinite) models

Standard Reasoning Tasks • All reasoners support queries for the standard reasoning tasks such

Standard Reasoning Tasks • All reasoners support queries for the standard reasoning tasks such as – Satisfiability of classes/ontologies – Subsumption between classes – Retrieval of class instances • The DL Implementation Group (DIG) developed DIG 1. 1 as an interface standard

The Query Language • DL based query languages (DIG, n. RQL) – not very

The Query Language • DL based query languages (DIG, n. RQL) – not very powerful – clear semantics – SPARQL-DL is promising • Several RDF-based query languages available (RDQL, Se. RQL, SPARQL) – Hard to define semantics – Too powerful

Conjunctive Queries • The focus of our research is to develop algorithms for database-style

Conjunctive Queries • The focus of our research is to develop algorithms for database-style conjunctive queries • OWL is much more expressive than standard database schema languages • SPARQL-DL is a subset of SPARQL that corresponds to conjunctive queries in DLs

SPARQL-DL example Retrieve all tuples (? x, ? y, ? z) such that ?

SPARQL-DL example Retrieve all tuples (? x, ? y, ? z) such that ? x is an R 5_Phosphatase, ? x contains the phosphatase domains ? y and ? z, ? y is a Catalytic domain, and ? z is a Fibronectin domain. PREFIX rdf: hhttp: //www. w 3. org/1999/02/22 -rdf-syntax-nsi SELECT ? x, ? y, ? z FROM hontologyi WHERE { ? x rdf: type ontology: R 5_Phosphatase; ? x ontology: contains_p-domain ? y; ? x ontology: contains_p-domain ? z; ? y rdf: type ontology: Catalytic; ? z rdf: type ontology: Fibronectin }

Queries and Reasoning Tasks • Standard DL query languages (DIG, n. RQL) can be

Queries and Reasoning Tasks • Standard DL query languages (DIG, n. RQL) can be reduced to standard reasoning tasks such as knowledge base satisfiability • More expressive query languages (SPARQL-DL, conjunctive queries) do not directly correspond to standard reasoning taks

Answering Conjunctive Queries • For OWL-Lite, we developed a decision procedure for conjunctive queries

Answering Conjunctive Queries • For OWL-Lite, we developed a decision procedure for conjunctive queries • Answering a conjunctive query is reduced to (possibly several) ontology consistency checks • Standard DL Reasoners can be used • Practical implementations not yet available • Future work on optimisations and extension to OWL DL

Query Rewriting • Tree-shaped queries can directly be rewritten as class expressions • The

Query Rewriting • Tree-shaped queries can directly be rewritten as class expressions • The main problem are cyclic queries • Classes can only describe tree-shaped structures • We use this Tree Model Property and show that all cyclic queries can be rewritten into a set of tree-shaped queries

Query Rewriting Example (? x) Ã has. Son(? x, ? y) Æ is. Parent.

Query Rewriting Example (? x) Ã has. Son(? x, ? y) Æ is. Parent. Of(? z, ? y) Æ has. Descendant(? x, ? z) Æ Lawyer(? z) is. Descendant. Of ? x has. Son ? y is. Parent. Of ? z: Lawyer

Query Rewriting Example Knowledge Base contains: has. Son v has. Child is. Parent. Of

Query Rewriting Example Knowledge Base contains: has. Son v has. Child is. Parent. Of ´ has. Child v has. Descendant trans(has. Descendant) has. Son(Mary, Peter) 9 has. Child. Lawer(Peter) is. Descendant. Of ? x has. Son ? y is. Parent. Of ? z: Lawyer

Query Rewriting Example Knowledge Base contains: has. Son v has. Child is. Parent. Of

Query Rewriting Example Knowledge Base contains: has. Son v has. Child is. Parent. Of ´ has. Child v has. Descendant trans(has. Descendant) has. Son(Mary, Peter) 9 has. Child. Lawer(Peter) is. Descendant. Of ? x has. Son ? y has. Child ? z: Lawyer

Query Rewriting Example Knowledge Base contains: has. Son v has. Child is. Parent. Of

Query Rewriting Example Knowledge Base contains: has. Son v has. Child is. Parent. Of ´ has. Child v has. Descendant trans(has. Descendant) ? x has. Son ? y has. Son(Mary, Peter) 9 has. Child. Lawer(Peter) has. Child ? z: Lawyer

Query Rewriting Example Knowledge Base contains: has. Son v has. Child is. Parent. Of

Query Rewriting Example Knowledge Base contains: has. Son v has. Child is. Parent. Of ´ has. Child v has. Descendant trans(has. Descendant) has. Son(Mary, Peter) 9 has. Child. Lawer(Peter) Retrieve instances of the concept 9 has. Son. (9 has. Child. Lawyer)