<!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>
      <journal-title-group>
        <journal-title>Athens, Greece.
$ etsalapati@gmail.com (E. Tsalapati); miliakis@di.uoa.gr (M. Iliakis); koubarak@di.uoa.gr (M. Koubarakis)</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Location Query Answering Using Box Embeddings</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Eleni Tsalapati</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Markos Iliakis</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Manolis Koubarakis</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dept. of Informatics and Telecommunications, National and Kapodistrian University of Athens</institution>
          ,
          <country country="GR">Greece</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2022</year>
      </pub-date>
      <volume>000</volume>
      <fpage>0</fpage>
      <lpage>0001</lpage>
      <abstract>
        <p>A standard way to retrieve knowledge from geospatial knowledge graphs is by using the query language SPARQL and its geospatial extensions, such as GeoSPARQL and stSPARQL. However, this approach presupposes that the queried knowledge graph is complete, which is rarely the case. A promising recent approach to the problem of query answering over incomplete knowledge graphs is by employing embedding-based techniques. In this paper, we have developed the embedding-based geospatial query answering model, SQABo, which encodes conjunctive geospatial queries as boxes in an embedding space and returns as answers the entities found within the box. Experiments on two geospatial knowledge graphs (YAGO2geo and DBGeo) show that our approach ofers superior performance when compared with related techniques published in the recent literature.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Geospatial knowledge graphs</kwd>
        <kwd>Geospatial query answering</kwd>
        <kwd>Geospatial knowledge graph embeddings</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Geospatial data and knowledge have become ubiquitous on the Web today and in applications
such as navigation, smart cities, Earth observation, etc. To retrieve eficiently such geospatial
knowledge, several geospatial knowledge graphs (KGs) have been proposed in the literature (e.g.,
YAGO2geo [1], WorldKG [2] and KnowWhereGraph [3]). Geospatial knowledge graphs enable
the representation of geospatial knowledge in a semantically enriched, formal, and structured
way using ontologies and the RDF data model.</p>
      <p>Standard query answering engines that retrieve knowledge from a geospatial KGs pose
SPARQL, GeoSPARQL [4] or stSPARQL [5] queries using RDF stores that support precise
geospatial data (e.g., Strabon [5], Strabo 2 [6] or GraphDB1). However, the evaluation of such
queries can sometimes be a very time-consuming process. For instance, for identifying the
countries bordering Greece, an engine like the above may compare the geometry of Greece
with the geometry of each country of the targeted knowledge graph. On top of this, these
engines assume that the targeted knowledge graph is correct and complete, which is rarely the
case, for instance, in the above example, the geometries of some countries may be inaccurately
defined. This can be due to the intrinsic noise of crowd-sourced data (e.g., OpenStreetMap) used
to construct the queried knowledge graph, or due to the intrinsic vagueness [7] of geospatial
knowledge graphs: the shape of some geospatial features (e.g., mountain or valley) cannot be
precisely defined (e.g., borders of a mountain or a valley) and in cases that these are defined,
timeliness (e.g., the sizes of cities can change through time) and administrative definitions (e.g.,
boundaries of administrative regions can change) often afect the query answering results.</p>
      <p>More recent approaches (e.g., [8, 9]) address KG incompleteness and vagueness by employing
embedding techniques. In general, embedding-based models compute vector embeddings for
the queries and identify the answers by performing nearest-neighbor search in the latent
space. Hence, they can handle queries for which the data required for their answering may
not be explicitly present in the KG, instead they utilize implicit semantics captured from the
embeddings. SE-KGE [10] was the first embedding-based model for conjunctive query answering
over geospatial KGs. SE-KGE aims to learn to encode a given query in such a way that its
embedding will be the closest one to the embedding of the correct answer to the query. However,
as it is pointed out by Ren et al. [11], single-point embeddings cannot enclose the set of entities
related to the query, while it is unclear how to perform logical operations, like conjunction,
over points in the latent space.</p>
      <p>In this paper, we develop the novel geospatial query answering model SQABo (geoSpatial
conjunctive graph Query Answering based on KG embeddings with Boxes). SQABo initially
encodes entities and relations appearing in an input conjunctive query utilizing the entity
encoders introduced by Mai et al. [10]. Then, these vectors are gradually projected into boxes
customizing the Query2Box approach presented in [11] to also incorporate geospatial
information. The answer to an input conjunctive query is computed by intersecting these boxes and
returning the entities within the final box. For the intersection, we optimized the algorithm
of [11] by employing the graph self-attention mechanism introduced in [12]. Experimental
results over YAGO2geo [13] and over the geospatial fragment DBGeo of DBGeo [10] show
that SQABo delivers better performance than SE-KGE: 93.5% over 87.9% macro-averaged APR
score on YAGO2geo and 87.4% over 82.9% macro-averaged APR score on DBGeo .</p>
      <p>The remainder of the paper is structured as follows. Section 2 introduces our terminology
