<!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>Mapping RDF Graphs to Property Graphs</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Shota Matsumoto</string-name>
          <email>shota.matsumoto@lifematics.co.jp</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ryota Yamanaka</string-name>
          <email>ryota.yamanaka@oracle.com</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hirokazu Chiba</string-name>
          <email>chiba@dbcls.rois.ac.jp</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Database Center for Life Science</institution>
          ,
          <addr-line>Chiba 277-0871</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Lifematics Inc.</institution>
          ,
          <addr-line>Tokyo 101-0041</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Oracle Corporation</institution>
          ,
          <addr-line>Bangkok 10500</addr-line>
          ,
          <country country="TH">Thailand</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Increasing amounts of scienti c and social data are published in the Resource Description Framework (RDF). Although the RDF data can be queried using the SPARQL language, even the SPARQL-based operation has a limitation in implementing traversal or analytical algorithms. Recently, a variety of graph database implementations dedicated to analyses on the property graph model have emerged. However, the RDF model and the property graph model are not interoperable. Here, we developed a framework based on the Graph to Graph Mapping Language (G2GML) for mapping RDF graphs to property graphs to make the most of accumulated RDF data. Using this framework, graph data described in the RDF model can be converted to the property graph model and can be loaded to several graph database engines for further analysis. Future works include implementing and utilizing graph algorithms to make the most of the accumulated data in various analytical engines.</p>
      </abstract>
      <kwd-group>
        <kwd>RDF</kwd>
        <kwd>Property Graph</kwd>
        <kwd>Graph Database</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Increasing amounts of scienti c and social data are described as graphs. As a
format of graph data, the Resource Description Framework (RDF) is widely used.
Although RDF data can be queried using the SPARQL language in a exible
way, SPARQL is not dedicated to traversal of graphs and has a limitation in
implementing graph analysis algorithms.</p>
      <p>
        In the context of graph analysis, the property graph model [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is
becoming popular; various graph database engines, including Neo4j [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], Oracle Labs
PGX [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], and Amazon Neptune [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], adopt this model. These graph database
engines support algorithms for traversal or analyzing graphs. However, currently
not many datasets are consistently described in the property graph model, so
the application of these powerful engines are limited.
      </p>
      <p>
        Considering this situation, it is valuable to develop a method to transform
RDF data into property graphs. However, the transformation is not
straightforward due to the di erences in the data model. In RDF graphs, all information is
expressed as the triple (node-edge-node), whereas in property graphs, arbitrary
information can be contained in each of the nodes and edges as key-value form.
Although previous works addressed this issue by formalizing transformations [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ],
users cannot de ne their speci c mappings intended for each use case.
      </p>
      <p>Here, we developed a framework based on the Graph to Graph Mapping
Language (G2GML) for mapping RDF graphs to property graphs. Using this
framework, accumulated graph data described in the RDF model can be
converted to the property graph model and can be loaded to several graph database
engines.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Methods</title>
      <p>that one musician and another are in the same group, the information can be
summarized into the property graph data as shown in this gure.</p>
      <p>For this conversion, the actual G2GML is described as in Figure 3. It starts
with URI pre xes used to write mappings, and then, each mapping consists of
one unindented line of a property graph pattern and indented lines of an RDF
graph pattern. A property graph pattern is written in a syntax like Cypher
(the query language of Neo4j), whereas an RDF graph pattern is written as a
pattern in SPARQL. Variables in each pattern are mapped by those names. This
example contains one node mapping for Musician entity and one edge mapping
for same group relationship only. In G2GML, edge mappings are de ned based
on the conditions of node mappings, which means that edges are generated
in property graph i both nodes' patterns and edges' patterns are matched in
RDF graph. Also, mus, nam, dat, twn and len are used as variables to extract
resources and literals from RDF graph. In the resulting property graph, resources
can be mapped to nodes, while literals can be mapped to values of properties.</p>
      <p>Finally, Figure 4 shows the SPARQL query to retrieve the pairs of musicians
who are in the same group. After G2GML mapping above, we can load the
generated property graph data into graph databases, such as Oracle Labs PGX,
and the query can be written in PGQL (the query language of PGX).
4</p>
    </sec>
    <sec id="sec-3">
      <title>Conclusion</title>
      <p>In this work, we de ned G2GML for mapping RDF graphs to property graphs
and implemented a converter based on the G2GML. We also showed an example
usage of G2GML. Future works include further analysis of the converted graph
data on the database engines adopting the property graph model.
# Node mapping
(mus:Musician {vis_label:nam, born:dat, hometown:twn})
?mus rdf:type foaf:Person, dbpedia-owl:MusicalArtist .
?mus rdfs:label ?nam .</p>
      <p>OPTIONAL { ?mus prop:born ?dat }</p>
      <p>OPTIONAL { ?mus dbpedia-owl:hometown / rdfs:label ?twn }
# Edge mapping
(mus1:Musician)-[:same_group {label:nam, length:len}]-&gt;(mus2:Musician)
?grp a schema:MusicGroup ;</p>
      <p>dbpedia-owl:bandMember ?mus1 , ?mus2 .</p>
      <p>FILTER(?mus1 != ?mus2)
OPTIONAL { ?grp rdfs:label ?nam. FILTER(lang(?nam) = "ja")}
OPTIONAL { ?grp dbpedia-owl:wikiPageLength ?len }
# PGQL
SELECT DISTINCT m1.name, m2.name WHERE (m1)-[same_group]-(m2)
# PG Pattern
# RDF Pattern
# PG Pattern
# RDF Pattern
Modern Query Languages for Graph Databases. ACM Computing Surveys (CSUR),</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Angles</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Arenas</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Barcel</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hogan</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reutter</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vrgoc</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <source>Foundations of 50(5)</source>
          ,
          <volume>68</volume>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>2. The Neo4j Graph Platform, https://neo4j.com/.</mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Oracle</given-names>
            <surname>Labs Parallel Graph</surname>
          </string-name>
          <article-title>AnalytiX (PGX), technetwork/oracle-labs/parallel-graph-analytix/overview/index</article-title>
          .html
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Amazon</given-names>
            <surname>Neptune</surname>
          </string-name>
          , https://aws.amazon.com/neptune/.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Hartig</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          :
          <article-title>Reconciliation of RDF* and property graphs</article-title>
          . arXiv preprint https://www.oracle.com/
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>