MaastrichtU-IDS / d2s-sparql-operations

✨️ Execute SPARQL queries from string, URL or multiple files using the RDF4J framework.
https://maastrichtu-ids.github.io/d2s-sparql-operations/
MIT License
1 stars 1 forks source link

Allow to provide parameters for queries? #9

Closed vemonet closed 5 years ago

vemonet commented 5 years ago

For example for some URI it would be interested to be able to provide a parameter that will act as a variable in the SPARQL query. To avoid having everything hard coded in the query.

For example a prefix: PREFIX x2rm: <http://data2services/model/> would become PREFIX x2rm: <?_x2rm_uri>

vemonet commented 5 years ago

It is especially to be able to change graph name and base URI without editing the query file

vemonet commented 5 years ago

Adding parameters using cli option with a prefix. e.g.:

--var-baseUri
--var-inputGraph
--param-outputGraph
vemonet commented 5 years ago

Done in https://github.com/vemonet/rdf4j-sparql-operations/commit/05ad3074374181a0864c38107fb7eed61be206a8 providing parameter like this:

-var graphInput:http://graph/input graphOutput:http://graph/output

Replacing ?_graphInput and ?_graphOutput