and notation. Then, after an overview of related work in Section 3, the architecture of SQABo
is presented in detail in Section 4. In Section 5 we describe the pre-processing methods used to
create the dataset for training the model, the training method and our experiments. Conclusions
and future work are discussed in Section 6.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Preliminaries</title>
      <p>A knowledge graph ⟨ℰ ∪ ℒ, ℛ⟩ over a vocabulary consisting of disjoint sets of entities ℰ , literal
values ℒ and relations ℛ, is a finite set of triples (alternatively, facts) ⟨1, , 2⟩ where 1 ∈ ℰ ,
2 ∈ ℰ ∪ ℒ and  ∈ ℛ. Entity 1 is called the subject (alternatively, head), entity 2 is called the
object (alternatively, tail) and  is called the relation of the triple. The set of entities ℰ consists
of a disjoint set of classes  and individuals ℐ.</p>
      <p>In GIS terminology [14], a geographic feature, or simply feature, is an abstraction of a
realworld phenomenon (e.g., the airport of Athens) and can have various attributes that describe
its thematic (e.g., name, the company that manages it) and spatial (e.g., location on Earth)
characteristics. A point p is a pair (, ) ∈ R2. Points represent locations in the Cartesian
coordinate space, which is the coordinate space used in this paper. A bounding box is the
smallest (with respect to the subset relation) rectangle enclosing a geographic feature. Naturally,
for any bounding box , we have  ⊂ R2. As it is standard [10], a bounding box is represented
by the pair [⃗; ⃗] ∈ R4, where ⃗, ⃗ ∈ R2 are its southwest and northeast points. A study area is
a bounding box that contains geographic features under study.</p>
      <p>A geospatial knowledge graph over a study area  is a knowledge graph ⟨ℰ ∪ ℒ, ℛ⟩ such
that the set of entities ℰ contains a non-empty set ℰ of geospatial entities. The geospatial
entities in ℰ are of two kinds: locations represented by a point in the study area  or regions
represented by a bounding box [⃗; ⃗], with ⃗, ⃗ ∈ .</p>
      <p>
        An example of a geospatial KG is presented in Figure 1A), where knowledge about river
Thames, the areas that it crosses and areas neighbouring to Slough is illustrated. Here, ℰ
represents all nodes appearing in the graph (e.g., City, River, River_Thames, Geometry_211), ℒ
the polygons (POLYGON((51.69444,-2.029722),..)) and  the classes (City, River, denoted with
orange nodes) of the KG. Conjunctive graph queries (CGQ) is a subclass of first-order logic queries
over a knowledge graph that may include only the existential quantifier ( ∃), the conjunction
operator (∧), and have a single answer variable. CGQs can be defined as follows. Let ℰ be a set
of entities, ℛ a set of relations and  a set of variables. We assume that the three sets ℰ , ℛ and
 are pairwise disjoint. A CGQ query () with answer variable (or target node)  ∈  is a
formula of the form
(∃1)(∃2) · · · (∃)(1 ∧ 2 ∧ · · · ∧
)
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
where for each 1 ≤  ≤ ,  is of the form (, ) or of the form (, ). We also have
 ∈ ℛ,  ∈ ℰ , ,  ∈ ,  ̸=  and  appears in some of the .
      </p>
      <p>The dependency graph of a CGQ () is a directed graph whose nodes are the terms (i.e.,
entities or variables) occurring in the query and where there is a directed edge from term 1 to
term 2 for each atom of the form (1, 2) occurring as a sub-formula in the query. According
to [15], for a CGQ to be valid (i.e., there are no contradictions or redundancies), its dependency
graph must be a directed acyclic graph (DAG), where each source node in the graph is an entity
(thus not a variable) and the answer variable is the single sink node. An example CGQ with its
dependency graph is presented in Figure 1B).</p>
    </sec>
    <sec id="sec-3">
      <title>3. Related Work</title>
      <p>
        A simple query answering task is link prediction: calculate the most likely answers to a query of
the form (, ) or (, ) where  is an answer variable,  is a relation and  is an entity in the
knowledge graph. There are three main approaches for link prediction: (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) translation-based
methods (e.g., TransE [16] and TransH [17]), which translate the head entity and the tail entity
of a triple using the relation of the triple and, then, they use a distance function to evaluate the
embedding or to score the reliability of the predicted fact; (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) semantic matching-based methods
(e.g., RESCAL [18] and ComplEx [19]) that use similarity-based scoring functions, by matching
latent semantics of entities and relations embodied in their vector space representations; and
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) methods that embed the entities based, also, on the local structure of the graph using graph
convolutional networks [20] (e.g., R-GCN [21] and TransGCN [22]). Further details about link
prediction models can be found in [23], [24] and [25].
      </p>
      <p>The main idea of knowledge graph embedding-based query answering is to predict the
