=Paper=
{{Paper
|id=Vol-2042/paper47
|storemode=property
|title=SPARQList: Markdown-Based Highly Configurable REST API Hosting Server for SPARQL
|pdfUrl=https://ceur-ws.org/Vol-2042/paper47.pdf
|volume=Vol-2042
|authors=Toshiaki Katayama,Shuichi Kawashima
|dblpUrl=https://dblp.org/rec/conf/swat4ls/KatayamaK17
}}
==SPARQList: Markdown-Based Highly Configurable REST API Hosting Server for SPARQL==
SPARQList: Markdown-based highly configurable REST API hosting server for SPARQL Toshiaki Katayama1 , Shuichi Kawashima1 1 Database Center for Life Science, Research Organization of Information and Systems, 178-4-4 Wakashiba, Kashiwa-shi, Chiba 277-0871, Japan ktym@dbcls.jp, kwsm@dbcls.jp Abstract. SPARQList is a REST API server which executes a SPARQL query, transform the result into formatted data if defined, and then send it back to web client application. In SPARQList, the configuration of API is written in the Markdown format in which parameters of the API, SPARQL endpoints and SPARQL queries, and JavaScript functions for data transformation are defined along with a free text documentation. Each SPARQList server instance can host multiple API configurations, therefore, each service can also be considered as a repository of reusable SPARQL queries with documentation. The source code of the SPARQList is freely available at https://github.com/dbcls/sparqlist and can be easily deployed as it is implemented in the Node.js. Keywords: Semantic Web, SPARQL, JavaScript, Markdown, REST API Introduction SPARQL endpoint allows users to make arbitrary queries, however, it is also demanded to provide REST APIs for frequently used typical queries or complex queries to be executed instantly so that web applications can easily make use of the semantic data. SPARQList is designed to provide such REST APIs with ease by (1) introducing the Markdown format for describing the API, (2) provide a GUI Web interface to create/copy/edit/delete/execute the API configuration, (3) transform the SPARQL results into other format according to content negotiation by JavaScript. Results We developed a REST API server namely SPARQList which has a Web interface to list, create, copy, edit, delete and execute “SPARQLet”, a definition of SPARQL queries and data transformations described in a Markdown text. Fig 1 shows the Web interface of SPARQList which provides (1) a list of SPARQLets, (2) a Markdown 2 editor for API configuration, (3) a formatted documentation and buttons to copy, edit, delete the SPARQLet, (4) an interface to specify parameters and to execute the SPARQLet which comes with a trace for debugging. Fig 1. Web interface of the SPARQList In the SPARQLet configuration (formatted in the Markdown), a service provider can specify a title and a description of the API, arbitrary pairs of a SPARQL endpoint and a SPARQL query template which can embed API parameters, and JavaScirpt snippets for the purpose described below. Even though most SPARQL endpoints can return the results in the SPARQL 1.1 Query Results JSON Format (application/sparql-results+json), it is often preferable for the Web client applications to consume formatted JSON (application/json) data or other formats like a text or HTML. Therefore, a SPARQLet can store the SPARQL results as variables and the JavaScript snippets embedded in the SPARQLet can make use of them in combination to transform into any other format according to the specified mime-type for content negotiation. % curl –H “Accept: application/json” http://ex.org/api/test?p=foo % curl –H “Accept: text/plain” http://ex.org/api/test?p=foo To make SPARQList APIs compatible with the smartAPI (http://smart-api.info/) and promoting the FAIR principles [1], supporting JSON-LD (application/ld+json) is planned. Note that, our separate open source product SPARQL-proxy, a cache server for any SPARQL endpoint, can be used in combination to improve the response time of repeated queries. References 1. Wilkinson M.D. et al.: The FAIR Guiding Principles for scientific data management and stewardship. Sci. Data. 3, 160018 (2016).