SPARQL commands¶
kurra.cli.commands.sparql ¶
CLI commands for running SPARQL queries.
sparql_command ¶
sparql_command(path_or_url: Path, q: str, response_format: str = typer.Option('table', '--response-format', '-f', help="The response format of the SPARQL query. Either 'table' (default), 'json' or 'csv'"), username: str = None, password: str = None, timeout: int = 60) -> None
Run a SPARQL query against a local RDF file or a SPARQL endpoint, and print the result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path_or_url
|
Path
|
A local RDF file path or a SPARQL endpoint URL to query. |
required |
q
|
str
|
A SPARQL query string, or the path to a file containing one. |
required |
response_format
|
str
|
The response format of the SPARQL query. Either |
Option('table', '--response-format', '-f', help="The response format of the SPARQL query. Either 'table' (default), 'json' or 'csv'")
|
username
|
str
|
Fuseki username, if the endpoint requires authentication. |
None
|
password
|
str
|
Fuseki password, if the endpoint requires authentication. |
None
|
timeout
|
int
|
Timeout per request, in seconds. |
60
|
Raises:
| Type | Description |
|---|---|
BadParameter
|
If |