<!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>MetaStanza: Generic WebComponents Widgets for Visualizing SPARQL Results on the Web</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Toshiaki Katayama</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Database Center for Life Science, Research Organization of Information and Systems</institution>
          ,
          <addr-line>178-4-4 Wakashiba, Kashiwa-shi, Chiba 277-0871</addr-line>
          ,
          <country country="JP">Japan</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>SPARQL queries are used to retrieve information from RDF datasets while visualizing the results on a web page still requires development of custom modules especially when it needs to be graphically displayed. To ease this situation, I have developed MetaStanza as a generic framework to generate typical visualizations based on the TogoStanza and the d3sparql.js tools that have also been in-house developed. With MetaStanza, user can specify a SPARQL query API with desired parameters to embed 15 different types of visualizations in any web site as a WebComponents widget.</p>
      </abstract>
      <kwd-group>
        <kwd>SPARQL</kwd>
        <kwd>JavaScript</kwd>
        <kwd>WebComponents</kwd>
        <kwd>visualization</kwd>
        <kwd>MetaStanza</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Introduction</p>
      <p>To resolve this situation, I developed a set of MetaStanza which currently provides
15 different typical types of visualizations on top of the TogoStanza framework and the
d3sparql.js library. As a result, users can embed a MetaStanza in any web page only by
writing a small amount of the HTML markup which in turn automatically converted to
a WebComponents widget showing the result of a designated SPARQL query.
1 http://togostanza.org/
2 http://togogenome.org/
3 http://biohackathon.org/d3sparql/
Copyright © 2019 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).</p>
      <p>Each MetaStanza takes the URI of a SPARQL query or a REST API which returns
the SPARQL Query Result JSON Format with some additional parameters to adjust
visualizations (Fig 1).</p>
      <p>&lt;!DOCTYPE html&gt;
&lt;head&gt;</p>
      <p>&lt;link rel="import" href="http://togostanza.org/dist/metastanza/stanzaname/"&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;togostanza-stanzaname sparql_api="http://example.org/sparql?query=encoded+sparql+query+string"
title="title text" argument=”value”&gt;&lt;/togostanza-stanzaname&gt;
&lt;/body&gt;</p>
      <p>Fig. 1 Embedding MetaStanza in a web page where the italic parts are variables.</p>
      <p>Currently 15 different types of visualizations are available4 including barchart,
circlepack, coordmap, dendrogram, forcegraph, htmlhash, htmltable, namedmap, piechart,
roundtree, sankey, scatterplot, sunburst, treemap, and treemapzoom (Fig 2).</p>
      <p>Fig 2. MetaStanza showing a zoomable treemap visualization embedded</p>
      <p>in the help page (left panel) and a web page (right panel).</p>
      <p>The source code of MetaStanza5 and d3sparql.js are freely available on GitHub and
example REST APIs returning SPARQL results are provided by the SPARQList 6
which can be easily customized according to the developer’s needs.</p>
      <p>Reference. 1. Katayama T, Kawashima S, Okamoto S, Moriya Y, Chiba H, Naito Y,
Fujisawa T, Mori H, Takagi T: TogoGenome/TogoStanza: modularized Semantic
Web genome database. Database (Oxford) 2019, 2019:1–11.</p>
    </sec>
  </body>
  <back>
    <ref-list />
  </back>
</article>