<!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>On-Demand and Lightweight Knowledge Graph Generation { a Demonstration with DBpedia</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Malte Brockmeier</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yawen Liu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sunita Pateer</string-name>
          <email>spateerg@mail.uni-mannheim.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>rtling[</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>iko P</string-name>
          <email>heikog@informatik.uni-mannheim.de</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Data and Web Science Group University of Mannheim</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Modern large-scale knowledge graphs, such as DBpedia, are datasets which require large computational resources to serve and process. Moreover, they often have longer release cycles, which leads to outdated information in those graphs. In this paper, we present DBpedia on Demand { a system which serves DBpedia resources on demand without the need to materialize and store the entire graph, and which even provides limited querying functionality.</p>
      </abstract>
      <kwd-group>
        <kwd>Knowledge Graph</kwd>
        <kwd>On Demand</kwd>
        <kwd>Live</kwd>
        <kwd>Lightweight</kwd>
        <kwd>Knowledge Graph as a Service</kwd>
        <kwd>DBpedia</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        Knowledge graphs on the Web { such as DBpedia [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], YAGO [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], or Wikidata
[
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] { are useful building blocks for intelligent applications [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. While they di er
considerably in coverage and quality [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], in many cases, timeliness of
information is a crucial property in some use cases as well. Since many public knowledge
graphs have rather long release cycles, sometimes up to a few months or even
years [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], the information served in these knowledge graphs may be easily
outdated. One approach which has been proposed to close this gap is DBpedia Live,
which provides fresh data extracted from Wikipedia as a knowledge graph [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ],
and which, after a longer downtime, is available again since 2019.1
      </p>
      <p>Another challenge related to such knowledge graphs is their sheer size. The
creation of those graphs is often a longer running and computation-intensive
process, and even serving the knowledge graph online requires quite a bit of
computing power. The hosted services for hosting a static DBpedia copy or
running DBpedia live cost around $1 per hour at the time of writing this paper.2</p>
      <p>User
Front end
Cache
 Request: http://dbpedia.org/resource/Mannheim
 Get
Ingoing Links
 Get Page
Sources</p>
      <p>KG on Demand</p>
      <p>Engine
 Generate RDF
 Extract Abstracts</p>
      <p>Linked Data Endpoint
 HTTP GET http://dbpedia.org/resource/Mannheim
SPARQL Endpoint
 SELECT ?p WHERE {dbr:Mannheim dbo:population ?p}
Extraction Framework</p>
      <p>In this paper, we introduce DBpedia on Demand { an installation of DBpedia
which can be run on a local machine as a service. It creates knowledge graph
resources on request without materializing an entire graph, which makes its
computing requirements rather minimal. It provides a Linked Data endpoint as
well as limited SPARQL querying properties.3
2</p>
    </sec>
    <sec id="sec-2">
      <title>Prototype</title>
      <p>
        DBpedia is built from Wikipedia by extracting information from infoboxes and
other bits of structured contents, such as categories. To that end, it uses
mappings from infoboxes to a central ontology, which are also stored in a Wiki. When
creating a release, a dump of Wikipedia is processed, and the page contents are
transformed to knowledge graph instances using the mappings de ned in the
Mappings Wiki [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>The idea of KG on demand is di erent. Instead of creating a full DBpedia
copy, it creates instances upon request: when a user requests a certain resource,
the corresponding Wikipedia page is downloaded and processed in real time.
Mappings can be downloaded from the mappings Wiki regularly, which allows
for using at least recent, although not up to date mappings. Fig. 1 shows the
overall architecture of the KG on Demand engine. The process runs in ve steps:
1. The URI for which to generate the RDF for is obtained, either trough the
user interface, a HTTP request, or by extracting it from a SPARQL query.
2. The ingoing links (i.e., Wikipedia pages pointing to the page which
corresponds to the requested resource) to that resource are obtained from the
Wikipedia API.
3 Code available at https://github.com/mbrockmeier/KnowledgeGraphOnDemand
3. The page sources for both the requested resources and the resources of the
pages linking to the resource are obtained via the Wikipedia API.
4. For all those pages, the corresponding RDF representation is generated via
the DBpedia Extraction Framework.
5. Additionally, the abstract for the resource at hand is generated by extracting
the rst few sentences from the Wikipedia page.</p>
      <p>In the DBpedia knowledge graph, outgoing edges from a resource are generated
from the corresponding Wikipedia page's infobox. Hence, for generating only the
outgoing edges, processing one single Wikipedia page is su cient. In contrast,
ingoing edges are outgoing edges of other Wikipedia pages. In order to generate
those, we rst query the Wikipedia API for other pages that link to the one at
hand, and then process those as well in order to generate the ingoing edges.</p>
      <p>Since the abstract extraction in DBpedia requires the creation and processing
of a local copy of the entire Wikipedia, we developed or own simple abstract
extraction mechanism instead of using the original one.</p>
      <p>The number of ingoing Wikipedia links is the key factor that in uences the
performance of the proposed approach. Fig. 2 depicts the performance for
extracting resources from Wikipedia pages.4 It can be observed that the systems
scales linearly with the number of ingoing links.5</p>
      <p>The approach of generating resources for URIs also determines the kind of
SPARQL queries that our approach can process. Generally, all queries that only
consider simple ingoing and outgoing edges of a xed resource can be handled,
such as
SELECT ?actor WHERE { ?actor dbo:starring dbr:Lost_Highway .}
SELECT ?director WHERE { dbr:Lost_Highway dbo:director ?director .}
On the other hand, our approach cannot handle queries without a xed resource,
or queries with a path length greater than one, such as:
4 The tests were run on an Intel Core i7-8700K processor, 32GB of DDR4 RAM, a
1TB NVMe SSD, and an internet connection with a downstream rate of 100MBit/s.</p>
      <p>The reported processing times are the averages of 10 runs.
5 Since the number of ingoing links are the main driver of performance, the maximum
number of ingoing links to consider can also be reduced in the con guration of our
implementation. By default, all ingoing links are processed.
In other words, the queries are limited to patterns with at least one resource
xed, and all query variables being at most one hop away from that resource.
3</p>
    </sec>
    <sec id="sec-3">
      <title>DBpedia Live vs. DBpedia on Demand</title>
      <p>DBpedia live builds a full copy of DBpedia. This copy is then updated by
monitoring the update stream of Wikipedia. Whenever a change is made in Wikipedia,
DBpedia live is noti ed and processes the change by re-computing the
corresponding instance representation in the knowledge graph. Likewise, it is noti ed
on changes in the Mappings wiki (e.g., if the mapping of an infobox to an
ontology class is changed), and the a ected instances can then be changed as well.</p>
      <p>By design, DBpedia live always stores a local materialized copy of the full
knowledge graph, which leads to high computational costs of serving the
knowledge graph endpoint (i.e., it can be run on commodity hardware). Since all
requests are processed on that local copy, they can be handled faster than in
DBpedia on demand, and also all types of SPARQL queries can be answered.
At the same time, DBpedia Live requires a lot of online runtime to constantly
process the stream of changes from Wikipedia. Table 1 summarizes the main
di erences between DBpedia Live and DBpedia on Demand.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion and Outlook</title>
      <p>In this paper, we have shown an approach which generates a knowledge graph
like DBpedia in an on-demand and lightweight fashion. The approach is very
resource-e cient and can be run on commodity hardware. Hence, it is an
interesting building block for applications which use a knowledge graph, but do
neither want to rely on a public endpoint, nor materialize an entire knowledge
graph. The approach can be seen as a complement to DBpedia Live, in
comparison to which it has di erent advantages and disadvantages.</p>
      <p>While the current implementation is a prototype only, there are some
shortcomings which we have inherited from the DBpedia Extraction Framework. First,
that framework is not capable of multithreading, which makes the current
implementation suitable for a local service, rather than for setting up a public
endpoint. Second, we have currently encapsulated the entire extraction
framework, which, however, comes with a signi cant ramp-up time. Both issues could
be addressed by branching and refactoring the extraction framework's codebase.</p>
      <p>
        While this demonstration has been based on DBpedia, it can be transferred
to other approaches as well. With the same mechanism, it would be possible
to use the extraction code of other Wikipedia-based knowledge graphs, such as
YAGO [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] or the Linked Hypernym extraction [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], as well as to transfer the
approach to other Wikis [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Also other re nement operators which are local to
a Wikipedia page, such as extracting relations from text [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], would be applicable.
      </p>
      <p>
        While the SPARQL capabilities in our approach are still basic, the
approach could be extended towards supporting more complex queries. Possible
approaches would be incremental solving of queries, or rst using the Wikipedia
link graph for obtaining candidates, and then running the extraction on the
candidates to narrow down the solution set. For implementing a query endpoint,
it would also be interesting to build a (possibly limited) linked data fragments
endpoint [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] with the approach at hand, since many of the basic building blocks
of those endpoints (e.g., paging) can be directly transferred to our approach.
      </p>
      <p>
        Apart from adding querying capabilities, the endpoint could also be
enriched with an on-demand approach of generation of embedding vectors, such
as RDF2vec Light [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. That way, downstream applications could leverage both
explicit as well as latent representations of the entities in the knowledge graph.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. Farber,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Bartscherer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            ,
            <surname>Menne</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Rettinger</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <article-title>Linked data quality of dbpedia, freebase, opencyc, wikidata, and yago</article-title>
          .
          <source>Semantic Web</source>
          <volume>9</volume>
          (
          <issue>1</issue>
          ),
          <volume>77</volume>
          {
          <fpage>129</fpage>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Heist</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hertling</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paulheim</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          :
          <article-title>Language-agnostic relation extraction from abstracts in wikis</article-title>
          .
          <source>Information</source>
          <volume>9</volume>
          (
          <issue>4</issue>
          ),
          <volume>75</volume>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Heist</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hertling</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ringler</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paulheim</surname>
          </string-name>
          , H.:
          <article-title>Knowledge graphs on the web-an overview</article-title>
          . (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Hertling</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paulheim</surname>
          </string-name>
          , H.:
          <article-title>Dbkwik: extracting and integrating knowledge from thousands of wikis</article-title>
          .
          <source>Knowledge and Information Systems</source>
          <volume>62</volume>
          (
          <issue>6</issue>
          ),
          <volume>2169</volume>
          {
          <fpage>2190</fpage>
          (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Kliegr</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Linked hypernyms: Enriching dbpedia with targeted hypernym discovery</article-title>
          .
          <source>Journal of Web Semantics</source>
          <volume>31</volume>
          ,
          <issue>59</issue>
          {
          <fpage>69</fpage>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Lehmann</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , et al.:
          <article-title>Dbpedia{a large-scale, multilingual knowledge base extracted from wikipedia</article-title>
          .
          <source>Semantic web 6(2)</source>
          ,
          <volume>167</volume>
          {
          <fpage>195</fpage>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Morsey</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lehmann</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Auer</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stadler</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hellmann</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Dbpedia and the live extraction of structured data from wikipedia</article-title>
          .
          <source>Program</source>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Portisch</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hladik</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paulheim</surname>
          </string-name>
          , H.:
          <article-title>Rdf2vec light{a lightweight approach for knowledge graph embeddings</article-title>
          . arXiv preprint arXiv:
          <year>2009</year>
          .
          <volume>07659</volume>
          (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Rebele</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , et al.:
          <article-title>Yago: A multilingual knowledge base from wikipedia, wordnet, and geonames</article-title>
          .
          <source>In: ISWC</source>
          . pp.
          <volume>177</volume>
          {
          <fpage>185</fpage>
          . Springer (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Verborgh</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , et al.:
          <article-title>Triple pattern fragments: a low-cost knowledge graph interface for the web</article-title>
          .
          <source>Journal of Web Semantics</source>
          <volume>37</volume>
          ,
          <issue>184</issue>
          {
          <fpage>206</fpage>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Vrandecic</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , Krotzsch, M.:
          <article-title>Wikidata: a free collaborative knowledgebase</article-title>
          .
          <source>Communications of the ACM</source>
          <volume>57</volume>
          (
          <issue>10</issue>
          ),
          <volume>78</volume>
          {
          <fpage>85</fpage>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>