embedding of the answer variable by utilizing the embeddings of the entities appearing in
the query. Recent approaches include GQE [15], CGA [12], Query2box [11], CQD [26] and
Var2Vec [8]. GQE was one of the first such models that could handle conjunctive graph queries.
Mai et al. [12] developed CGA which extends GQE by dealing with the variability of contributions
from diferent query paths. Query2box [ 11] models the queries by using box instead of point
embeddings in a vector space. In this way, it manages to support with higher accuracy (compared
to GQE) logical queries that may include the existential quantifier and both the conjunction
and disjunction (∨) operators. CQD supports the same fragment of FOL queries, and exploits
trained neural link predictors and fuzzy logic operators limiting in this way the need for a large
and complex training dataset. However, as it is discussed by Wang et al. [8] it has low inference
eficiency. Var2Vec [8] supports in a scalable manner also queries with negations.</p>
      <p>Although the sparsity of geospatial knowledge graphs calls for solutions utilizing knowledge
graph embedding-based techniques, to the best of our knowledge, only Wang et al. [27] have
utilized embedding techniques for link prediction and Mai et al. [10] for conjunctive query
answering. SE-KGE [10] encodes the absolute positions of the geospatial entities. Until SE-KGE,
geospatial information was encoded into the KG embedding space in a very limited fashion,
mainly by leveraging only the geospatial distances between geospatial entities (e.g., [28, 29]).</p>
      <p>SE-KGE utilizes the GQE and CGA models to encode the class information of the geospatial
entities (e.g., whether a geospatial entity is a country or a city). In addition, it encodes the
geospatial information of an entity by using the location encoder Space2Vec [30]. Space2Vec
ifrst encodes a location as a multi-scale periodic representation by using sinusoidal functions
with diferent frequencies and then feeds the resulting embedding into a N-layer feed-forward
neural network. In this way, it preserves global position information of the geospatial entities
of the knowledge graph as well as relative distance and direction.</p>
    </sec>
    <sec id="sec-4">
      <title>4. The SQABo Model</title>
      <p>In this section we present the architecture of the SQABo model. SQABo is composed of: (i)
the geospatial encoder, which encodes the entities appearing an input query  taking into
consideration the classes in which they belong and their geometry; (ii) the geometric projection
operator that creates, moves and enlarges the query box embeddings based on the components
of ; and (iii) the intersection operator which intersects the final generated boxes to return the
ifnal box containing the set of points corresponding to the of answer entities of .</p>
      <sec id="sec-4-1">
        <title>4.1. Geospatial Entity Encoder</title>
        <p>For the encoding of the geospatial entities we follow the methodology proposed by Mai et
al. [10], which, for better understanding of the paper, it is described in brief next.</p>
        <p>The geospatial entity encoder Enc() consists of an entity class encoder Enc()() and an entity
space encoder Enc()(). The entity class encoder consists of class-specific embedding matrices
which are learned during training. This part helps the model to learn class information about
each geospatial entity (e.g., that the entity is a country or a city).</p>
        <p>The entity space encoder utilizes the model Space2Vec [30] to enrich the final representation
with the geospatial information of the entity. For entities that are locations and have point
representations, the input to the module is the entity’s co-ordinates. If an entity is a region,
the input is a point selected uniformly at random to be inside the bounding box of the entity.
The intuition behind this is that during training the encoder will learn a uniform distribution
over the entity’s bounding box. After constructing the input, the initial space representation
passes through a feed-forward neural network to get the space embedding. In the end, the class
embedding and the space embedding are concatenated resulting in the entity embedding which
will have both class and geospatial information embedded.</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Geometric Projection Operator</title>
        <p>The geometric projection operator goes a step beyond simple edge prediction and incorporates
the idea of box embeddings proposed by Ren et al. [11], but we extend it by encoding also
the geospatial information. The intuition behind the box embedding approach is that, instead
of encoding the queries as points in a latent space, encode them as hyper-rectangles. The
points inside the generated hyper-rectangle correspond to the answer entities of the query.
The hyper-rectangle is defined by a center embedding (of the box of the query) and an ofset
embedding (from the center of the box).</p>
        <p>To incorporate the geospatial information present in a geospatial knowledge graph, the
geometric projection operator encodes each relation  to a relation embedding r = (Cen(r), Of (r)) ∈
R2. Cen(r) represents the relation box center embedding and it is calculated by using two
trainable matrices: the relation feature matrix r() and the geospatial embedding matrix r() which
are applied on the entity class embedding and the entity space embeddings, respectively. The
relation box center embedding is resulted from the concatenation of these two matrices: Cen(r)=
([r(); r()]). Of (r), with Of (r) ⪰ 0, is the trainable relation box ofset embedding matrix , which,
when trained, represents the correct size of the box (i.e., the distance of its endpoints from its
center).</p>
        <p>Let  = ⟨ℰ ∪ ℒ, ℛ⟩ be a geospatial knowledge graph, () a query over ,  the DAG
of (),  a path of  from a leaf entity  ∈ ℰ to the root , and  () = 1(, 1) ∧
2(1, 2) ∧ . . . ∧ +1(, ) the subformula of () corresponding to . Then, supposing
that we operate on R, the geometric projection operator calculates the box embedding p =
(Cen(p), Of (p)) ∈ R2 of  as follows.</p>
        <p>First, in line with [11], each relation  ∈ ℛ is associated with a relation embedding r =
(Cen(r), Of (r)) ∈ R2 with Of (r) ⪰ 0 as the contribution of the relation to the existing box
may enlarge it or only move it in the vector space.</p>
        <p>Then, starting from the leaf entity  the box embedding p0 = (e, 0), with Enc() = e, e ∈ R,
will be calculated and the node  in  will be marked as visited. After this, the following process
will be repeated until all nodes in  are marked as visited:
• Iterate through each unvisited node  of  for which there is an  (1 ≤  ≤ ) such that
(,  ) appears in () and  is a visited node.
• Compute box p = (Cen(p− 1) + [r(); r()], Of (p− 1) +  (Of (r))), where  is the
sigmoid activation function.</p>
        <p>• Mark  as visited.</p>
        <p>Finally, p = p+1.</p>
        <p>If the query contains multiple entities (i.e., its DAG contains multiple leaves), then the
geometric projection operator generates multiple boxes.</p>
        <p>Example 4.1. Consider the following query () presented in Figure 1:</p>
        <p>(∃1)(crosses(River_Thames, 1) ∧ touches(Slough, 1) ∧ within(1, ))</p>
        <p>
          The embedding process of () is presented in Figure 2. The query has two leaf-to-root
paths: 1 = {River_Thames, 1, }, 2 = {Slough, 1, }. For 1, initially the embedding
e1 of River_Thames will be calculated and, then, the zero-ofset “box” p(01) with center e1
(p(01) = (e1, 0)) will be generated. Then, the geometric projection operator visits the node 1,
encodes the relation crosses ([r(); r()]) and randomly initializes Of (r). In this way, it
creates the box p(11) by combining the embeddings with the previous zero-size initial box:
p(11) = (e1 + [r(); r()],  (Of (r)))
In the same way, the final box p(
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) = p(21) is generated by encoding the relation within (r)
and combining it with the box p(11). The same process is followed to create p(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) for path 2.
        </p>
        <p>Next, we describe the box intersection operator, which intersects the generated boxes from
each path of the query to result in a single embedding box that will represent the set of answers
to the input query.</p>
      </sec>
      <sec id="sec-4-3">
        <title>4.3. Box Intersection Operator</title>
        <p>
          The box intersection operator produces a single final answer box embedding by calculating a
ifnal box center and the final box ofset from the boxes p(
          <xref ref-type="bibr" rid="ref1">1</xref>
          ), p(
          <xref ref-type="bibr" rid="ref2">2</xref>
          ), . . ., p() generated by the
geometric projection operator.
        </p>
        <sec id="sec-4-3-1">
          <title>4.3.1. Intersection of Box Centers</title>
          <p>Instead of employing a simple attentions mechanism, as in Query2Box, SQABo employs the
graph self-attention mechanism introduced by Mai et al. [12], which is implemented by using
a multi-head attention layer and a feed-forward neural network layer having normalization
layers in between. In the end, the attention-weighted box center embedding is computed as the
weighted average of diferent input box center embeddings, while the weights are automatically
learned by the multi-head attention mechanism.</p>
          <p>
            Formally, let  be a geospatial KG, () be a query over  and p(
            <xref ref-type="bibr" rid="ref1">1</xref>
            ), p(
            <xref ref-type="bibr" rid="ref2">2</xref>
            ), . . . , p() generated
by the geometric projection operator, then the center of the intersected box is calculated as:
          </p>
          <p>
            Cen() = CGA(Cen(p(
            <xref ref-type="bibr" rid="ref1">1</xref>
            )), . . . , Cen(p())) =
          </p>
          <p>LayerNorm2(WLayerNorm1(eattn + einit) + B + LayerNorm1(eattn + einit))
where LayerNorm1(), LayerNorm2() are normalization layers, W ∈ R×  is a trainable entity
class specific weight matrix (since all box centers are forced to have the same entity class ) and
B ∈ R a bias vector in a feed-forward neural network. Also, einit is a permutation invariant
transformation of the initial box center embeddings. The attention weighted embedding eattn
is computed as the weighted average of diferent input embeddings, while the weights are
automatically learned by the multi-head attention mechanism:</p>
          <p>eattn =  ( 1 ∑︁ ∑︁ Cen(p()))</p>
          <p>=1 =1
where  is the number of attention heads,  () is the sigmoid activation function,  is the
number of all answer box centers to be intersected, and  the attention coeficient [ 12] for the
center of each p() box in the ℎ attention head.</p>
        </sec>
        <sec id="sec-4-3-2">
          <title>4.3.2. Intersection of Box Ofsets</title>
          <p>For the intersection of box ofsets we use the method proposed by Ren et al. [ 11], which generates
a smaller box that lies inside the intersected boxes. For this purpose, the permutation-invariant
deep architecture Deepsets [31] is utilized.</p>
          <p>The intersection ofset is given by:</p>
          <p>
            Of (p(
            <xref ref-type="bibr" rid="ref1">1</xref>
            ), . . . , p()) = Min(Of (p(
            <xref ref-type="bibr" rid="ref1">1</xref>
            )), . . . , Of (p())) ·  (DeepSets(p(
            <xref ref-type="bibr" rid="ref1">1</xref>
            ), . . . , p()))
          </p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Experiments</title>
      <p>We have implemented SQABo and made it available publicly as open source.2 We also evaluated
