Graph Store Protocol commands¶
kurra.cli.commands.db.gsp ¶
CLI commands for the SPARQL Graph Store Protocol.
exists_command ¶
exists_command(sparql_endpoint_url: str = typer.Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds'), graph_identifier: str = None, username: str = None, password: str = None, timeout: int = 60)
Check whether a graph exists in a database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sparql_endpoint_url
|
str
|
SPARQL Endpoint URL. E.g. http://localhost:3030/ds |
Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds')
|
graph_identifier
|
str
|
The IRI or URN of the graph to check. If not set, the default graph is targeted. |
None
|
username
|
str
|
Fuseki username, if the server requires authentication. |
None
|
password
|
str
|
Fuseki password, if the server requires authentication. |
None
|
timeout
|
int
|
Timeout per request, in seconds. |
60
|
Raises:
| Type | Description |
|---|---|
Exception
|
If the request to the database fails. |
Source code in kurra/cli/commands/db/gsp.py
get_command ¶
get_command(sparql_endpoint_url: str = typer.Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds'), graph_identifier: str = None, username: str = None, password: str = None, timeout: int = 60)
Get the content of a database graph, printed as longturtle.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sparql_endpoint_url
|
str
|
SPARQL Endpoint URL. E.g. http://localhost:3030/ds |
Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds')
|
graph_identifier
|
str
|
The IRI or URN of the graph to fetch. If not set, the default graph is targeted. |
None
|
username
|
str
|
Fuseki username, if the server requires authentication. |
None
|
password
|
str
|
Fuseki password, if the server requires authentication. |
None
|
timeout
|
int
|
Timeout per request, in seconds. |
60
|
Raises:
| Type | Description |
|---|---|
Exception
|
If the request to the database fails, other than the graph not being found. |
Source code in kurra/cli/commands/db/gsp.py
put_command ¶
put_command(path: Path = typer.Argument(..., help='The path of a file or directory of files to be uploaded.'), sparql_endpoint_url: str = typer.Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds'), graph_identifier: str = None, username: str = None, password: str = None, timeout: int = 60)
Add content to a database graph. This will preserve all existing content. Use post_command if you wish to remove existing content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The path of a file or directory of files to upload. |
Argument(..., help='The path of a file or directory of files to be uploaded.')
|
sparql_endpoint_url
|
str
|
SPARQL Endpoint URL. E.g. http://localhost:3030/ds |
Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds')
|
graph_identifier
|
str
|
The IRI or URN of the graph to upload into. If not set, the default graph is targeted. |
None
|
username
|
str
|
Fuseki username, if the server requires authentication. |
None
|
password
|
str
|
Fuseki password, if the server requires authentication. |
None
|
timeout
|
int
|
Timeout per request, in seconds. |
60
|
Raises:
| Type | Description |
|---|---|
Exception
|
If the request to the database fails. |
Source code in kurra/cli/commands/db/gsp.py
post_command ¶
post_command(path: Path = typer.Argument(..., help='The path of a file or directory of files to be uploaded.'), sparql_endpoint_url: str = typer.Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds'), graph_identifier: str = None, username: str = None, password: str = None, timeout: int = 60)
Add content to a database graph. This will remove all existing content. Use put_command if you wish to preserve existing content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The path of a file or directory of files to upload. |
Argument(..., help='The path of a file or directory of files to be uploaded.')
|
sparql_endpoint_url
|
str
|
SPARQL Endpoint URL. E.g. http://localhost:3030/ds |
Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds')
|
graph_identifier
|
str
|
The IRI or URN of the graph to upload into. If not set, the default graph is targeted. |
None
|
username
|
str
|
Fuseki username, if the server requires authentication. |
None
|
password
|
str
|
Fuseki password, if the server requires authentication. |
None
|
timeout
|
int
|
Timeout per request, in seconds. |
60
|
Raises:
| Type | Description |
|---|---|
Exception
|
If the request to the database fails. |
Source code in kurra/cli/commands/db/gsp.py
delete_command ¶
delete_command(sparql_endpoint_url: str = typer.Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds'), graph_identifier: str = None, username: str = None, password: str = None, timeout: int = 60)
Delete triples from a database graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sparql_endpoint_url
|
str
|
SPARQL Endpoint URL. E.g. http://localhost:3030/ds |
Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds')
|
graph_identifier
|
str
|
The IRI or URN of the graph to delete from. If not set, the default graph is targeted. |
None
|
username
|
str
|
Fuseki username, if the server requires authentication. |
None
|
password
|
str
|
Fuseki password, if the server requires authentication. |
None
|
timeout
|
int
|
Timeout per request, in seconds. |
60
|
Raises:
| Type | Description |
|---|---|
Exception
|
If the request to the database fails. |
Source code in kurra/cli/commands/db/gsp.py
clear_command ¶
clear_command(sparql_endpoint_url: str = typer.Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds'), graph_identifier: str = None, username: str = None, password: str = None, timeout: int = 60)
Clear (Remove all triples from) a database graph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sparql_endpoint_url
|
str
|
SPARQL Endpoint URL. E.g. http://localhost:3030/ds |
Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds')
|
graph_identifier
|
str
|
The IRI or URN of the graph to clear. If not set, the default graph is targeted. |
None
|
username
|
str
|
Fuseki username, if the server requires authentication. |
None
|
password
|
str
|
Fuseki password, if the server requires authentication. |
None
|
timeout
|
int
|
Timeout per request, in seconds. |
60
|
Raises:
| Type | Description |
|---|---|
Exception
|
If the request to the database fails. |
Source code in kurra/cli/commands/db/gsp.py
upload_command ¶
upload_command(path: Path = typer.Argument(..., help='The path of a file or directory of files to be uploaded.'), sparql_endpoint: str = typer.Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds'), graph_identifier: str | None = None, username: str = None, password: str = None, timeout: int = 60, disable_ssl_verification: bool = False, host_header: str | None = None) -> None
Upload a file or a directory of files with an RDF file extension.
File extensions: [.nt, .nq, .ttl, .trig, .json, .jsonld, .xml]
Files are uploaded into their own named graph in the format:
<urn:file:{file.name}>
E.g. <urn:file:example.ttl>
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The path of a file or directory of files to upload. |
Argument(..., help='The path of a file or directory of files to be uploaded.')
|
sparql_endpoint
|
str
|
SPARQL Endpoint URL. E.g. http://localhost:3030/ds |
Argument(..., help='SPARQL Endpoint URL. E.g. http://localhost:3030/ds')
|
graph_identifier
|
str | None
|
The IRI or URN of the graph to upload into. If set to "file", each file is uploaded into its own |
None
|
username
|
str
|
Fuseki username, if the server requires authentication. |
None
|
password
|
str
|
Fuseki password, if the server requires authentication. |
None
|
timeout
|
int
|
Timeout per request, in seconds. |
60
|
disable_ssl_verification
|
bool
|
If True, disable SSL certificate verification. |
False
|
host_header
|
str | None
|
A value to send as the Host header, overriding the one derived from |
None
|
Raises:
| Type | Description |
|---|---|
Exception
|
If uploading any file fails. |
Source code in kurra/cli/commands/db/gsp.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | |