An Efficient Engine for Processing Top-K SPARQL Queries with Spatial

An Efficient Engine for Processing Top-K SPARQL Queries with Spatial

STREAK: An Efficient Engine for Processing kTop- SPARQL Queries with Spatial Filters Jyoti Leeka Srikanta Bedathur IIIT Delhi IBM Research New Delhi, Delhi, India New Delhi, Delhi, India [email protected] [email protected] Debajyoti Bera Sriram Lakshminarasimhan y IIIT Delhi IBM Research New Delhi, Delhi, India New Delhi, Delhi, India [email protected] [email protected] ABSTRACT Furthermore, modern knowledge bases contain not only sim- The importance of geo-spatial data in critical applications such as ple (binary) relationships between entities, but also model higher- emergency response, transportation, agriculture etc., has prompted order information such as uncertainty, context, strength of rela- the adoption of recent GeoSPARQL standard in many RDF pro- tionships, and more. Querying such knowledge bases results in cessing engines. In addition to large repositories of geo-spatial complex workloads involving user-defined ad-hoc ranking, with data –e.g., LinkedGeoData, OpenStreetMap, etc.– spatial data is top-k result cut-offs to help in reasoning under uncertainty and also routinely found in automatically constructed knowledge- to reduce the resulting overload. Thus the geo-spatial support is bases such as Yago and WikiData. While there have been research not just limited to efficient implementation of spatial operators efforts for efficient processing of spatial data in RDF/SPARQL, that works well with SPARQL graph pattern queries, but also very little effort has gone into building end-to-end systems that should integrate with top-k early termination too. can holistically handle complex SPARQL queries along with spa- We present Streak, an efficient SPARQL query processing tial filters. system that can model higher-order facts, support the modeling In this paper, we present Streak, a RDF data management of geo-spatial objects and queries over them, enable efficient com- system that is designed to support a wide-range of queries with bined querying of graph pattern queries with spatial operators, spatial filters including complex joins,k top- , higher-order rela- expressed in the form of a filter, along with top-k requirements tionships over spatially enriched databases. Streak introduces over arbitrary user-defined ranking functions, expressed in the various novel features such as a careful identifier encoding strat- order by — limit clauses. In this paper, we focus our attention egy for spatial and non-spatial entities, the use of a semantics- on a recently proposed top-k spatial distance join (K-SDJ) [32], aware Quad-tree index that allows for early-termination and a although other spatial operators are also possible within Streak. clever use of adaptive query processing with zero plan-switch Following are a few applications of such distance join queries cost. We show that Streak can scale to some of the largest within the context of RDF databases from the GeoCLEF 2006- publicly available semantic data resources such as Yago3 and 07 [25]: LinkedGeoData which contain spatial entities and quantifiable (i) Find top wine producing regions around rivers in Europe predicates useful for result ranking. For experimental evalua- (ii) List car bombings near Madrid and rank them by estimated tions, we focus on top-k distance join queries and demonstrate casualties that Streak outperforms popular spatial join algorithms as well (iii) Find places near a flooded place which have low rates of as state of the art end-to-end systems like Virtuoso and Post- house insurance. greSQL. Similarly, distance join queries over graph structured data can also be formulated in many diverse scenarios – e.g., in a job search system one can ask for top jobs with highest wage which match 1 INTRODUCTION the skills and are near the location of a given candidate, which can Motivated by its use in critical applications such as emergency be expressed as a SPARQL query with a spatial distance filter arXiv:1710.07411v1 [cs.DB] 20 Oct 2017 response, transportation, agriculture etc., geo-spatial data are and top-k ranking on highest wage. part of many large-scale semantic web resources. Efforts to stan- dardise the representation of geo-spatial data and relationships 1.1 Challenge between spatial objects within RDF/SPARQL has resulted in A large-body of work exists in relational database research for GeoSPARQL standard [9], adopted by many RDF data reposi- integrating geo-spatial and top-k early termination operators tories such as LinkedGeoData [2], GeoKnow [20], etc. Even the within generic query processing framework. Therefore, a natural large-scale open-domain knowledge-bases such as Yago [13, 24], question to ask is whether those methods can be applied in a WikiData [38], and DBPedia [19] contain significant amounts of straightforward manner for RDF/SPARQL as well. Unfortunately, spatial data. To make effective use of this rich data, it is crucial as we delineate below, the answer to this question is in the neg- to efficiently evaluate queries combining topological and spatial ative, primarily due to the schema-less nature of RDF data and operators –e.g., overlap, distance, etc.– with traditional graph the self-join heavy plans resulting from SPARQL queries. pattern queries of SPARQL. Consider applying one of the popular techniques, which build indexes over joining (spatial) tables during an offline/pre-processing ynow at Google, India. phase [30]. However, in RDF data, there is only one large triples @prefix xsd: <http://www.w3.org/2001/XMLSchema#>. table, resulting in a single large spatial index that needs to be #@ <id1> used during many self-joins making it extremely inefficient. On :Mosel :grapeVariety :Albalonga. #@ <id2> the other hand, storing RDF in a property-table form is also im- :Mosel :soilType :porus_slate. #@ <id3> practical due to a large number of property-tables – e.g., in a :Mosel :hasProduction "4500000000"^^xsd:double. #@ <id4> real-world dataset like BTC (Billion Triples Challenge) [8], there :Mosel :hasGeometry "POINT(28.6,77.2)". #@ <id4> are 484; 586 logical tables [26]. :Moselle :pollutedBy :pesticide. Next, the unsorted ordering (w.r.t. the scoring function) of #@ <id5> <id4> :includes ?pest. spatial attributes during top-k processing prevents the straight- #@ <id6> ?pest :concentration ?c. forward application of methods that encode spatial entities to #@ <id7> :Moselle :hasMouth :Rhine. speed up spatial-joins [21]. This is because these approaches #@ <id8> assume sorted order of spatial attributes, and hence are able to :Moselle :source :Vosges_mountains. #@ <id8> choose efficient merge joins as much as possible. Finally, state- :Moselle :hasGeometry "LINESTRING((28.3,77.5),(28.4,77.6))". of-the-art query optimization techniques for top-k queries [14] cannot be adopted as-is for spatial top-k since real-world spatial Figure 1: Example RDF knowledge graph: Describes pollu- data does not follow uniform distribution assumptions that are tion in wine growing regions of Europe. used during query optimization. 1.2 Contributions datasets and queries used in our evaluation in Section 4. De- In this paper, we present the design of the Streak system, and tailed experimental results are given in Section 5 followed by make following key contributions: an overview of related work in Section 6 before concluding in (1) We present a novel soft-schema aware, spatial index called Section 7. S-QuadTree. It not only partitions the 2-d space to speed spatial operator evaluation, it compactly stores the inherent soft-schema 2 PRELIMINARIES captured using characteristic sets. Experimental evaluations show that the use of S-QuadTree results up to three orders of magni- RDF consists of triples, where each triple represents relationship tude improvements over using state-of-the-art spatial indexes for between subject(s) and object(o), with name of the relationship many benchmark queries. being predicate(p). SPARQL is the standard query language for (2) We introduce a new spatial join algorithm, that utilizes RDF [12] and we consider SPARQL queries having the following the soft-schema stored in S-QuadTree to select optimal set of structure: nodes in S-QuadTree. The spatial objects enclosed/overlapping SELECT [projection clause] the 2-d partitions of these nodes are used for pruning the search WHERE [graph pattern] space during spatial joins. FILTER [spatial distance function] ORDERBY [ranking function] (3) We propose an adaptive query plan generation algorithm LIMIT [top-K results] called Adaptive Processing for Spatial filters (APS), that switches with very low plan-switching overhead, to select between alter- The SELECT clause retrieves results consisting of variables (de- nate query plans, based on a novel spatial join cost model. noted by “?" prefix) and their bindings (for details see Figure1). We implement these features within Quark-X [18], a top-k Graph patterns in WHERE clause (also called triple patterns) are SPARQL processing system based on RDF-3X [27, 28], result- expressed as: h?s ?p ?oi, h?r rdf:subject ?s. ?r rdf:predicate ?p. ?r ing in a holistic system capable of efficiently handling spatial rdf:object ?oi, where ?r represents fact or reification identifier. joins. For experimental evaluation, we make use of two large real- Keyword prefix rdf is part of the RDF vocabulary and helps de- world datasets — (a) Yago [13, 24], and (b) LinkedGeoData [2]. clare parts of an RDF statement identified through its identifier Benchmark queries were focused on K-SDJ queries, and were a ?r. combination of subset of queries from GeoCLEF [25] challenge Next, the FILTER clause restricts solutions to those that satisfy and queries we constructed using query features found impor- the spatial predicates. In this paper, we focus only on the use of tant in literature [1, 18, 21]. We compare the performance of DISTANCE predicate for distance joins. It should be noted that Streak with the system obtained by replacing our S-QuadTree the techniques discussed in this paper are equally applicable to all based spatial join by synchronous R-tree traversal spatial join spatial predicates defined in GeoSPARQL standard by the Open algorithm [6]; and test end-to-end system performance against Geospatial Consortium [4].

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    16 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us