the performance of SQABo against SE-KGE [10], which is, to the best of our knowledge, the
only embedding-based query answering model over geospatial knowledge graphs proposed
so far. In this section, we describe the results of our evaluation over the geospatial knowledge
graphs DBGeo3, which was used for the evaluation of SE-KGE, and YAGO2geo4. The statistics
of DBGeo and YAGO2geo and the respective generated QA datasets are presented in Table 1.
Knowledge Graphs. To evaluate DBGeo with SQABo, we extracted its geospatial fragment
(i.e., the fragment of DBGeo that contains only geospatial entities) named here DBGeo. To
follow the entity encoder architecture of SE-KGE [10], we transformed the polygons represented
YAGO2geo into bounding boxes by initially calculating the minimum and maximum vertices of
each polygon and finally computing from these vertices the height, width, rotation angle and
center of each bounding box.</p>
      <p>Query Dataset. In line with [11, 10], we consider the seven query patterns (DAG structures)
shown in Figure 3. Query pattern 1-chain represents the most simple query with an entity, a
relation and an answer variable, 2-chain represents a query with a single existential variable
and a single answer variable, the 2-inter a query with two entities and a single answer variable.
The remaining patterns represent increasingly complex query structures.
2https://github.com/markos-iliakis/GeospatialKGEmbeddings
3https://github.com/gengchenmai/se-kge
4https://yago2geo.di.uoa.gr/</p>
      <p>As in [11, 10], for the generation of the training and validation queries, we selected 10% of
the edges in a uniformly random manner and removed them from the graph and, then, we
performed sampling on this down-sampled training graph, taking 1, 000, 000 samples of the
seven diferent DAG structures. To make the test queries, we sampled them from the original
graph, but we ensured that at least the answer nodes were not part of the training graph and,
therefore, the model should not have used them in the training phase.</p>
      <p>Model Training. The training of the model is supervised as we sampled the query-answer
pairs from the graph. In the training phase, we sample in total 1, 000, 000 conjunctive
queryanswer pairs, equally distributed among the DAG structures, and  negative answers for each
query. We utilized the loss function used for the Query2Box model:
 = − log  ( − distbox(v; q)) −
∑︁ 1
=1

log  ((v′; q) −  )
where  represents a fixed scalar margin, and distbox() [11] the distance between the entity
vector v representing the answer  (positive entity) to the query box embedding q. Also, v′
represents the entity vector of the -th negative entity (non-answer to ) ′, and  is the number
of negative entities.</p>
      <p>The number of iterations was 30, 000 and the embedding size of both the entity encoder
feature and spatial embedding was 128 as well as the size of the relation embeddings. The
hidden size of the feed-forward NN was 512, the dropout 0.5 with skip connections and learning
rate 0.01. Space2Vec was used with a minimum radius of 50, maximum of 5,400,000, and
frequency of 16. The graph attention mechanism had 2 heads.</p>
      <p>We implemented all models in PyTorch and trained/evaluated each model on a Ubuntu
machine with 1 GeForce GTX 1080 Nvidia GPU core, which has 10GB memory.
Evaluation Metrics. In line with Mai et al. [10], to measure the performance of SQABo, i.e.,
how representative are the final embeddings of the target nodes (answers), we use Average
Percentile Rank (APR). We calculate APR for each query by getting the average percentile rank
of the correct answer among all negative answers based on the prediction of the model:
APR = CF − (0.5 *  )

where CF (cumulative frequency) is the count of all scores less than or equal to the score of
interest and  is the frequency for the score of interest.</p>
      <p>Mai et al. utilize, also, the AUC (Area Under Roc Curve) but since APR uses all negative
samples for each query, as opposed to the AUC, which uses only one negative sample per query,
we consider APR a more robust evaluation metric, and hence we omit AUC.
Main Results. The evaluation results of SQABo against SE-KGE are presented in Table 2.
We compare the two models with two experiments per model (one for each KG) plus one for
the original SE-KGE with all of its data as a reference point (illustrated in the first row of
the table). For the case of DBGeo , for every single query structure, except for 2-inter (where
SE-KGE outperformed SQABo only by 1.15%), SQABo demonstrates better APR, resulting in
an APR score diference of 4.5%, when macro averaged. The results for YAGO2geo were even
better, with SQABo being better in every query structure and having a macro averaged APR
score diference of 5.6%. It is worth noting that, for 3-chain queries over DBGeo , SQABo
outperformed SE-KGE by 13.46%. While the maximum diference between the two models for
YAGO2geo KG was in 3-inter queries, by 8.72%.</p>
      <p>To analyse the influence of the contextual graph attention mechanism used for the intersection
