SHACL commands¶
kurra.cli.commands.shacl ¶
CLI commands for SHACL validation and inference.
validate_command ¶
validate_command(data: list[Path], shacl: str, hide_warnings: bool = False, advanced: bool = False, return_type: Literal['basic', 'summary', 'provenance'] = 'basic', output_format: Literal['table', 'rdf'] = 'table') -> None
Validate an RDF file, files, or directory of files against a SHACL file, directory, or registered validator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
list[Path]
|
The file, files, or directory of RDF files to be validated. |
required |
shacl
|
str
|
The file, directory of files, IRI of, or kurra ID for the SHACL graph to validate with. |
required |
hide_warnings
|
bool
|
If True, hide SHACL results of severity Warning and Info. |
False
|
advanced
|
bool
|
If True, enable SHACL Advanced Features (SHACL Rules, SPARQL-based constraints/targets/functions). |
False
|
summary
|
If True, print a summary table instead of the full validation results. |
required | |
output_format
|
Literal['table', 'rdf']
|
|
'table'
|
Source code in kurra/cli/commands/shacl.py
listv_command ¶
Print a table of all known SHACL validators with ID, Name, IRI, and nested validator dependency rows.
Source code in kurra/cli/commands/shacl.py
syncv_command ¶
Refresh the local SHACL validator cache from the KurrawongAI Semantic Background.
Source code in kurra/cli/commands/shacl.py
infer_command ¶
infer_command(data: str = typer.Argument(..., help='The path of file to apply the rules to. Turtle files ending .ttl only'), rules: str = typer.Argument(..., help='The path of the file containing the rules to apply to the data. SHACL Rules ending .srl only'), include_base: str = typer.Option('false', '--include-base', '-ib', help='whether to include the data triples in output'))
Infer new triples from RDF data using a SHACL Rules (SRL) file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
str
|
The path to a Turtle ( |
Argument(..., help='The path of file to apply the rules to. Turtle files ending .ttl only')
|
rules
|
str
|
The path to a SHACL Rules ( |
Argument(..., help='The path of the file containing the rules to apply to the data. SHACL Rules ending .srl only')
|
include_base
|
str
|
Whether to include the original data triples in the output, as the string |
Option('false', '--include-base', '-ib', help='whether to include the data triples in output')
|