Skip to content

SPARQLFederator Semantics

djogopatrao edited this page Jul 21, 2014 · 13 revisions

Overview

SPARQLFederator currently expand conjunctive queries, that is, those returning a list of instances of one or more classes at the same time. When querying for a class, SPARQLFederator will expand it to the equivalent SPARQL query:

  • ClassA => SELECT ?x { ?x a ClassA. }
  • ClassA ClassB => SELECT ?x { ?x a ClassA. ?x a ClassB. }

When the domain ontology contain axioms regarding ClassA, it will generate an SPARQL with the same semantics as described on OWL. Below two examples of currently implemented transformations:

  • ClassB SubClassOf ClassA => SELECT ?x { ?x a ClassA. UNION ?x a ClassB. }

Here, as ClassA is a superclass of ClassB, we should union the results from both classes in SPARQL, by the UNION clause.

  • ( ClassB ObjectIntersectionOf ClassC ObjectIntersectionOf ... ) SubclassOf ClassA => SELECT ?x { ?x a ClassA. UNION { ?x a ClassB; a ?classC; ... } }

In this other example, an intersection of several classes is defined as subclass of ClassA, so we deal with it using a construct similar to a JOIN in SPARQL.

Goal

The goal of SPARQLFederator is to support the OWL2-QL (efficient) and OWL2-EL (decidable) profiles of OWL2. Below we describe the semantics for other inference types to guide future implementation.

OWL-2 QL

The semantics of OWL-2 QL are defined at http://www.w3.org/TR/owl2-profiles/#OWL_2_QL; special attention to the 3.2.3 section, where syntactic restrictions are defined. (I) indicates what is currently implemented.

  • (I) ClassB SubClassOf ClassA => SELECT ?x { ?x a ClassA. UNION ?x a ClassB. }
  • ClassA EquivalentTo ClassB => SELECT ?x { ?x a ClassA. UNION ?x a ClassB. }
  • ClassB EquivalentTo ClassA => SELECT ?x { ?x a ClassA. UNION ?x a ClassB. }
  • ClassB DisjointClasses ClassA => ? SELECT ?x { ?x a ClassA. UNION ?x a [ rdf:type owl:Class; owl:complementOf ClassB ]. }
  • ClassB ObjectComplementOf ClassA => ? SELECT ?x { ?x a ClassA. UNION ?x a [ rdf:type owl:Class; owl:complementOf ClassB ]. }
  • InverseObjectProperties
  • SubObjectPropertyOf
  • EquivalentObjectProperties
  • EquivalentDataProperties
  • ObjectPropertyDomain
  • DataPropertyDomain
  • DisjointObjectProperties
  • DisjointDataProperties
  • SymmetricObjectProperty
  • ReflexiveObjectProperty
  • IrreflexiveObjectProperty
  • AsymmetricObjectProperty
  • DifferentIndividuals
  • ClassAssertion
  • ObjectPropertyAssertion
  • DataPropertyAssertion

Conjunctive query

Currently, we accept a list of classes URIs and the expanded query return the instances of the union of those classes. We would like to implement something like the "DL Query" tab in Protégé (http://protegewiki.stanford.edu/wiki/DLQueryTab) or SPARQL-DL (http://www.w3.org/2001/sw/wiki/SPARQL-DL):

  • Class1 AND Class2
  • Class1 OR Class2
  • property SOME Class1
  • property VALUE "literal"

SPARQL query input

The conjunctive query format currently accepted as input allows solving a very narrow range of problems. Instead, we would like SPARQLFederator to accept SPARQL queries as well; however, the query expander would have to deal with query expansion in several locations, which would be hard to implement:

  • WHERE clauses
  • select head
  • subqueries
  • SERVICE
  • BIND
  • FILTER/ FILTER NOT EXISTS
  • GROUP/ HAVING
Clone this wiki locally