<!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>Reconstructing Custom Fragments of Google Knowledge Graph on the Fly?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Martin Skara</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>, Viet Bach Nguyen</institution>
          ,
          <addr-line>and Vojtech Svatek</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Faculty of Informatics and Statistics, University of Economics</institution>
          ,
          <addr-line>Prague</addr-line>
          ,
          <country country="CZ">Czech Republic</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Google Knowledge Graph is more complicated than public knowledge graphs when it comes to retrieving and reusing data for e.g. building custom KGs or concept maps. This is because even though there is a dedicated graph search API, it only o ers information about individual entities without links to other relevant resources that are only available in Google search knowledge panels. In this paper, we present Knowledge Graph Viewer, a tool that utilizes both the graph search API and knowledge panels in order to obtain relationships between graph entities to reconstruct custom substructures of the large knowledge base. This demo will showcase its usage and functionalities in each step of the KG creation while explaining the concept behind the work ow.</p>
      </abstract>
      <kwd-group>
        <kwd>Google knowledge graph</kwd>
        <kwd>knowledge panel</kwd>
        <kwd>knowledge graph</kwd>
        <kwd>data relationship</kwd>
        <kwd>concept map</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Google Knowledge Graph (GKG) is used by Google to store information about
entities and their relationships, which can then serve, among others, to enrich
the web search results. As with other large knowledge graphs (KGs), a question
arises if arbitrary fragments of it can be retrieved to create custom KGs for a
speci c use. Public KGs such as Wikidata or DBpedia1 o er exible open data
access via RDF dumps or SPARQL endpoints, on which tools such as concept
mappers2 can leverage. However, accessing graph-shaped information from GKG
is more di cult, as the GKG API only provides information about individual
entities (nodes) and not about relationships (edges). As observed by Barrasa [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ],
the information on relationships can be found as part of text search results, in the
form of knowledge panels3 which contain links to related entities or information
? Supported by IGA VSE project № 33/2019
      </p>
      <p>Copyright © 2020 for this paper by its authors. Use permitted under Creative
Commons License Attribution 4.0 International (CC BY 4.0).
1 https://www:wikidata:org/, https://dbpedia:org/
2 E.g. ContextMinds { https://www:contextminds:com/, which dynamically
autocompletes a manually built concept graph using data from DBpedia
3
https://www:blog:google/products/search/about-knowledge-graph-andknowledge-panels/
(e.g. birthplace, book author, works of a musician, categories, etc.), including
the entities often sought together via Google search. An example search result
with the knowledge panel can be seen in Fig. 1 on the right side. Using these
pieces of information, we can progressively build meaningful graph fragments.
However, manually copying relationship information from knowledge panels to
connect nodes in a custom KG is slow and error-prone. To make this process
easier, we developed the Knowledge Graph Viewer tool that can create custom
KGs based on information from Google search knowledge panels and GKG API.
2
Knowledge Graph Viewer is a web application that uPsreofsilesJavaScript on both the
back-end (in the form of NodeJS) and front-end side, Twwit ehrerInsetagratmheFacNebooukxtTu.mjbslr frYaouTmube
ework (respectively Vue.js) is used, with data being stored in a Neo4j database.
The application can: 1) add GKG entities, along with their relationships to a
custom graph; 2) display the custom graph; and 3) export the graph and the
underlying part of an RDFS ontology to a RDF, CSV or JSON le.
taylor swift</p>
      <p>Al Images Videos News
About 517,000,000 results (0.78 seconds)</p>
    </sec>
    <sec id="sec-2">
      <title>Top stories</title>
      <p>Shopping More
Set ings Tools</p>
      <p>Bilboard
Taylor Swift's '1989' Now
One of Only Four
Albums by Women to
Spend 300 Weeks on…
6 hours ago
More for taylor swift</p>
      <p>Bilboard
Katy Perry Hopes Her
Daughter Keeps Taylor
Swift's Adorable Baby
Gift Forever
1 day ago
Kanye West Compares
Music Biz and NBA to
Slavery, Taylor Swift
Roped In
8 hours ago
www.taylorswift.com</p>
    </sec>
    <sec id="sec-3">
      <title>Taylor Swift | Home</title>
      <p>The Of icial Website of Taylor Swift - folklore album out now! Event Details, Videos,
Merchandise &amp; More.</p>
      <p>Taylor Swift Store · Events · The “in the trees” hoodie . . · So much for summer love . .
ht ps:/ twit er.com/taylorswift13</p>
    </sec>
    <sec id="sec-4">
      <title>Taylor Swift (@taylorswift13) · Twitter</title>
      <p>Bout to show up at your party @ACMawards  pic.twit er.com/ekNJfv4…
Twit er · 2 days ago
en.wikipedia.org › wiki › Taylor_Swift</p>
    </sec>
    <sec id="sec-5">
      <title>Taylor Swift - Wikipedia</title>
      <p>Taylor Alison Swift (born December 13, 1989) is an American singer-songwriter. Her narrative
songwriting, which often centers around her personal life, has received widespread media
coverage. Born in West Reading, Pennsylvania, Swift relocated to Nashvil e, Tennessee in 2004
to pursue a career in country music.</p>
      <p>LOathbeerlsn:aBmigeMs:aNchilsinSe;jöRbeeprgublic YGeeanrrsesa:cPtiovpe;: c2o0u0n3t–ryp;reroscekn;tsynth-pop; cou…