of the center of the boxes, we replaced it with simple attention, which is used by Ren et al.
[11]. As it is shown in Table 2, the resulting model, SQABo-noGA still performed better than
SE-KGE with an average APR of 89.29%, but worse than the model with contextual graph
attention showing the importance of its use.</p>
    </sec>
    <sec id="sec-6">
      <title>6. Conclusions and Future Work</title>
      <p>We presented and evaluated the novel embedding-based geospatial query answering model
SQABo. SQABo encodes the geospatial and non-geospatial features of the entities and relations
appearing in any incoming conjunctive graph query. Then, these encodings are gradually
projected into boxes. The answer to an input conjunctive graph query is computed by intersecting
these boxes using graph attention [12] and returning the entities inside the boxes. Experimental
results on two geospatial KGs demonstrate that SQABo outperforms existing related work.</p>
      <p>In future work, we plan to increase the accuracy of our results by employing geospatial
encoding techniques that appeared very recently in the literature [32, 33]. We, also, plan to
extend the expressivity of the queries that SQABo can support to cover disjunction [11] and
negation [8]. Finally, we plan to extend this work to support questions expressed in natural
language by translating them to formal queries, utilizing our previous work [34].</p>
    </sec>
    <sec id="sec-7">
      <title>Acknowledgments</title>
      <p>This work was supported by the European Union’s Horizon 2020 R&amp;I programme under the
Marie Skłodowska-Curie GA (No 101032307), by the First Call for H.F.R.I. Research Projects to
support Faculty members and Researchers and the procurement of high-cost research equipment
grant (Pr. No: HFRI-FM17-2351), by ESA project DA4DTE (contract no. 4000139212/22/I-EF).
[7] B. Regalia, K. Janowicz, G. McKenzie, Computing and querying strict,
approximate, and metrically refined topological relations in linked geographic data,
Transactions in GIS 23 (2019) 601–619. URL: https://onlinelibrary.wiley.com/
doi/abs/10.1111/tgis.12548. doi:https://doi.org/10.1111/tgis.12548.
arXiv:https://onlinelibrary.wiley.com/doi/pdf/10.1111/tgis.12548.
[8] D. Wang, Y. Chen, B. Cuenca Grau, Eficient embeddings of logical variables for query
answering over incomplete knowledge graphs (2022).
[9] F. Li, M. Chen, R. Dong, Multi-hop question answering with knowledge graph embedding
in a similar semantic space, in: 2022 International Joint Conference on Neural Networks
(IJCNN), IEEE, 2022, pp. 01–07.
[10] G. Mai, K. Janowicz, L. Cai, R. Zhu, B. Regalia, B. Yan, M. Shi, N. Lao, Se-kge: A
locationaware knowledge graph embedding model for geographic question answering and spatial
semantic lifting, Transactions in GIS 24 (2020) 623–655.
[11] H. Ren, W. Hu, J. Leskovec, Query2box: Reasoning over knowledge graphs in vector space
using box embeddings, in: 8th International Conference on Learning Representations,
ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020, OpenReview.net, 2020. URL: https:
//openreview.net/forum?id=BJgr4kSFDS.
[12] G. Mai, K. Janowicz, B. Yan, R. Zhu, L. Cai, N. Lao, Contextual graph attention for
answering logical queries over incomplete knowledge graphs, in: Proceedings of the 10th
International Conference on Knowledge Capture, 2019, pp. 171–178.
[13] N. Karalis, G. Mandilaras, M. Koubarakis, Extending the yago2 knowledge graph with
precise geospatial knowledge, in: C. Ghidini, O. Hartig, M. Maleshkova, V. Svátek, I. Cruz,
A. Hogan, J. Song, M. Lefrançois, F. Gandon (Eds.), The Semantic Web – ISWC 2019,
Springer International Publishing, Cham, 2019, pp. 181–197.
[14] P. A. Longley, M. F. Goodchild, D. J. Maguire, D. W. Rhind, Geographic Information Science
and Systems, 4th edition, John Wiley and Sons, 2015.
[15] W. Hamilton, P. Bajaj, M. Zitnik, D. Jurafsky, J. Leskovec, Embedding logical queries on
knowledge graphs, Advances in neural information processing systems 31 (2018).
[16] A. Bordes, N. Usunier, A. Garcia-Duran, J. Weston, O. Yakhnenko, Translating embeddings
for modeling multi-relational data, Advances in neural information processing systems 26
(2013).
[17] Z. Wang, J. Zhang, J. Feng, Z. Chen, Knowledge graph embedding by translating on
hyperplanes, in: Proceedings of the AAAI Conference on Artificial Intelligence, volume 28,
2014.
[18] M. Nickel, V. Tresp, H.-P. Kriegel, Factorizing yago: scalable machine learning for linked
data, in: Proceedings of the 21st international conference on World Wide Web, 2012, pp.
271–280.
[19] T. Trouillon, J. Welbl, S. Riedel, E. Gaussier, G. Bouchard, Complex embeddings for
simple link prediction, in: M. F. Balcan, K. Q. Weinberger (Eds.), Proceedings of The
33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine
Learning Research, PMLR, New York, New York, USA, 2016, pp. 2071–2080. URL: https:
//proceedings.mlr.press/v48/trouillon16.html.
[20] T. N. Kipf, M. Welling, Semi-supervised classification with graph convolutional networks,
in: 5th International Conference on Learning Representations, ICLR 2017, Toulon, France,
April 24-26, 2017, Conference Track Proceedings, OpenReview.net, 2017. URL: https:
//openreview.net/forum?id=SJU4ayYgl.
[21] M. Schlichtkrull, T. N. Kipf, P. Bloem, R. v. d. Berg, I. Titov, M. Welling, Modeling relational
data with graph convolutional networks, in: European semantic web conference, Springer,
2018, pp. 593–607.
[22] L. Cai, B. Yan, G. Mai, K. Janowicz, R. Zhu, Transgcn: Coupling transformation assumptions
with graph convolutional networks for link prediction, in: Proceedings of the 10th
International Conference on Knowledge Capture, 2019, pp. 131–138.
[23] Q. Wang, Z. Mao, B. Wang, L. Guo, Knowledge graph embedding: A survey of approaches
and applications, IEEE Transactions on Knowledge and Data Engineering 29 (2017) 2724–
2743. doi:10.1109/TKDE.2017.2754499.
[24] S. Choudhary, T. Luthra, A. Mittal, R. Singh, A survey of knowledge graph embedding
and their applications, CoRR abs/2107.07842 (2021). URL: https://arxiv.org/abs/2107.07842.
arXiv:2107.07842.
[25] A. Rossi, D. Barbosa, D. Firmani, A. Matinata, P. Merialdo, Knowledge graph embedding
for link prediction: A comparative analysis, ACM Trans. Knowl. Discov. Data 15 (2021).</p>
      <p>URL: https://doi.org/10.1145/3424672. doi:10.1145/3424672.
