<!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>Joint Conference (March</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Speeding up RDF aggregate discovery through sampling</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ioana Manolescu</string-name>
          <email>ioana.manolescu@inria.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mirjana Mazuran∗</string-name>
          <email>mirjana.mazuran@inria.fr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Inria and LIX (UMR 7161 and Ecole polytechnique)</institution>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2019</year>
      </pub-date>
      <volume>26</volume>
      <issue>2019</issue>
      <abstract>
        <p>RDF graphs can be large and complex; finding out interesting information within them is challenging. One easy method for users to discover such graphs is to be shown interesting aggregates (under the form of two-dimensional graphs, i.e., bar charts), where interestingness is evaluated through statistics criteria. Dagger [5] pioneered this approach, however its is quite ineficient, in particular due to the need to evaluate numerous, expensive aggregation queries. In this work, we describe Dagger+, which builds upon Dagger and leverages sampling to speed up the evaluation of potentially interesting aggregates. We show that Dagger+ achieves very significant execution time reductions, while reaching results very close to those of the original, less eficient system.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>INTRODUCTION</title>
      <p>∗M. Mazuran is supported by the H2020 research program under grant nr. 800192.</p>
    </sec>
    <sec id="sec-2">
      <title>2 STATE OF THE ART</title>
      <p>
        The problem of data exploration [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] has received much
attention; the automatic extraction of interesting aggregates is just
one among many proposed techniques. Multidimensional data
is particularly interesting in this respect, however, most works
assume a fixed relational schema, which is not available for RDF
graphs. More recent works [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], consider graphs, but (unlike
Dagger) assume a very regular and simple structure.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] the authors show how to automatically extract the top-k
insights from multi-dimensional relational data, with fixed
dimensions and measures. An insight is an observation derived
from aggregation in multiple steps; it is considered interesting
when it is remarkably diferent from others, or it exhibits a
rising or falling trend. SeeDB [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] recommends visualizations in
high-dimensional relational data by means of a phased execution
framework. The focus is to detect the visualizations with a large
deviation with respect to a reference (e.g. another dataset,
historical data or the rest of the data) from a database with a snowflake
schema. In [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], multi-structural databases are proposed; their
schema (i.e. possible dimensions) is known and three analytical
operations are defined to: ( i) determine how data is distributed
across a particular set of dimensions, (ii) compare two sets of
data with respect to given dimensions and (iii) separate the data
into cohesive groups with respect to the known dimensions.
      </p>
      <p>In contrast, Dagger (and Dagger+) start directly from RDF, and,
lacking schema information, automatically derives dimensions
and measures that are good candidates to produce insights.</p>
      <p>
        There is no universally accepted definition of interestingness;
