UP | HOME

Introduction and Related Works

1 SPARQL-DL Syntax

According to the Derivo Web page1 the reasoner uses a variant of the SPARQL-DL language which is fully aligned to OWL 2.

1.1 Base Syntax

In the following section, we describe the base syntax the SPARQL-DL must follow for the reasoner to parse it.

1.1.1 Query Types

SPARQL-DL supports two different types of queries: ASK and SELECT. An ASK-query returns a Boolean result whereas a SELECT-query returns all possible bindings of the provided variables.

  1. ASK-queries:
    ASK { [comma-separated list of atoms] }
    
  2. SELECT-queries:
    SELECT [DISTINCT] [space-separated list of variables]
    [WHERE] { [comma-separated list of atoms] }
    [OR WHERE { [comma-separated list of atoms] }]* 
    

    As within SPARQL, the DISTINCT keyword removes automatically all redundant bindings within the result set. Primitives

    In SPARQL-DL there are 3 different primitives for usage within query atoms: variables, URIs and literals. They have to follow the following syntax rules:

    Variable
    ?[a-zA-Z]+ (for example ?a, ?myVar)
    Full IRI
    <http://example.com>
    Prefixed IRI
    [the prefix]:[the suffix]
    Literal
    "this is a literal" (escape the character " inside a literal with \")

1.1.2 Prefixes

SPARQL-DL supports prefixes simmilar to those defined in SPARQL. Put the PREFIX definitions at the beginning of your SPARQL-DL-query:

PREFIX [some prefix]: <[some URI]>
PREFIX ...
...

1.1.3 OR WHERE

SPARQL-DL supports union-like statements called "OR WHERE". The results of the different where clauses are concatenated to one result.

...
WHERE { ... }
OR WHERE { ... }
OR WHERE { ... }
...

1.2 "Where" Query Patterns

A list of supported query patterns is available at the oficial Web page. The SPARQL-DL and the query patterns semantics is explained in SPARQL-DL-SQfOWLDL. Here is a list of queries availables:

  • Class(a)
  • Property(a)
  • Individual(a)
  • Type(a, b)
  • PropertyValue(a, b, c)
  • EquivalentClass(a, b)
  • SubClassOf(a, b)
  • EquivalentProperty(a, b)
  • SubPropertyOf(a, b)
  • InverseOf(a, b)
  • ObjectProperty(a)
  • DataProperty(a)
  • Functional(a)
  • InverseFunctional(a)
  • Transitive(a)
  • Symmetric(a)
  • Reflexive(a)
  • Irreflexive(a)
  • SameAs(a, b)
  • DisjointWith(a, b)
  • DifferentFrom(a, b)
  • ComplementOf(a, b)
  • Annotation(a, b, c)
  • StrictSubClassOf(a, b)
  • DirectSubClassOf(a, b)
  • DirectType(a, b)
  • StrictSubPropertyOf(a, b)
  • DirectSubPropertyOf(a, b)

1.3 Examples of Queries

In the SPARQL-DL Web page2, there are some examples listed below.

Get all classes:

SELECT ?c WHERE { Class(?c) }

Ask whether class A is a direct subclass of B:

PREFIX ex: <http://example.com#>
ASK { DirectSubClassOf(ex:A, ex:B) }

Get all fillers of transitive properties of a given individual:

SELECT ?x
WHERE { Transitive(?p),
PropertyValue(<http://example.com#myClass>, ?p, ?x) }

Get the complete class hierarchy by means of direct class/sub-class pairs:

SELECT ?a ?b
WHERE { DirectSubClassOf(?a, ?b) }

Get union of individuals of two separate classes:

PREFIX wine: <http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#>
SELECT ?i
WHERE { Type(?i, wine:PinotBlanc) }
OR WHERE { Type(?i, wine:DryRedWine) }

More examples can be found at the "A UML-like Graphical Language for SPARQL-DL" section using the Pizza.owl ontology founded at this URL: https://protege.stanford.edu/ontologies/pizza/pizza.owl.

2 Query Languages

In the following section we describe some languages or systems that provides the user a textual or graphical language for consulting ontologies.

2.1 Textual Query Languages

Textual query languages for ontologies provides a mean to retrieve information and structure for the user. The most common of these languages is OWLlink Liebig11:OWLlink, the successor of DIG Bechhofer:dig. OWLlink provides a neutral mechanism for accessing OWL and OWL 2 reasoner functionality through a declarative interface whose protocol can be bound to a concrete transport mechanism like HTTP/1.1 and XML. OWLlink provides a wide spectrum of queries we can make, but they can only affect the ABox, the TBox or the RBox separately. On the other hand, nRQL Haarslev:nRQL is another DL query interface focused on retrieving ABox individuals that satisfy specific conditions which extends the expressivity of Racer Haarslev:RACERSD query language. However we cannot use it to retrieve structural definition from the ontology. Finally, SPARQL-DL is a powerful and expressive query language for OWL-DL that can combine ABox/TBox/RBox queries. It aligns with SPARQL and is simple enough to be easily built on top of existing OWL-DL reasoners sparql-dl-AoOWLO.

2.2 Visual Query Languages

In regard to visual query languages (VQL), we can find a variety of languages focused on querying OWL-DL ontologies. They present different ways of querying an ontology, but they does not provide a SPARQL-DL representation nor match its expressiveness. To our knowledge, there are no visual language created in base of SPARQL-DL publicly available.

In OntoVQL fadhil:ontovql, queries are modelled by a graph connected style where concepts and individuals are nodes and roles are drawn by edges. Operators as "and" and "or" can be used for connecting more than one sub-query. Similarly to others visual languages, like SEWASIE, GRQL and OZONE, all these provides expressiveness enough for querying about the ABox only through a database or a nRQL query mapping.

GrOWL-Query Krivov:GrOWL allows us to query about an ontology by representing the underlying DL semantics of OWL ontologies and replacing individuals by variables. Knowledge about OWL and DL is needed for using this language augmenting the learning curve.

A visual query system like OptiqueVQS also provides a visual language along with different techniques that facilitates the query formulation. The ability to query the ontology through SPARQL only allows OptiqueVQS to query about the ABox.

2.3 Visual Query Languages

Visual query languages (VQL), such as RDF-GL and QueryVOWL , are based on a well-defined formal semantics with a visual notation and syntax. They are comparable to formal textual languages as they demand technical skills and knowledge to interpret the visual formalism OptiqueVQS2016.

2.3.1 TODO RDF-GL

2.3.2 TODO QueryVOWL

2.3.3 TODO Extended Filter/Flow Graph

Haag et al. (QueryVOWL and VOWL) proposed a filter-flow approach haag14:_visual_sparq_query_based_exten.

2.4 Visual Query Systems

Visual Query Systems are defined as systems for querying databases that use a visual representation for expressing requests. VQSs provide both a language to express the queries and a variety of functionalities to facilitate user-system interaction VQSSurvey1997.

Visual query systems (VQS), such as Rhizomer and Konduit VQB, are based on a system of interactions rather than a visual formalism, and therefore can have a design demanding no or limited technical background. They often compromise expressivity to reach a fine balance between expressiveness and usability OptiqueVQS2016.

According to Soylu:Ontology-basedVQ, visual methods for querying semantic data sources can be distinguished into two categories: The first one includes approaches that are primarily built on a VQL, the second category of approaches mainly employs a system of interactions.

2.4.1 OptiqueVQS

OptiqueVQS is a Visual Query System designed based on experiences with ontology-based data access (OBDA) applications in Statoil and Siemens. It is introducied in OptiqueVQS2013, OptiqueVQS2014 and OptiqueVQS2017.

OptiqueVQS exploits ontology projection techniques to enable graph-based navigation over an ontology during query construction. While OptiqueVQS is primarily ontology driven, it exploits sampled data to enhance selection of data values for some data attributes. This Visual Query System is used in RDF ontologies following the OBDA approach

OptiqueVQS Interface.png

Figure 1: OptiqueVQS Interface from OptiqueVQS2016. fig:optiquevqs_interface

2.4.2 TODO Faceted Search Index for OptiqueVQS

2.4.3 TODO Rhizomer

Information is availble at http://rhizomik.net/html/rhizomer/. Rhizomer2013.

2.4.4 TODO Konduit VQB

2.4.5 TODO gFacet

2.4.6 TODO OZONE

2.4.7 TODO SparqlFilterFlow

2.4.8 TODO PepeSearch

2.4.9 TODO Super Stream Collider framework

2.4.10 TODO TELEIOS Spatial

2.4.11 TODO GQL and ViziQuer

ViziQuer, formely know as GQL, is the most related graphical language. Its homepage is at https://viziquer.lumii.lv/.

This notation is based on a subset of UML. Also, it adds some "sugar syntax".

GQL is mentioned at Soylu:Ontology-basedVQ. ViziQuer is described at cerans:ViziQuer.

3 References