Write your SPARQL query directly in the JSON-LD you would like to have in output
Py SPARQL Transformer
Write your SPARQL query directly in the JSON-LD you would like to have in output.
- It is now possible to set a different merging anchor instead of
Table of Contents
How to use
Install by pip.
pip install SPARQLTransformer
Use in your JS application (node or browser).
from SPARQLTransformer import sparqlTransformer out = sparqlTransformer(query, options)
The first parameter (
query) is the query in the JSON format. The JSON can be:
- an already parsed (or defined real time)
- the local path of a JSON file (that will then be read and parsed).
options parameter is optional, and can define the following:
|context||http://schema.org/||The value in
||A function receiving in input the transformed query in SPARQL, returning a Promise. If not specified, the module performs the query on its own1 against the specified endpoint.|
|endpoint||http://dbpedia.org/sparql||Used only if
||Enter in debug mode. This allow to print in console the generated SPARQL query.|
tests.py for further examples.
If you use this module for your research work, please cite:
Pasquale Lisena, Albert Meroño-Peñuela, Tobias Kuhn and Raphaël Troncy. Easy Web API Development with SPARQL Transformer. In 18th International Semantic Web Conference (ISWC), Auckland, New Zealand, October 26-30, 2019.
Pasquale Lisena and Raphaël Troncy. Transforming the JSON Output of SPARQL Queries for Linked Data Clients. In WWW'18 Companion: The 2018 Web Conference Companion, April 23–27, 2018, Lyon, France. https://doi.org/10.1145/3184558.3188739
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size SPARQLTransformer-1.8.2.tar.gz (7.7 kB)||File type Source||Python version None||Upload date||Hashes View hashes|