frequently, something unexpected (which difers from a
reference) is considered interesting. The reference might be known
a-priori, come from historical data, or be the average behavior.
So far we have experimented with variance, skewness and
kurtosis; we are also working to use the entropy. Many diferent RDF
visualizations techniques can be used, e.g., [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
    </sec>
    <sec id="sec-3">
      <title>3 DAGGER OVERVIEW</title>
      <p>We consider three pairwise disjoint sets: the set of URIs U, the
set of literals L, and the set of blank nodes B. An RDF graph G is
a finite set of triples of the form (s, p, o), called subject, property
and object, such that s ∈ (U ∪ B), p ∈ U and o ∈ (U ∪ B ∪ L).
The RDF property rdf:type is used to attach types (i.e. classes)
to an RDF resource, which can have zero, one or several types.
G can have an ontology stating relationships between its classes
and properties, e.g., any UndegraduateStudent is a Student; its
presence may lead to implicit triples, which are part of G even if
they may not appear explicitly. A graph containing all the triples
which may be derived from it is said to be saturated. Without
loss of generality, we consider that our input graph is saturated.</p>
      <p>Dagger identifies unidimensional aggregate queries to be
evaluated in an RDF graph G. However, unlike a traditional relational
data warehouse, an RDF graph comes without identified set of
facts; nor are dimensions and measures known in advance.
Therefore, Dagger must enumerate candidates for each of these roles.</p>
      <p>A set of candidate facts (c f , in short) is a set of G resources
which are deemed interesting for the analysis. Dagger considers
as c f (i) all the resources of a given class C, e.g., all the Students;
(ii) all the resources having a certain set P of properties, e.g.,
all those having title and author. A simple way to pick such a
property set is to compute the support of the properties in G and
select property sets whose support is above a certain threshold.</p>
      <p>
        A candidate dimension (denoted d) is used for grouping the
candidate facts. Dagger supports as candidate dimensions (i)
properties present on at least a certain fraction tthr es of resources
from c f ; (ii) derived properties, computed by Dagger in order
to find potentially interesting insights. The derived properties
supported in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] are count(p), where p is a property that some
c f resources have. For instance, if resources of type Student are
stated to takeCourse, Dagger derives the property takeCourse#.
Further, Dagger will consider a candidate dimension only the
number of distinct values of this property on the c f resources is
smaller than tdist × |c f | for a certain ratio 0 &lt; tdist &lt; 1.
      </p>
      <p>A candidate measure (denoted m) is something to be evaluated
or measured for each candidate fact. Dagger considers candidate
measures among the (original or derived) properties of candidate
facts whose support is above tthr esh . Dimension-measure
combinations such that one is a property a and the other is the count
a# of this property are excluded.</p>
      <p>An aggregation function ⊕ is chosen among min, max, avg,
sum, count; the first four are considered only if the measure is
numeric. Given that RDF data is often untyped or only partially
typed, Dagger implements a type detection mechanism by trying
to convert the property values to diferent types.</p>
      <p>A Dagger aggregate aдд is a tuple (c f , d, m, ⊕). To specify how
interesting an aggregate is, let f (V ) be a function which inputs
a set of numerical values V and returns a number. Given f , the
interestingness of aдд is computed as:
• let d1, d2, . . . be the distinct values that d may take for a
resource in c f ;
• for each di , let c fi be set of c f resources for which d takes
the value di ; observe that the c fi sets may overlap, as a
resource with more than one value for d belongs to several
such sets. For instance, students can be grouped by the
courses they take, and each student takes many courses;
• for each c fi , let Mi be the set of m values of c fi resources,
and mi = ⊕(Mi );
• the interestingness of aдд is f ({m1, m2, . . .}).</p>
      <p>The problem considered by Dagger is: given a graph G, a set of
value thresholds, function f and an integer k, find the k most
interesting aggregates.</p>
      <p>Architecture. Dagger leverages the robust query evaluation
capabilities of an RDBMS to store the RDF graph, enumerate and
evaluate candidate aggregates. SQL queries are used to:
determine the resources part of a candidate fact sets; evaluate the
suitability of their properties as dimensions, respectively, measures;
compute and aggregate the group measures mi . The remaining
operations, e.g., the computation of the interestingness score
function, are done in Java.</p>
      <p>Aggregate recommendation cost. The most expensive
computation steps are: (i) finding the candidate dimensions and ( ii)
evaluating the aggregation operations. Indeed, when looking for
candidate dimensions, several queries are issued over c f (e.g.,
ifnd all distinct properties, count the number of subject that have
each property, find the values of the derived properties, etc.).
Moreover, many candidate aggregates are generated, also leading
to a high number of potentially expensive SQL queries.
4</p>
      <p>
        DAGGER+: SPEEDING UP DAGGER
