0.0.3 • Published 5 years ago

vega-transform-sparql v0.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Vega Transform to query SPARQL endpoints

A Vega Data Transform to fetch data from an SPARQL endpoint.

This package extends Vega's set of data transforms to support fetching data from an SPARQL endpoint and parsing the results, in Vega version 5.0 and higher. A demo can be found here.

Usage Instructions

Install the transform with

npm install vega-transform-sparql

To use the transform, just add it to the existing set of Vega data transforms as follows:

import * as vega from 'vega';
import SPARQL from './SPARQL';

vega.transforms['sparql'] = SPARQL;

Vega Specifications

When adding the transform in a Vega specification, the SPARQL transform expects two parameters:

  • endpoint: the URL of the endpoint
  • query: the SPARQL query
{
    "type": "sparql",
    "endpoint": "https://query.wikidata.org/sparql",
    "query": `SELECT ?item ?itemLabel ?pic
                WHERE
                {
                    ?item wdt:P31 wd:Q146 .
                    ?item wdt:P18 ?pic
                    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
                }`
}
0.0.3

5 years ago

0.0.21

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago