<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Rewriting SELECT SPARQL queries from 1:n complex correspondences</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Élodie Thiéblin</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fabien Amarger</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ollivier Haemmerlé</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Nathalie Hernandez</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Cassia Trojahn</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>IRIT &amp; Université de Toulouse 2 Jean Jaurès</institution>
          ,
          <addr-line>Toulouse</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper presents a mechanism for rewriting SPARQL queries based on complex ontology correspondences. While the usefulness of simple correspondences, involving single entities from both source and target ontologies, has long been recognized, query rewriting requires more expressive links between ontology entities expressing the true relationships between them. Here, complex correspondences, in the format 1:n, between overlapping ontologies are exploited for rewriting SELECT SPARQL queries, so that they can be expressed over different RDF data sets in the Linked Open Data. Our approach has been evaluated using two data sets, one from the agriculture domain and another based on a reduced set involving the ontologies from the OAEI Conference track.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        A SPARQL query is intrinsically related to the ontological model that describes
the RDF source. To federate knowledge from different sources described by
various ontologies, a SPARQL query must be adapted to each of the knowledge
bases. In order to use the Linked Open Data potential at its best, it is
important to bridge the gap of semantic heterogeneity between knowledge bases.
Ontology matching [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] is a solution for finding correspondences (i.e., an alignment)
between two ontologies. There are two types of correspondences : simple
correspondences and complex correspondences. A simple correspondence matches an
element from the first ontology to its semantically related ontological element
in the second ontology. Nevertheless, simple correspondences cannot cover every
case of use because of the model differences between ontological sources.
Complex correspondences palliate the lack of expressiveness of simple alignments.
They extend simple correspondences to correspondences between complex
constructions of ontological entities of the two ontologies.
      </p>
      <p>
        Simple correspondences can be easily used to transform SPARQL queries.
The usual approach (integrated in the Alignment API [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]) is to replace the IRI
of an ontological entity in the initial query by the IRI of its corresponding entity.
This approach considers that the correspondence stands for an equivalence
relation. However by using simple correspondences, not all SPARQL queries can be
transformed. In this paper, an approach that exploits complex correspondences
for SPARQL query transformation is proposed. Even though there are only a few
systems able to automatically generate them, manually drawing correspondences
used in the proposed mechanism is likely a less fastidious task than manually
rewriting every SPARQL query for each new RDF-triple store.
      </p>
      <p>Our approach is based on a set of rules for rewriting a subset of SELECT
SPARQL queries from complex correspondences involving an equivalence
relation between ontology entities. These correspondences are expressed in EDOAL,
a language proposed for representing complex correspondences. The approach
has been validated on two data sets. The first one was built to meet the needs
of agriculture experts willing to find cross knowledge about agronomic taxons
between DBpedia and a dedicated knowledge base. The second data set was
inspired from a subset of queries from the OAEI oa4qa1 task data set and could
be further developed in order to enrich this track.</p>
      <p>The rest of the paper is structured as follows. §2 introduces ontology matching
and the EDOAL syntax. §3 discusses related work and §4 presents the rewriting
rules on which our approach is based. §5 discusses the validation of the approach
and §6 concludes the paper and presents perspectives for future work.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Ontology matching</title>
      <p>Matching two ontologies is the process of generating an alignment A between
two ontologies O and O0. A is directional, denoted AO!O0 :
Definition 1 (Alignment). An alignment AO!O0 is a set of correspondences
AO!O0 = fc1; c2; :::; cng, where each ci is a triple heO; e0O; ri :
– if the correspondence ci is simple, both eO and eO0 stand for one and only
one entity (i.e., a class or a property) (1:1);
– if the correspondence is complex, at least one of eO or eO0 involves one or
more entities in a logical formulation. The correspondence is therefore (1:n),
(m:1) or (m:n), where eO refers to a subset of elements 2 O, and eO0 refers
to a subset of elements 2 O0. The elements of eO, resp. eO0 form a logical
construction using the constructors of a formal language (First-Order Logic
or Description Logics);
– r is a relation, e.g., equivalence ( ), more general(w), more specific (v),
holding between eO and eO0 ;</p>
      <p>The alignment AO!O0 is said complex if it contains at least one complex