A set of re-engineering changes were brought to Dagger since
the original demonstration. In particular, it has been ported on
top of OntoSQL (https://ontosql.inria.fr), a Java-based platform
developed at Inria, providing eficient RDF storage, saturation,
and query processing algorithms [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ]. OntoSQL encodes
spaceconsuming URIs and literals into compact integers, together with
a dictionary table which allows going from one to the other. For
a given class c, all triples of the form x type c are stored in a
single-column table tc holding the codes of the subjects x ; for
each property p other than type, a table tp stores (s code, o code)
pairs for each (s, p, o) triple in G. This re-engineering has lead to
a very significant reduction in Dagger’s running time, e.g., on a
20 million triples graph, from several hours to 20 minutes.
      </p>
      <p>
        Further, we adapted an optimization previously proposed in [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]:
we evaluate all candidate aggregates that share both dimension
and measure by a single SQL query. In a relational context,
aggregates can be evaluated together as soon as they have the
same dimension (even if the measures are diferent) because one
relational tuple usually contains all the attributes used in the
diferent measures. In contrast, RDF candidate facts need to be
joined with the td table corresponding to the property d chosen
as dimension, and with the tm table for the property chosen as
measure; distinct measures require distinct joins, thus sharing is
more limited. This is not due to the storage model, but to RDF
heterogeneity: the candidate facts having the measure property
m1 may be diferent from those having property m2. This forces
evaluating (d, m1) aggregates separately from (d, m2) ones.
      </p>
      <p>Below, we focus on two novel optimization techniques we
applied subsequently: using an RDF graph summary to speed up
candidate dimension enumeration (Section 4.1), and using
sampling to accelerate candidate dimension enumeration, aggregate
evaluation and ranking (Section 4.2).
4.1</p>
    </sec>
    <sec id="sec-4">
      <title>Summary-based dimension enumeration</title>
      <p>
        RDFQuotient [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] is a structural RDF graph summarization tool
based on graph quotients. Given an equivalence relation over
graph nodes, the summary contains one node for each
equivaa
lence class in the original graph. Moreover, each edge n −→ m
a
in the original graph leads to an edge rep(n) −→ rep(m) in the
summary, where rep(n) is the summary representative of node
n. A particular equivalence relation groups the nodes by their
set of types. Dagger+ uses it to find: ( i) all the types, (ii) for each
type, the number of resources of that type, and (iii) the set of
possible properties these resources might have. These questions
can be answered exactly directly from the RDFQuotient reducing
dimension enumeration time.
4.2
      </p>
    </sec>
    <sec id="sec-5">
      <title>Sampling-based aggregate selection</title>
      <p>We introduced two sampling strategies to trade some accuracy
in aggregate selection for running time:
• CFSampling: the c f is sampled (draw n1 samples of size
n2), and candidate dimensions and measures are found for
each sample independently. For each of the n1 samples,
candidate aggregates are generated, and their
interestingness is evaluated on the sample.
• ESampling: candidate dimensions and measures are
computed on the whole c f as in Dagger. Then, n1 samples of
size n2 are drawn from the c f , and the candidate
aggregates are evaluated on the samples.</p>
      <p>With CFSampling, the aggregates recommended for diferent
sample may be diferent, e.g., certain properties might be found
to be frequent in some sample but not in all of them. After the
evaluation, a ranked list of aggregates is obtained for each sample.
In ESampling, instead, the set of aggregates is unique as it is
derived directly from the original data. However, given that all
the aggregates are evaluated on samples, it also yields a ranked
list of aggregates for each sample.</p>
      <p>To be able to compare the results found without sampling with
those found through sampling, we need to reconcile the results
found on diferent samples into a single ranked list. We can do
this by taking (i) the union or (ii) the intersection of the lists
obtained from all the samples. Then, we re-rank the aggregates
according to a estimation of their global interestingness measure
(based on their interestingness on each sample), e.g., through
pooled variance; at the end of this process, we obtain a unique
ranked list of candidate aggregates.
5</p>
    </sec>
    <sec id="sec-6">
      <title>EXPERIMENTAL RESULTS</title>
      <p>Sampling. We measure the running time and the accuracy of
the results by varying 3 parameters: (i) the sampling strategy
(CFSampling or ESampling), (ii) the number of samples (2, 3, 4 or
5); and (iii) the sample size, as a ratio of the candidate fact set size
(from 1% to 10% of the number of distinct CF resources). Figure 3
shows the running times: one plot for each number of samples
(from top to bottom, 2, 3, 4, 5), each of which varies the strategy
and the sample size. Ten runs are averaged for each parameter
combinations (diferent samples are drawn in each run).</p>
      <p>Figure 3 shows that ESampling is slower than CFSampling, as
the former looks for candidate dimensions on the whole
candidate fact set, whereas the latter does this on smaller-size samples.
ESampling enumerates all the candidate aggregates also found
without sampling, while CFSampling might enumerate a diferent
set of aggregates: some properties that are overall frequent
(infrequent) might be found infrequent (frequent) in a specific sample,
and thus not be considered (considered) as candidate dimensions
and measures. However, even though ESampling enumerates all
the no-sampling candidate aggregates, it evaluates them on
samples, and may end up considering them interesting (uninteresting)
diferently from the way they are on the complete CF.</p>
      <p>To evaluate the accuracy of the results obtained through
sampling, we compare the Top-5, Top-10 and Top-20 aggregates
found without sampling, with those found through sampling.
The ranked list of aggregates found with sampling is built by
taking the union of all those found across the samples and
reranking them according to the interestingness measure (in our
experiments we use the pooled variance to rank all the results).</p>
      <p>Top-K 1% 3% 5% 7% 9% 10%</p>
      <p>Top5 28% 36% 28% 24% 24% 36%
2 Top10 41% 55% 54% 55% 62% 75%</p>
      <p>Top20 57% 69% 80% 81% 88% 96%</p>
      <p>Top5 32% 16% 28% 24% 36% 20%
3 Top10 49% 55% 60% 55% 74% 61%</p>
      <p>Top20 57% 68% 74% 80% 85% 83%</p>
      <p>Top5 32% 22% 16% 12% 20% 12%
4 Top10 46% 50% 39% 42% 50% 55%</p>
      <p>Top20 63% 68% 72% 76% 81% 85%</p>
      <p>Top5 40% 20% 24% 20% 16% 20%
5 Top10 55% 53% 50% 51% 49% 55%</p>
      <p>Top20 67% 63% 68% 74% 78% 79%
Table 1: Accuracy of results with CFSampling.
there is a 10% diference in accuracy on average, i.e. the top-Ks
difer by 2/3 aggregates. This does not mean that such aggregates
were not found though but they have been ranked diferently.</p>
      <p>Figure 4 plots the accuracy with respect to the running times.
Each line of graphs represents the Top-5, Top-10 and Top-20 for a
diferent number of samples; red x’s indicate CFsampling, while
green +’s indicate ESampling, for diferent sample dimensions.
Clearly, the accuracy increases with K (the amount of top
aggregates) and with the size of the samples. The increase in the
number of samples does not significantly improve accuracy.</p>
    </sec>
    <sec id="sec-7">
      <title>6 CONCLUSION</title>
      <p>
        Automatic selection of interesting aggregates in an RDF graph
is challenging, as candidate dimensions and measures must be
“guessed” from the data, and candidate aggregates must be
evaluated to assess their interestingness. After re-engineering
Dagger [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] to exploit an existing eficient RDF platform, we have
shown that sharing work and (to a lesser extent) using a graph
summary can reduce its running time by a factor of 2. Our main
focus has been on sampling, which, for Top-10 and Top-20 search,
achieves good accuracy (above 70%) while reducing running time
by another factor of 2. Overall, CFSampling appears the most
interesting strategy. Our current work stretches in several
directions: (i) generalizing Dagger to more complex dimension and
measure selection, (ii) adopt more interestingness metrics, (iii)
introduce new types of derived properties, e.g., extract
meaningful keywords from textual properties to be used as potential
dimensions and/or measures.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Fabio</given-names>
            <surname>Benedetti</surname>
          </string-name>
          , Sonia Bergamaschi, and
          <string-name>
            <given-names>Laura</given-names>
            <surname>Po</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>LODeX: A Tool for Visual Querying Linked Open Data</article-title>
          .
          <source>In ISWC 2015 Posters &amp; Demonstrations.</source>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>D.</given-names>
            <surname>Bleco</surname>
          </string-name>
          and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Kotidis</surname>
          </string-name>
          .
          <year>2018</year>
          .
          <article-title>Using entropy metrics for pruning very large graph cubes</article-title>
          .
          <source>Information Systems</source>
          (
          <year>2018</year>
          ). To appear.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>D.</given-names>
            <surname>Bursztyn</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Goasdoué</surname>
          </string-name>
          ,
          <string-name>
            <given-names>and I.</given-names>
            <surname>Manolescu</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>Optimizing Reformulationbased Query Answering in RDF</article-title>
          . In EDBT.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>D.</given-names>
            <surname>Bursztyn</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Goasdoué</surname>
          </string-name>
          ,
          <string-name>
            <given-names>and I.</given-names>
            <surname>Manolescu</surname>
          </string-name>
          .
          <year>2016</year>
          .
          <article-title>Teaching an RDBMS about ontological constraints</article-title>
          .
          <source>PVLDB</source>
          <volume>9</volume>
          ,
          <issue>12</issue>
          (
          <year>2016</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Diao</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Manolescu</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Shang</surname>
          </string-name>
          .
          <year>2017</year>
          .
          <article-title>Dagger: Digging for Interesting Aggregates in RDF Graphs</article-title>
          .
          <source>In ISWC Posters &amp; Demonstrations Track.</source>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>R.</given-names>
            <surname>Fagin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. V.</given-names>
            <surname>Guha</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kumar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Novak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Sivakumar</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Tomkins</surname>
          </string-name>
          .
          <year>2005</year>
          .
          <article-title>Multi-structural databases</article-title>
          .
          <source>In PODS. ACM</source>
          ,
          <volume>184</volume>
          -
          <fpage>195</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>François</given-names>
            <surname>Goasdoué</surname>
          </string-name>
          , Pawel Guzewicz, and
          <string-name>
            <given-names>Ioana</given-names>
            <surname>Manolescu</surname>
          </string-name>
          .
          <year>2019</year>
          .
          <article-title>Incremental structural summarization of RDF graphs (demo)</article-title>
          .
          <source>In EDBT.</source>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>S.</given-names>
            <surname>Idreos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Papaemmanouil</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Chaudhuri</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>Overview of Data Exploration Techniques</article-title>
          .
          <source>In SIGMOD</source>
          .
          <volume>277</volume>
          -
          <fpage>281</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>B.</given-names>
            <surname>Tang</surname>
          </string-name>
          , S. Han,
          <string-name>
            <given-names>M. L.</given-names>
            <surname>Yiu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Ding</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Zhang</surname>
          </string-name>
          .
          <year>2017</year>
          .
          <article-title>Extracting Top-K Insights from Multi-dimensional Data</article-title>
          .
          <source>In SIGMOD. ACM</source>
          ,
          <volume>1509</volume>
          -
          <fpage>1524</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>M.</given-names>
            <surname>Vartak</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Rahman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Madden</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. G.</given-names>
            <surname>Parameswaran</surname>
          </string-name>
          , and
          <string-name>
            <given-names>N.</given-names>
            <surname>Polyzotis</surname>
          </string-name>
          .
          <year>2015</year>
          .
          <article-title>SEEDB: Eficient Data-Driven Visualization Recommendations to Support Visual Analytics</article-title>
          .
          <source>PVLDB 8</source>
          ,
          <issue>13</issue>
          (
          <year>2015</year>
          ),
          <fpage>2182</fpage>
          -
          <lpage>2193</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>