[26] E. Arakelyan, D. Daza, P. Minervini, M. Cochez, Complex query answering with neural
link predictors, in: International Conference on Learning Representations, 2021. URL:
https://openreview.net/forum?id=Mos9F9kDwkz.
[27] Y. Wang, H. Zhang, H. Xie, Geography-enhanced link prediction framework for knowledge
graph completion, in: Knowledge Graph and Semantic Computing: Knowledge Computing
and Language Understanding: 4th China Conference, CCKS 2019, Hangzhou, China,
August 24–27, 2019, Revised Selected Papers 4, Springer, 2019, pp. 198–210.
[28] P. Qiu, J. Gao, L. Yu, F. Lu, Knowledge embedding with geospatial distance restriction for
geographic knowledge graph completion, ISPRS International Journal of Geo-Information
8 (2019). URL: https://www.mdpi.com/2220-9964/8/6/254. doi:10.3390/ijgi8060254.
[29] G. Mai, B. Yan, K. Janowicz, R. Zhu, Relaxing unanswerable geographic questions using
a spatially explicit knowledge graph embedding model, in: P. Kyriakidis, D.
Hadjimitsis, D. Skarlatos, A. Mansourian (Eds.), Geospatial Technologies for Local and Regional
Development, Springer International Publishing, Cham, 2020, pp. 21–39.
[30] G. Mai, K. Janowicz, B. Yan, R. Zhu, L. Cai, N. Lao, Multi-scale representation learning for
spatial feature distributions using grid cells, in: 8th International Conference on Learning
Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020, OpenReview.net,
2020. URL: https://openreview.net/forum?id=rJljdh4KDH.
[31] M. Zaheer, S. Kottur, S. Ravanbakhsh, B. Poczos, R. Salakhutdinov, A. Smola, Deep sets,
2017. URL: https://arxiv.org/abs/1703.06114. doi:10.48550/ARXIV.1703.06114.
[32] G. Mai, C. Jiang, W. Sun, R. Zhu, Y. Xuan, L. Cai, K. Janowicz, S. Ermon, N. Lao, Towards
general-purpose representation learning of polygonal geometries, 2022. URL: https://arxiv.
org/abs/2209.15458. doi:10.48550/ARXIV.2209.15458.
[33] G. Mai, Y. Xuan, W. Zuo, K. Janowicz, N. Lao, Sphere2vec: Multi-scale representation
learning over a spherical surface for geospatial predictions, 2022. URL: https://arxiv.org/
abs/2201.10489. doi:10.48550/ARXIV.2201.10489.
[34] D. Punjani, E. Tsalapati, Question Answering Engines for Geospatial Knowledge Graphs, 1
ed., Association for Computing Machinery, New York, NY, USA, 2023, p. 257–282. URL:
https://doi.org/10.1145/3581906.3581922.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>N.</given-names>
            <surname>Karalis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. M.</given-names>
            <surname>Mandilaras</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Koubarakis, Extending the YAGO2 knowledge graph with precise geospatial knowledge</article-title>
          , in: C.
          <string-name>
            <surname>Ghidini</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          <string-name>
            <surname>Hartig</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Maleshkova</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          <string-name>
            <surname>Svátek</surname>
            ,
            <given-names>I. F.</given-names>
          </string-name>
          <string-name>
            <surname>Cruz</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Hogan</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Song</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Lefrançois</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Gandon</surname>
          </string-name>
          (Eds.),
          <source>The Semantic Web - ISWC 2019 - 18th International Semantic Web Conference</source>
          , Auckland, New Zealand,
          <source>October 26-30</source>
          ,
          <year>2019</year>
          , Proceedings,
          <string-name>
            <surname>Part</surname>
            <given-names>II</given-names>
          </string-name>
          , volume
          <volume>11779</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2019</year>
          , pp.
          <fpage>181</fpage>
          -
          <lpage>197</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>030</fpage>
          -30796-7_
          <fpage>12</fpage>
          . doi:
          <volume>10</volume>
          .1007/ 978-3-
          <fpage>030</fpage>
          -30796-7\_
          <fpage>12</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Dsouza</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Tempelmeier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Yu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Gottschalk</surname>
          </string-name>
          , E. Demidova,
          <article-title>WorldKG: A world-scale geographic knowledge graph</article-title>
          ,
          <source>in: CIKM '21: The 30th ACM International Conference on Information and Knowledge Management</source>
          , Virtual Event, Queensland, Australia, November 1 -
          <issue>5</issue>
          ,
          <year>2021</year>
          , ACM,
          <year>2021</year>
          , pp.
          <fpage>4475</fpage>
          -
          <lpage>4484</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>K.</given-names>
            <surname>Janowicz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Hitzler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Rehberger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Schildhauer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Zhu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Shimizu</surname>
          </string-name>
          , C. K. Fisher, L. Cai, G. Mai,
          <string-name>
            <given-names>J.</given-names>
            <surname>Zalewski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Zhou</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Stephen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. G.</given-names>
            <surname>Estrecha</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. D.</given-names>
            <surname>Mecum</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Lopez-Carr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Schroeder</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Smith</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. J.</given-names>
            <surname>Wright</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Tian</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Shi</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. D'Onofrio</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          <string-name>
            <surname>Gu</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          <string-name>
            <surname>Currier</surname>
          </string-name>
          ,
          <article-title>Know, know where, knowwheregraph: A densely connected, cross-domain knowledge graph and geo-enrichment service stack for applications in environmental intelligence</article-title>
          ,
          <source>AI Mag</source>
          .
          <volume>43</volume>
          (
          <year>2022</year>
          )
          <fpage>30</fpage>
          -
          <lpage>39</lpage>
          . URL: https://doi.org/10.1609/aimag.v43i1.19120. doi:
          <volume>10</volume>
          .1609/aimag.v43i1.
          <fpage>19120</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Matthew</given-names>
            <surname>Perry</surname>
          </string-name>
          , John Herring,
          <string-name>
            <surname>OGC GeoSPARQL - A Geographic Query</surname>
          </string-name>
          <article-title>Language for RDF Data, OGC Implementation Standard OGC 11-052r4</article-title>
          , Open Geospatial Consortium,
          <year>2012</year>
          . URL: http://www.opengis.net/doc/IS/geosparql/1.0.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>K.</given-names>
            <surname>Kyzirakos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Karpathiotakis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Koubarakis</surname>
          </string-name>
          ,
          <article-title>Strabon: A semantic geospatial DBMS</article-title>
          , in: P.
          <string-name>
            <surname>Cudré-Mauroux</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Heflin</surname>
            , E. Sirin,
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Tudorache</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Euzenat</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Hauswirth</surname>
            ,
            <given-names>J. X.</given-names>
          </string-name>
          <string-name>
            <surname>Parreira</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Hendler</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <string-name>
            <surname>Schreiber</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Bernstein</surname>
          </string-name>
          , E. Blomqvist (Eds.),
          <source>The Semantic Web - ISWC 2012 - 11th International Semantic Web Conference</source>
          , Boston, MA, USA, November
          <volume>11</volume>
          -
          <issue>15</issue>
          ,
          <year>2012</year>
          , Proceedings,
          <string-name>
            <surname>Part</surname>
            <given-names>I</given-names>
          </string-name>
          , volume
          <volume>7649</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2012</year>
          , pp.
          <fpage>295</fpage>
          -
          <lpage>311</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>642</fpage>
          -35176-1_
          <fpage>19</fpage>
          . doi:
          <volume>10</volume>
          .1007/ 978-3-
          <fpage>642</fpage>
          -35176-1\_
          <fpage>19</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>D.</given-names>
            <surname>Bilidas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Ioannidis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Mamoulis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Koubarakis</surname>
          </string-name>
          ,
          <article-title>Strabo 2: Distributed management of massive geospatial rdf datasets</article-title>
          , Springer-Verlag, Berlin, Heidelberg,
          <year>2022</year>
          , p.
          <fpage>411</fpage>
          -
          <lpage>427</lpage>
          . URL: https://doi.org/10.1007/978-3-
          <fpage>031</fpage>
          -19433-7_
          <fpage>24</fpage>
          . doi:
          <volume>10</volume>
          .1007/978-3-
          <fpage>031</fpage>
          -19433-7_
          <fpage>24</fpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>