Closed MarcoR1791 closed 1 year ago
We can process python arguments before passing them to the CLI. In the case of -v
we could also support a dictionary as the argument value. If a dictionary {'param1':'val1','param2':'val2'}
is passed, then we serialise it as -v param1=value1 -v param2=value2
.
A more general approach is to develop a class with a specific method for each one of the CLI parameters. The class will collect all the info and then have the methods select(), ask(), etc... with no argument (because it will use the ones collected before) that pre-process parameters and calls the methods already developed.
Example:
b = sparqlanything.client()
b.query(path to query)
b.outputFile(path to output file)
b.format(JSON)
...
data=b.select()
Addressed this in commit 13a9c1c
The SA user guide states that "the argument can be passed multiple times".
But the Python **kwargs are mapped to a dictionary, which does not allow duplicate keys.
A work around such as say v_i and v_o for input and output variables may be needed for passing arguments to the PySPARQL cli. These can then be normalised in the implementation before being passed to the SA main method.
@enridaga wdyt?