Album · Folklore (Taylor Swift album) · Discography · 1989 (Taylor Swift album)
More images</p>
      <sec id="sec-5-1">
        <title>Taylor Swift</title>
        <p>American singer
taylorswift.com</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Available on</title>
      <p>YouTube
Spotify
Deezer</p>
      <p>More music services
Taylor Alison Swift is an American singer-songwriter. Her narrative
songwriting, which often centers around her personal life, has
received widespread media coverage. Born in West Reading,
Pennsylvania, Swift relocated to Nashvil e, Tennessee in 2004 to
pursue a career in country music. Wikipedia
Born: December 13, 1989 (age 30 years), Reading, Pennsylvania,
United States
Height: 1.78 m
Net worth: $360 mil ion (2019 estimate)
Movies: Cats, Miss Americana, Valentine's Day, The Giver, MORE</p>
    </sec>
    <sec id="sec-7">
      <title>Albums</title>
      <p>View 35+ more</p>
      <sec id="sec-7-1">
        <title>2T0a0y6lor Swift r2e0p17utation 2R0e1d2</title>
        <p>The source code is available at https://github:com/skaryys/kgviewer
under the MIT license. A demo version is running at http://89:221:219:40/, and
a video demonstration is available at https://vimeo:com/439597230.</p>
        <p>In accordance with GKG usage terms4, we believe users can view the same
data that is also publicly available from Google search results. Most of this data
is obtained using Puppeteer5, a headless internet browser capable of retrieving
data from web pages. Knowledge Graph Viewer should only be used for academic
purposes. The tool has been tested in major web browsers, such as Chrome 29+,
Firefox 77+, Opera 77+ and Edge 84+.
2.1</p>
        <p>Adding GKG entities to the custom graph
After entering a search term to the input eld, the result entities are displayed.
Clicking on the Add to graph button then adds the entity into a queue, which can
be seen on the left side of the page. Entities in the queue are then asynchronously
added to our graph (see Fig. 2). A summary of this process is shown in Fig. 3.</p>
        <p>If the entity in the knowledge panel does not match the entity obtained
using the GKG API, or if there is no knowledge panel at all, only one node
corresponding to the original entity is to be added to the custom graph.
4 https://developers:google:com/knowledge-graph/terms
5 https://pptr:dev/</p>
        <p>Two ways of retrieving related entities from the knowledge panel are
distinguished. For some links, the related entity ID can be obtained directly from the
source code of the primary knowledge panel (see Fig. 4). However, for most links
in the knowledge panels, the relevant entity IDs cannot be obtained directly from
the source code of the original entity being acquired. For this reason, Puppeteer
is used to open the search result page of the related entity. The process of adding
a related entity is shown in Fig. 5.</p>
        <sec id="sec-7-1-1">
          <title>The related entity ID and link are obtained from the HTML source code</title>
        </sec>
        <sec id="sec-7-1-2">
          <title>Using the appropriate ID, the related entity is found using the GKG API</title>
        </sec>
        <sec id="sec-7-1-3">
          <title>The related entity and its relationship to the original entity are added to the graph</title>
          <p>From the overall procedures that our tool uses, it is evident that adding an
entity to the custom graph along with related entities and relationships is a
complex task that often requires opening several web pages. This is why some
entities may take longer than others. In average, the whole process takes around
one to two minutes.
2.2</p>
          <p>Displaying the custom graph
In Fig. 6, we show a custom graph built around the entity Prague and primarily
containing information about important persons associated with the city. The
graph visualization is based on Neo4j's native Neovis.js library6. By default, the
tool shows up to 300 graph elements (nodes and relationships between them) to
avoid slow loading, but this value can be adjusted manually. The resulting graph
can also be searched and customized as follows:
{ Detailed information about entities is displayed on mouse hover.
{ Entities can be searched by name as well as by type.
{ Entities and relationships can be queried using the Cypher7 query language.
{ Users can specify which entity types should be displayed as additional nodes.
6 https://github:com/neo4j-contrib/neovis:js/
7 https://neo4j:com/developer/cypher-query-language/
{ Users can use `fast mode' which decreases rendering quality to improve
loading speed. For graphs with many edges (e.g. if types are shown as nodes),
this fast mode can reduce loading speed signi cantly.</p>
          <p>{ Users can export results in RDF format.
3</p>
          <p>Conclusions
To our knowledge, Knowledge Graph Viewer is the only tool supporting the
custom reconstruction of GKG fragments. Its usability is currently limited by
two inherent factors: the slowness of entity addition due to multiple calls to the
GKG API and Google search, and the necessity to adapt the wrapper interface
when the structure of the Google search results changes. Nevertheless, we believe
that it provides an added value compared to purely manual GKG reconstruction.
As future work, we are preparing to explore the possibility of adding entities in an
automated way, based on a user-set pro le. The tool itself can still be improved,
i.e. not all related links must be browsed because there is direct connection
between Google API identi ers and the stick parameter in Google search8.</p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Barrasa</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>The `Hidden' Connections In Google's Knowledge Graph</article-title>
          . https://jbarrasa:com/
          <year>2016</year>
          /09/12/the-hidden
          <article-title>-connections-in-googlesknowledge-graph/.</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>