correspondence. A correspondence ci, can also be noted eO r eO0 , as for the
complex correspondences in the following.</p>
      <p>Chairman Demo_Chair t OC_Chair t P C_Chair t Session_Chair t</p>
      <p>T utorial_Chair t W orkshop_Chair (1)
Accepted_P aper P aper u 9hasDecision:Acceptance (2)
1http://oaei.ontologymatching.org/2015/oa4qa/index.html</p>
      <p>Example 1 expresses a complex correspondence between entities from Cmt2
and Ekaw3 ontologies. It states that the concept Chairman of Cmt is
equivalent to the union of the concepts Demo_Chair, OC_Chair, P C_Chair,
Session_Chair, T utorial_Chair and W orkshop_Chair of Ekaw. Example
2 expresses a complex correspondence, where the concept Accepted_P aper of
Ekaw is equivalent to the concept P aper of Cmt for which the domain of the
object property hasDecision is restricted to an individual of the type Acceptance.</p>
      <p>
        For representing complex correspondences, the EDOAL language has been
proposed [
        <xref ref-type="bibr" rid="ref3 ref6">6, 3</xref>
        ]. It is fit to express simple and complex matching of cardinality
(1:1), (1:n), (n:1) and (n:m). The entities eO and eO0 are represented by
expressions (class, relation or property expressions) that can be an ID (or IRI), a
construction or a restriction. For a detailed description of EDOAL syntax the reader
can refer to [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. We illustrate this syntax with the following examples of 1:n
complex correspondences given above. We use the prefixes ekaw:&lt;http://ekaw#&gt;,
cmt:&lt;http://cmt#&gt;. Example 1 presents a class expression involving a class
construction built with a union of concepts, while Example 2 expresses a class
expression involving an attribute domain restriction.
      </p>
      <p>Example 1
&lt;entity1&gt;</p>
      <p>&lt;edoal:Class rdf:about="&amp;cmt;Chairman"/&gt;
&lt;/entity1&gt;
&lt;entity2&gt;
&lt;edoal:Class&gt;
&lt;edoal:or rdf:parseType="Collection"&gt;
&lt;edoal:Class rdf:about="&amp;ekaw;Demo_Chair"/&gt;
&lt;edoal:Class rdf:about="&amp;ekaw;OC_Chair"/&gt;
&lt;edoal:Class rdf:about="&amp;ekaw;PC_Chair"/&gt;
&lt;edoal:Class rdf:about="&amp;ekaw;Session_Chair"/&gt;
&lt;edoal:Class rdf:about="&amp;ekaw;Tutorial_Chair"/&gt;
&lt;edoal:Class rdf:about="&amp;ekaw;Workshop_Chair"/&gt;
&lt;/edoal:or&gt;
&lt;/entity2&gt;
&lt;measure rdf:datatype="&amp;xsd;float"&gt;1.0&lt;/measure&gt;
&lt;relation&gt;Equivalence&lt;/relation&gt;
Example 2
&lt;entity1&gt;</p>
      <p>&lt;edoal:Class rdf:about="&amp;ekaw;Accepted_Paper"/&gt;
&lt;/entity1&gt;
&lt;entity2&gt;
&lt;edoal:Class&gt;
&lt;edoal:and rdf:parseType="Collection"&gt;
&lt;edoal:Class rdf:about="&amp;cmt;Paper"/&gt;
&lt;edoal:AttributeDomainRestriction&gt;
&lt;edoal:onAttribute&gt;</p>
      <p>&lt;edoal:Relation rdf:about="&amp;cmt;hasDecision"/&gt;
&lt;/edoal:onAttribute&gt;
&lt;edoal:class&gt;</p>
      <p>&lt;edoal:Class rdf:about="&amp;cmt;Acceptance"/&gt;
&lt;/edoal:class&gt;
&lt;/edoal:AttributeDomainRestriction&gt;
&lt;/edoal:and&gt;
&lt;/edoal:Class&gt;
&lt;/entity2&gt;
&lt;measure rdf:datatype="&amp;xsd;float"&gt;1.0&lt;/measure&gt;
&lt;relation&gt;Equivalence&lt;/relation&gt;
Additional examples of correspondences expressed in EDOAL are presented
in examples 3 and 4. Example 3 shows a correspondence where the relation
writtenBy of Ekaw is equivalent to a relation expression constructed with the
inverse of the relation writeP aper in Cmt. Example 4, involving the ConfOf4
ontology (prefix confOf:&lt;http://confOf#&gt;), gives an example of a class
expression constructed with an attribute value restriction stating that in Ekaw an
Early-Registered_P articipant is a P articipant for which the value of the data
property earlyRegistration is equal to true in ConfOf.</p>
      <p>2http://oaei.ontologymatching.org/2015/conference/data/cmt.owl
3http://oaei.ontologymatching.org/2015/conference/data/ekaw.owl
4http://oaei.ontologymatching.org/2015/conference/data/confof.owl
Example 3
Example 4
&lt;entity1&gt;</p>
      <p>&lt;edoal:Relation rdf:about="&amp;ekaw;writtenBy"/&gt;
&lt;/entity1&gt;
&lt;entity2&gt;
&lt;edoal:Relation&gt;
&lt;edoal:inverse&gt;</p>
      <p>&lt;edoal:Relation rdf:about="&amp;cmt;writePaper"/&gt;
&lt;/edoal:inverse&gt;
&lt;/edoal:Relation&gt;
&lt;/entity2&gt;
&lt;measure rdf:datatype="&amp;xsd;float"&gt;1.0&lt;/measure&gt;
&lt;relation&gt;Equivalence&lt;/relation&gt;
&lt;entity1&gt;</p>
      <p>&lt;edoal:Class rdf:about="&amp;ekaw;Early-Registered_Participant"/&gt;
&lt;/entity1&gt;
&lt;entity2&gt;
&lt;edoal:Class&gt;
&lt;edoal:and rdf:parseType="Collection"&gt;
&lt;edoal:Class rdf:about="&amp;confOf;Participant"/&gt;
&lt;edoal:AttributeValueRestriction&gt;
&lt;edoal:onAttribute&gt;</p>
      <p>&lt;edoal:Property rdf:about="&amp;confOf;earlyRegistration"/&gt;
&lt;edoal:onAttribute&gt;
&lt;edoal:comparator rdf:resource="&amp;edoal;equals"/&gt;
&lt;edoal:value&gt;</p>
      <p>&lt;edoal:Literal edoal:type="xsd;boolean" edoal:string="true"/&gt;
&lt;/edoal:value&gt;
&lt;/edoal:AttributeValueRestriction&gt;
&lt;/edoal:and&gt;
&lt;/edoal:Class&gt;
&lt;/entity2&gt;
&lt;measure rdf:datatype="&amp;xsd;float"&gt;1.0&lt;/measure&gt;
&lt;relation&gt;Equivalence&lt;/relation&gt;
3</p>
    </sec>
    <sec id="sec-3">
      <title>Related</title>
    </sec>
    <sec id="sec-4">
      <title>Work</title>
      <p>
        A naive approach for rewriting SPARQL queries consists in replacing the IRI of
an entity of the initial query by the corresponding IRI in the alignment, using
simple correspondences. This approach is integrated in the Alignment API [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
However, it does not take into account the specific kind of relation expressed
in the correspondence (e.g., generalisation or specialization). The approach in
Euzenat et al. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] aims at writing CONSTRUCT SPARQL queries from complex
alignments. A new knowledge base expressed with the source ontology
vocabulary is populated with the instances of the target knowledge base. A rewriting
approach not limited to queries of type CONSTRUCT and that takes advantage of
complex (1:n) alignments has been proposed by Correndo et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. It applies
a declarative formalism for expressing alignments between RDF graphs. In [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ],
a subset of EDOAL expressions are transformed into a set of rewriting rules.
The expressions involving the restrictions on concepts and properties and the
restrictions on property occurrences and values are not featured in the rewriting
rules. Makris et al. [
        <xref ref-type="bibr" rid="ref8 ref9">9, 8</xref>
        ] present the SPARQL-RW rewriting framework that
applies a set of predefined rules for (complex) correspondences. They define a set
of correspondence types on which the rewriting process is based (i.e., Class
Expression, Object Property Expression, Datatype Property, and Individual ). Zheng
et al. [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] propose a rewriting algorithm that serves the purpose of context (i.e,
units of measure) interchange for interoperability. Finally, Gillet et al. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]
propose an approach for rewriting query patterns that describe query families, using
complex alignments. In this paper, we propose a set of rules for automatically
rewriting SPARQL queries based on complex alignments. Differently from [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ],
our approach rewrites SPARQL queries instead of writing them from a
complex alignment. Unlike [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], the proposed mechanism can handle restrictions on
concepts and relations. In comparison with the [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] approach, EDOAL is an
alternative to represent alignments in a more expressive (thus complete) way. For
instance, we propose occurrence and property datatype restrictions translation
rules. However, our approach is limited to (1:n) complex alignments and does
not handle initial SPARQL queries containing filters, unions, or other SPARQL
options. The approach is based on the assumption that the queries to be
transformed aim at retrieving new instances to meet a certain need. This is why only
T box elements are taken into account. [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] focuses on context correspondences
while our approach intends to translate all T box elements of a query. Finally,
the proposal of [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] rewrites query patterns while we are interested in rewriting
SPARQL queries, in a different level of abstraction. Although our approach relies
on complex correspondences, their generation is out of the scope of this paper.
The reader can refer to [
        <xref ref-type="bibr" rid="ref11 ref13">13, 11</xref>
        ] on the generation of complex correspondences
based on patterns, linguistic approaches [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], or query mining [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
4
      </p>
    </sec>
    <sec id="sec-5">
      <title>SPARQL queries reformulation approach</title>
      <p>Our approach focuses on the reformulation of a subset of SELECT SPARQL
queries. We consider initial queries, which are to be rewritten, of the type:</p>
      <p>QO = SELECT DIST IN CT ? ( V ar + j 0 0 ) W HERE f TQO g
where V ar corresponds to the set of variables used as projection attributes and
TQO stands for the query pattern made of triples expressed using the source
ontology O. A triple t of TQO is composed of a subject s, a predicate p and an
object o. 8t 2 TQO ; t = hs; p; oi. We only consider triples where s is a variable.</p>
      <p>The purpose of our approach is to produce the set TQO0 that contains the
triples expressed according to entities of the ontology O0, from TQO , by using the
complex alignment AO!O0 . The approach is limited to complex correspondences
(1:n) establishing an equivalence relation between entities of same nature. Such
correspondences involve EDOAL expressions, as follows :</p>
      <p>hClassID; ClassIDjClassConstructionjClassConstruction; i
hRelationID; RelationIDjRelationConstructionjRelationRestriction; i
hP ropertyID; P ropertyIDjP ropertyConstructionjP ropertyRestriction; i
We also make the assumption that the alignment is complete and covers all
the correspondences required to transform the entities of TQO . We define rules
that take the set of triples TQO as input and generate a SPARQL query. Three
types of triples in TQO are considered : Class Object Triples, Predicate Triples
and Other Triples.</p>
      <p>Algorithm 1 depicts the SPARQL query rewriting process. The
rewriteClassObject and rewritePredicate functions apply the rules described in the
following sections. These functions are recursive and can call each other. If a
triple is not a Class Object Triples or a Predicate Triples, it means that its
subject s is a variable, its predicate is an object property or a data property for
which no correspondence is needed and its object is either a literal or a variable.
This kind of triple does not need any transformation and is directly added to
the final query. An example of such triple is ?s rdfs:label "a literal".
Algorithm 2 Rewriting mechanism process
new_query " "
for all triple t = hs; p; oi in query do
if t is a Class Object Triple then</p>
      <p>new_query new_query + rewriteClassObject(s,p, oO0 )
else if t is a Predicate Triple then</p>
      <p>new_query new_query + rewritePredicate(s,pO0 , o)
else</p>
      <p>new_query new_query + t
end if
end for
return new_query
4.1</p>
      <p>Class Object Triples
Class object triples, denoted TQCOlass, are structured as
8t 2 TQCOlass; t = hs; p; oOi , where
8 s is a variable
&gt;
&gt;&gt;&lt; p is rdf:type
&gt; oO is a ClassID
&gt;
&gt;
: 9 &lt; oO; oO0 ; &gt;</p>
      <p>A class triple is identified if its object oO is a ClassID and if there is a
correspondence linking oO to a class expression oO0 in AO!O0 . In the transformation
of a class triple t, its subject s and its predicate p remain the same. Only its
object oO is transformed according to its equivalent element oO0 in the alignment.
The transformation rules of the rewriteClassObject function depend on the
nature of the expression oO0 , as follows:
1. ClassID : The expression oO0 is aClassID. The transformed triple return by
the function is: s p IRI(oO0 ):
2. ClassConstruction: oO0 is a class construction between two or more class
expressions denoted by: e1O0 , e2O0 , enO0 . The transformation rule depends on
the construction operator.
(a) AND: transforming an intersection consists in rewriting each triplet
having as subject s, as predicate p and as object a distinct eiO0 expression:
rewriteClassObject(s; p; e1O0 ) + rewriteClassObject(s; p; e2O0 ) +
... + rewriteClassObject(s; p; enO0 )
(b) OR: transforming a union consists in using the SPARQL keyword “UNION”
between the rewriting of each triplet having as subject s, as predicate p
and as object a distinct eiO0 :5
{ + rewriteClassObject(s; p; e1O0 ) + } UNION { +
rewriteClassObject(s; p; e2O0 ) + } +...+ UNION { + rewriteClassObject(s; p; enO0 ) +}
Table 1 shows an example of query rewriting based on the complex
correspondence of Example 1, involving a class construction with OR.
5For sake of clarity and simplicity, we do not represent string delimiters.</p>
      <p>(c) NOT: finding the negation of a class expression consists in finding the set
of triples hs; p; vi, where v is an intermediate variable, and from which
the triples hs; p; e1O0 i are removed :
3. ClassRestrsictpionv :.ReMsItNrUicStio{n +onrcelwasrsietxepCrleassssioOnbstjaekcets(si;npto;ea1Oc0c)ou+nt}relation
or property expressions noted relation(oO0 ) or property(oO0 ). The
transformation of the class triple depends on the nature of the restriction:
(a) TypeRestriction: this restriction applies to a property expression stated
in oO0 that limits the datatype of the property to a given type. The
transformation rule consists in using an intermediate variable v that becomes
the object of a new triple (that will keep on being rewritten according
to the nature of property(oO0 )). The type restriction is applied to v with
the use of a SPARQL FILTER and the datatype(v) function:
rewritePredicate(s; property(oO0 ); v) + FILTER (datatype(v) = type)
(b) DomainRestriction: this restriction limits the range of a relation
expression stated in oO0 to a class expression range(oO0 ) also stated in oO0 .
The rewritePredicate function is called with the relation relation(oO0 )
between the subject s and an intermediate variable v. The
rewriteClassObject function is called to assert that v is an instance of the
range(oO0 ) class expression : rewritePredicate(s; relation(oO0 ); v) +
rewriteClassObject(v; rdf:type; range(oO0 ))
Table 2 presents a query transformation example based on the
correspondence of Example 2 involving this kind of restriction.</p>
      <p>Query for Ekaw Transformed query for Cmt
?S}zELErCdTf:?tyzpeWHeEkRaEw:{Accepted_Paper. ???SzzvEaLrErc_CdmtTfte::mth?pyazpseDrWedHccfEmi:RtstE:iyopP{neape?crvm.atr:_Atcecmepp.tance. }
Table 2. Transformation of a class triple based on the correspondence on Example 2
between a classID and a class expression using the DomainRestriction rule.
(c) ValueRestriction: this restriction applies to a relation or property
expression. The rewritePredicate function is called between the subject
s, the relation(oO0 ) or property(oO0 ) and an intermediate variable v.
To restrain the values that can be taken by v, a SPARQL “FILTER” is
used to compare v to a value given in the class expression. In the
actual implementation, the stated value value can only be a literal or an
instance. The comparator cp used in the SPARQL FILTER is one of the
comparators provided by the EDOAL syntax : “=”, “&gt;” and “&lt;”.
rewritePredicate(s; relation=property(oO0 ); v) + FILTER (v cp value)
where cp 2 f=; &lt;; &gt;g. For a “=” comparator, the resulting query is not
optimal in terms of performance. The rewriting rule exception could be :
rewritePredicate(s; relation=property(oO0 ); value) instead of using an
intermediate variable and a FILTER that applies to it. Table 3 presents
a transformation example based on the correspondence of Example 4.</p>
      <sec id="sec-5-1">
        <title>Query for Ekaw</title>
        <p>SELECT ?z WHERE {
?z rdf:type ekaw:Early-Registered_Participant.
}
Predicate triples, denoted by TQPOredicate have the following structure :
8t 2 TQPOredicatet = hs; pO; oi , where
8 s is a variable
&gt;
&gt;&gt;&lt; pO = a RelationId or PropertyId
&gt; o is a variable, an instance or a literal
&gt;
&gt;
: 9 &lt; pO; pO0 ; &gt;2 AO!O0</p>
        <p>In predicate triples, pO is either a RelationId or a PropertyId and pO0 is
respectively a relation expression or a property expression. A relation triple is
transformed according to the nature of the expression pO0 .
1. RelationId or PropertyId : the following triple is added to TQO0 : s IRI(pO0 ) o:
2. RelationConstruction or PropertyConstruction: pO0 is a construction
between relation or property expressions designated by p1O0 , p2O0 , pnO0 . The
transformation of the relation triple depends on the operator of the
construction.
(a) AND: this construction can be between two or more expressions (relation
expressions resp. property expressions). The rewritePredicate function
is called as follows:
rewritePredicate(s; p1O0 ; o) + rewritePredicate(s; p2O0 ; o) + ...
+ rewritePredicate(s; pnO0 ; o)
(b) OR: this construction can be between two or more expressions (relation
expressions resp. property expressions). A SPARQL UNION links the calls
to rewritePredicate:
{ + rewritePredicate(s; p1O0 ; o) +} UNION { + rewritePredicate(s; p2O0 ; o)
+ } + ... + UNION { + rewritePredicate(s; pnO0 ; o) + }
(c) NOT: the negation of a relation is the subset of all relations minus this
relation. To represent all relations an intermediate variable v is
introduced. The negation will be done using a SPARQL MINUS:</p>
        <p>s v o . MINUS { + rewritePredicate(s; p1O0 ; o) + }
(d) COMPOSE: a relation composition is a relation chain. Intermediate
variables v1, v2, etc. are introduced to complete the chain between the
subject s and the object o. If the relation expression pO0 is a
RelationExpression, all the expressions of the chain will be relation expressions. If pO0
is a PropertyExpression, all the expressions of the chain will be relation
expressions except the last one that will be a property expression. We
assume that a composition imbrication or the use of a negation inside a
composition is a modeling problem in the alignment itself.</p>
        <p>rewritePredicate(s; p1O0 ; v1) + rewritePredicate(v1; p2O0 ; v2)
+ ... + rewritePredicate(vn 1; pnO0 ; o)
(e) INVERSE : this construction only applies to a RelationExpression.
Inverting a relation consists in switching its subject and its object in a
triple. rewritePredicate(o; p1O0 ; s) Table 4 gives an example of a triple
transformation based on the correspondence of Example 3.
(f) REFLEXIVE : this construction only applies to a RelationExpression.</p>
        <p>This operator is used to specify that a relation links its subject s to itself.</p>
        <p>rewritePredicate (s; p1O0 ; s)
(g) SYMMETRIC : this construction only applies to a RelationExpression.</p>
        <p>This operator is used to specify that a relation is used both ways : it is
the intersection of a relation and its inverse.</p>
        <p>rewritePredicate(s; p1O0 ; o) + rewritePredicate(o; p1O0 ; s)
3. RelationDomainRestriction or PropertyDomainRestriction : these restrictions
limit the domain of a relation or property to a class expression domain(p1O0 )
stated in the relation or property expression.</p>
        <p>rewriteClassObject(s; rdf:type; domain(pO0 ))
4. RelationCoDomainRestriction : this restriction restrains the range of a
RelationExpression to a class expression range(pO0 ).</p>
        <p>rewriteClassObject(o; rdf:type; range(pO0 ))
5. PropertyTypeRestriction : this restriction limits the datatype of a property
to a given type type in the property expression O0 . A SPARQL FILTER with
the datatype(o) function is used. FILTER (datatype(o) = type)
As far as we know, there is no available data set consisting of two knowledge
bases, a complex and complete alignment between two ontologies and
corresponding SPARQL queries for both bases. In the context of the OAEI oa4qa6, a
data set involving simple alignments is available. In order to fill this gap, we have
manually created two data sets, following the principle of the oa4qa task. The
validation of our mechanism checks that the translated query retrieves the same
results as the reference query. Although these data sets only contain a small
number of queries, it serves as a basis for a first validation of our approach.</p>
        <p>Knowledge bases and SPARQL queries. The first data set was built
during a project aiming at collecting knowledge about plant taxonomy. To meet
this need, the knowledge bases Agronomic Taxon7 and DBpedia have been
considered. The task consists of retrieving answers to the following queries:
– qa1: which are the taxa of type species ?
– qa2: which are the taxa having for higher taxonomic rank a family taxon ?
– qa3: which are the taxa of taxonomical rank kingdom ?
– qa4: which are the taxa of taxonomical rank order ?
– qa5: which are the taxa of taxonomical rank genus ?
In order to build this data set, reference SPARQL queries corresponding to the
natural language description above have been written manually for each
knowledge base. The same approach was followed to construct the second data set. It
aims at interrogating a subset of the OAEI 2015 ontologies about conference
organization8. Three ontologies of this data set were considered (Cmt, ConfOf and
Ekaw). We have defined the SPARQL queries answering the following queries :
– qb1: which are the reviewers of accepted papers ? (Ekaw to Cmt)
6http://oaei.ontologymatching.org/2015/
7http://ontology.irstea.fr/AgronomicTaxon
8http://oaei.ontologymatching.org/2015/conference/index.html
– qb2: which are authors of long submissions ? (Ekaw to Cmt)
– qb3: which are the chairmen who have submitted a paper ? (Cmt to Ekaw)
– qc1: which are the early registered participants who authored a submitted
paper ? (Ekaw to ConfOf)
– qc2: which are the late registered participants who wrote a poster ?(Ekaw to</p>
        <p>ConfOf)
The three ontologies were populated with instances meeting these needs.
Simultaneously, the queries were transformed into SPARQL queries specifically
written for each of the knowledge bases.</p>
        <p>Complex alignments. 10 complex correspondences (and 1 simple) have
been manually produced between Agronomic Taxon and DBpedia. 8 simple and
6 complex correspondences have been manually produced between the three
ontologies of the Conference data set. The alignments are available online9.</p>
        <p>Discussion. Our validation is based on the manual comparison of the set
of results returned from the automatically rewritten query with respect to the
results of the reference query. Even though the reference query and the
rewritten one differ in terms of syntax, they retrieve the same set of instances. For
example, Table 5 shows the queries considered for the need qc1 described above.
The initial SPARQL query for Ekaw was transformed by using the complex
correspondences of Example 4 and the simple correspondence ekaw : authorOf
conf Of : writes. As stated above, although the generated query is not
syntactically equivalent to the reference query for ConfOf, they retrieve the same set
of instances. The whole set of rewritten queries is available online10.</p>
      </sec>
      <sec id="sec-5-2">
        <title>Initial query for Ekaw (a)</title>
        <p>SELECT ?person WHERE { SELECT ?person WHERE{
?person :authorOf ?paper. ?person
?paper a :Paper. :earlyRegistration true.
?person rdf:type ?person :writes ?papier.
:Early-Registered_Participant.} ?papier a :Paper.}</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Conclusion and perspectives</title>
      <p>In this paper, we have presented an approach to rewrite SELECT SPARQL
queries formulated for a particular ontology to interrogate a knowledge base
based on a second ontology using (1:n) complex correspondences. The proposed
approach has been validated on two data sets manually created. There are many
improvements to make to this mechanism. Indeed, the approach is limited to
9https://www.irit.fr/recherches/MELODI/telechargements/alignements.zip
10https://www.irit.fr/recherches/MELODI/telechargements/requetesgenerees.zip
formatted queries composed of triples whose subject is a variable. Instance
alignments are not considered yet. We do not consider as well (n:m) correspondences.
Proposals on complex graph pattern recognition in SPARQL queries would be
interesting to take into account in order to address that matter. Another point
is that we do not distinguish the kind of relation of a correspondence
(subsumption and equivalence). Moreover, some EDOAL syntax of concepts have not been
implemented, such as functions on literal (string concatenation, arithmetic
operations, etc. that could be used in particular for value restrictions). Finally,
property value restrictions is another EDOAL expression that was not
implemented because it is more likely to be found in (n:m) correspondences. We plan
to address all these points in future work.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Correndo</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Salvadores</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Millard</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Glaser</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shadbolt</surname>
          </string-name>
          , N.:
          <article-title>SPARQL Query Rewriting for Implementing Data Integration over Linked Data</article-title>
          .
          <source>In: 1st International Workshop on Data Semantics (DataSem</source>
          <year>2010</year>
          ) (
          <year>March 2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Correndo</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shadbolt</surname>
          </string-name>
          , N.:
          <article-title>Translating expressive ontology mappings into rewriting rules to implement query rewriting</article-title>
          .
          <source>In: 6th Workshop on Ontology Matching</source>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>David</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Euzenat</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scharffe</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Trojahn</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <source>The Alignment API 4.0. Semantic Web</source>
          <volume>2</volume>
          (
          <issue>1</issue>
          ),
          <fpage>3</fpage>
          -
          <lpage>10</lpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Euzenat</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polleres</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scharffe</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Processing ontology alignments with sparql</article-title>
          .
          <source>In: International Conference on Complex, Intelligent and Software Intensive Systems</source>
          . pp.
          <fpage>913</fpage>
          -
          <lpage>917</lpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Euzenat</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shvaiko</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          : Ontology Matching. Springer-Verlag, Berlin, Heidelberg (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Euzenat</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scharffe</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zimmermann</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Expressive alignment language and implementation</article-title>
          .
          <source>Tech. rep.</source>
          ,
          <source>INRIA</source>
          (
          <year>2007</year>
          ), http://hal.inria.fr/hal-00822892/
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Gillet</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Trojahn</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Haemmerlé</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pradel</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Complex correspondences for query patterns rewriting</article-title>
          .
          <source>In: 8th Workshop on Ontology Matching</source>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Makris</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bikakis</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gioldasis</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Christodoulakis</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>SPARQL-RW: transparent query access over mapped RDF data sources</article-title>
          .
          <source>In: 15th International Conference on Extending Database Technology</source>
          . pp.
          <fpage>610</fpage>
          -
          <lpage>613</lpage>
          . ACM (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Makris</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gioldasis</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bikakis</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Christodoulakis</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Ontology Mapping and SPARQL Rewriting for Querying Federated RDF Data Sources</article-title>
          . In: OTM Confederated International Conferences. pp.
          <fpage>1108</fpage>
          -
          <lpage>1117</lpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Qin</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dou</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , LePendu, P.:
          <article-title>Discovering executable semantic mappings between ontologies</article-title>
          . In: OTM International Conference. pp.
          <fpage>832</fpage>
          -
          <lpage>849</lpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Ritze</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Meilicke</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sváb-Zamazal</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stuckenschmidt</surname>
          </string-name>
          , H.:
          <article-title>A pattern-based ontology matching approach for detecting complex correspondences</article-title>
          .
          <source>In: 4th Workshop on Ontology Matching</source>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Ritze</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Völker</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Meilicke</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sváb-Zamazal</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          :
          <article-title>Linguistic analysis for complex ontology matching</article-title>
          .
          <source>In: 5th Workshop on Ontology Matching</source>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Scharffe</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fensel</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Correspondence patterns for ontology alignment</article-title>
          .
          <source>In: Knowledge Engineering: Practice and Patterns</source>
          , pp.
          <fpage>83</fpage>
          -
          <lpage>92</lpage>
          . Springer (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Zheng</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Madnick</surname>
            ,
            <given-names>S.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          :
          <article-title>SPARQL Query Mediation over RDF Data Sources with Disparate Contexts</article-title>
          .
          <source>In: WWW Workshop on Linked Data on the Web</source>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>