<!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>The LSQ Dataset: Querying for Queries</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Muhammad Saleem</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Intizar Ali</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Aidan Hogan</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Qaiser Mehmood</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Axel-Cyrille Ngonga Ngomo</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, Universidad de Chile</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Insight Center for Data Analytics, National University of Ireland</institution>
          ,
          <addr-line>Galway</addr-line>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Universita ̈t Leipzig, IFI/AKSW</institution>
          ,
          <addr-line>PO 100920, D-04009 Leipzig</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>With this poster, we will present the Linked SPARQL Query (LSQ) dataset, which describes SPARQL queries taken from the logs of public endpoints. We introduce the initial four query logs that we have taken and the extraction process applied: the types of meta-data captured, how the data are modelled, what vocabularies we use, etc. The LSQ dataset currently contains 73 million triples describing 5.7 million query executions and is publicly available as Linked Data and through a SPARQL endpoint. We believe that by providing insights on how SPARQL is used in practice, the LSQ dataset could benefit areas of SPARQL research, including caching, benchmarking, usability, optimisations, etc.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Public SPARQL endpoints collectively expose billions of facts and receive millions of
queries per month. However, the maturity of SPARQL technology is still questionable:
many endpoints have been found to suffer from service availability problems, or to
exhibit non-standard behaviour such as silently returning partial results [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Evaluating
SPARQL queries is computationally expensive for servers; in fact, it is known to be
intractable [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Hence, general guarantees of efficiency cannot be made and hence, it is
crucial to understand how SPARQL 1.1 is being used in practice, and to try to focus on
those research questions with the highest potential for impact on real users, e.g., to look
at what types of features, joins, etc., are most commonly used; what combinations lead to
the slowest runtimes; why that is; and whether or not optimisations are possible for these
common problematic cases. Research topics such as usability, caching, benchmarking,
etc., could also benefit from having more information about how SPARQL is being used
in practice and what sorts of workloads current SPARQL endpoints face.
      </p>
      <p>
        To understand trends in how SPARQL is used in practice, perhaps the best place
to look is the logs of various public SPARQL endpoints. The first such initiative along
these lines was the USEWOD collection, which made a variety of such logs available [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
However, these datasets are only accessible after having signed legal agreements,
meaning that researchers and other interested parties are limited in their reuse of the data.
Also, the format of the logs is ad-hoc, depending on their source.
      </p>
      <p>
        In this poster,4 we present the Linked SPARQL Query Log Dataset (LSQ). LSQ is a
public Linked Dataset of SPARQL queries extracted from endpoint logs. The current
4 This poster accompanies the accepted dataset paper [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
lsqv:Star
lsqv:Ask
lsqv:Hybrid
lsqv:Sink
xsd:dateTimeStamp dct: http://purl.org/dc/terms/
lsqv: http://lsq.aksw.org/vocab#
sd: http://www.w3.org/ns/sparql-service-description#
lsqv:agent dct:issued sp: http://spinrdf.org/sp#
sd:endpoint
lsqv:mentionsSubject
lsqv:mentionsPredicate
lsqv:mentionsObject
lsqv:Execution
lsqv:execution
lsqv:executionError
      </p>
      <p>sp:text
lsqv:parseError</p>
      <p>lsqv:meanJoinVertexDegree
lsqv:meanTriplePatternSelectivity
xsd:string
sp:Select</p>
      <p>sp:Ask
sp:Describe
sp:Construct
xsd:decimal
lsqv:JoinVertex
lsqv:joinVertex</p>
      <p>sp:Query
lsqv:joinVertexDegree lsqv:resultSize
lsqv:runTimeMs</p>
      <p>lsqv:bgps
lsqv:triplePatterns
xsd:long lsqv:joinVertices
lsqv:usesFeature</p>
      <p>sd:Feature
version consists of 73.2 million triples collected from four query logs for which we have
obtained permission from the respective maintainers to make their content public. The
LSQ dataset is available from http://aksw.github.io/LSQ/.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Data Model</title>
      <p>
        Figure 1 summarises the LSQ data model, which reuses existing vocabularies where
possible, combined with a custom LSQ vocabulary for new terms. The central class is
sp:Query, where instances are typed as one of the subclasses: sp:Select, sp:Ask,
sp:Describe, sp:Construct. We consider a query as unique to a log and potentially
having multiple instances of lsqv:Execution (for each time the query was run) with a
timestamp and a link to the agent who issued the request (identified using an encrypted
IP). Query instances are linked to the query text (using sp:text) and to the originating
endpoint (using lsqv:endpoint). To help make the dataset as general as possible, we
also attach a complete SPIN representation of the query to each query instance [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>Given that the SPIN representation may involve deep nesting, to make querying
LSQ more convenient and efficient, we provide shortcut triples to indicate the SPARQL
query features used in each query. These triples link query instances (with the predicate
lsqv:usesFeature) to instances of sd:Feature. We enumerate a comprehensive list
of such feature instances in our vocabulary, including lsqv:Filter, lsqv:Optional,
lsqv:SubQuery, etc. We also provide shortcuts to the IRIs mentioned in a query with
lsqv:mentionsSubject, lsqv:mentionsPredicate and lsqv:mentionsObject,
making it easy to find queries mentioning a given resource.</p>
      <p>
        In addition to the query structure, we also provide generic structural statistics [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
about the static query including the number of Basic Graph Patterns (lsqv:bgps) and
the number of triple patterns (lsqv:triplePatterns). We also provide data-driven
statistics [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] (incl. the number of results returned and the query runtime) about the
execution of the query. Since such data are not typically provided by the logs, we
generate these statistics by running the query locally against an offline copy of the
corresponding version of the dataset in question. Of course, the resulting statistics may
differ to those that occurred during the original execution logged by the public endpoint
and are rather intended as a guide (i.e., they are simply provided “as is”).
      </p>
      <p>With respect to Linked Data compatibility, we ensure that all query instances and
executions are identified with dereferenceable URIs. Our data model also re-uses class
and property terms from established external vocabularies, including SPIN, DC Terms
and SPARQL Service Descriptions. Finally, with respect to external links, LSQ provides
links to every URI mentioned in a query. We also provide a public SPARQL endpoint.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Current Query Logs</title>
      <p>The current version of LSQ consists of queries extracted from four query logs as follows
(see Table 1 for the corresponding statistics):
DBpedia is a broad encyclopaediac knowledge-base extracted from Wikipedia. A
SPARQL endpoint is available at http://dbpedia.org/sparql powered by a
Virtuoso instance. The DBpedia query log we have currently obtained spans from
April 30, 2010 to July 20, 2010 (these queries refer to DBpedia v.3.5.1). The log
records over 1.7 million query executions.</p>
      <p>Linked Geo Data (LGD) contains a collection of spatial Linked Datasets that have
been extracted from Open Street Map. The data are accessible via a public SPARQL
endpoint at http://linkedgeodata.org/sparql, which uses Virtuoso as a
backend. The Linked Geo Data (LGD) query log spans from November 24, 2010 to July
6, 2011. The log records over 1.6 million query executions.</p>
      <p>Semantic Web Dog Food (SWDF) is a community effort to generate a Linked Dataset
about papers, presentations and people participating in top Semantic Web related
conferences and workshops. The dataset is accessible through a SPARQL endpoint
at http://data.semanticweb.org/sparql through a Sesame interface. The
Semantic Web Dog Food (SWDF) log spans from May 16, 2014 to November 12,
2014 and records over 1.4 million query executions.</p>
      <p>British Museum (BM) provides a Linked Data representation of an online collection
containing records of more than 3 million artefacts. A SPARQL endpoint is
accessible at http://collection.britishmuseum.org/sparql with an
OWLIM/GraphDB back-end. The log we have acquired spans from November 8, 2014 to
December 1, 2014 and contains over 800 thousand query executions.</p>
      <p>
        For potential consumers of LSQ, it is important to note that a high percentage of the
millions of query executions recorded came from a small number of high-volume agents.
Our goal with LSQ is to make details of the queries and their executions available “as
is”. Dealing with the issue of “agent skew” depends on what LSQ is to be used for, and
thus is at the discretion of the LSQ consumer, who may wish to use data provided about
agents and timestamps to, e.g., pre-filter the data. We refer to [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] for more details.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Poster Discussion</title>
      <p>The current version of LSQ comprises 73 millions triples describing 5.7 million query
executions from the four query logs introduced earlier. In the medium term, our plan
DATASET
DBpedia
LGD
SWDF
BM
232,536,510
1,032,026,569</p>
      <p>294,870
1,359,400
18,425,128
238,509,864
30,856
483,877
is to grow this dataset to include further logs, and thus we would like to use the poster
session to discuss with endpoint maintainers the possibility of including their logs in
the dataset. We would also be interested to discuss with SPARQL engine vendors the
possibility of offering the option to produce logs directly in the LSQ format.</p>
      <p>We would also like to speak with researchers working on SPARQL about the possible
ways in which the LSQ dataset could benefit their work. We believe that LSQ could have
applications to design benchmarks that better reflect the use of SPARQL in practice,
to identify which SPARQL features (or combinations thereof) are most in need of
optimisation, to empirically validate works on caching (by looking at sequences of
query executions based on timestamps, or at the skew in terms of demand for data about
popular resources), to inspire new research on usability or query relaxation (looking at
how users behave: what mistakes they make, how they refine queries, etc.). We would
also like to discuss with the community their ideas for what sorts of research questions
or applications they might have in mind for the LSQ dataset, which may influence its
design and provision, or may lead us to design new interfaces over the dataset.</p>
      <p>In summary, by offering feedback on how SPARQL is used in practice, we believe
that the LSQ dataset has the potential to help guide the development of resilient and
reliable SPARQL systems operating under realistic work loads.</p>
      <p>ACKNOWLEDGEMENTS: This work was supported in part by the German Ministry for Finances
and Energy under the SAKE project (Grant No. 01MD15006E), by Science Foundation Ireland
(SFI) under Grant No. SFI/12/RC/2289, by the Millennium Nucleus Center for Semantic Web
Research under Grant No. NC120004 and by Fondecyt Grant No. 11140900.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>G.</given-names>
            <surname>Aluc¸</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Hartig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. T.</given-names>
            <surname>Ozsu</surname>
          </string-name>
          , and
          <string-name>
            <given-names>K.</given-names>
            <surname>Daudjee</surname>
          </string-name>
          .
          <article-title>Diversified stress testing of RDF data management systems</article-title>
          .
          <source>In ISWC</source>
          , pages
          <fpage>197</fpage>
          -
          <lpage>212</lpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>C. B. Aranda</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Hogan</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Umbrich</surname>
            , and
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Vandenbussche</surname>
          </string-name>
          .
          <article-title>SPARQL web-querying infrastructure: Ready for action? In ISWC</article-title>
          , pages
          <fpage>277</fpage>
          -
          <lpage>293</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>B.</given-names>
            <surname>Berendt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Hollink</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Hollink</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Luczak-Ro¨sch, K</article-title>
          . Mo¨ller, and
          <string-name>
            <given-names>D.</given-names>
            <surname>Vallet</surname>
          </string-name>
          .
          <article-title>Usage analysis and the web of data</article-title>
          .
          <source>SIGIR Forum</source>
          ,
          <volume>45</volume>
          (
          <issue>1</issue>
          ):
          <fpage>63</fpage>
          -
          <lpage>69</lpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>H.</given-names>
            <surname>Knublauch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. A.</given-names>
            <surname>Hendler</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          K. Idehen, editors.
          <source>SPIN - Overview and Motivation. W3C Member Submission, 22 February</source>
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. J. Pe´rez, M. Arenas, and
          <string-name>
            <given-names>C.</given-names>
            <surname>Gutierrez</surname>
          </string-name>
          .
          <article-title>Semantics and complexity of SPARQL</article-title>
          .
          <source>ACM TODS</source>
          ,
          <volume>34</volume>
          (
          <issue>3</issue>
          ),
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>M.</given-names>
            <surname>Saleem</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Ali</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hogan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Mehmood</surname>
          </string-name>
          , and A.
          <string-name>
            <surname>-C. Ngonga</surname>
          </string-name>
          <article-title>Ngomo. LSQ: The Linked SPARQL Queries dataset</article-title>
          .
          <source>In ISWC</source>
          ,
          <year>2015</year>
          . (to appear).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>