SPARQL-Anything / PySPARQL-Anything

The SPARQL Anything Python library
Apache License 2.0
10 stars 0 forks source link

Pass Python data/object as input #2

Open enridaga opened 1 year ago

enridaga commented 1 year ago

Interesting roundtrip required, ideally without saving to file. I think this is related to supporting STDIN in SPARQL Anything, see this issue https://github.com/SPARQL-Anything/sparql.anything/issues/244

MarcoR1791 commented 1 year ago

Just so that I've understood, we wish to do three things:

1) possibly wrap parametrised queries into a single function,

2) look into being able to perform data processing pipelines as a single script, and

2) pass Python objects such as dictionaries or rdflib graphs into SA as parameters without some kind of initial manual conversion to an already supported format?

enridaga commented 1 year ago

This issue refers to your point 3. For example, to be able to query a Python dictionary via an FX interpretation. I guess this necessarily will have to be mediated by serialisation in one of the supported formats, e.g. JSON. However, there are other aspects to be considered. The CLI should support STDIN as input. Then, the CLI should accept to run a SPARQL query on a given input directly, at the moment, it cannot do that because the internal engine assumes this happens within a SERVICE clause. In summary, for this to work we need first to implement a no SERVICE mode which will in turn allow for accepting STDIN as an input source. Then, the Python library can serialise a given Python object into a known syntax (probably JSON) and pass it as STDIN to the Java process.

Maybe you can discuss your other 2 points in separate issues?