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', use_rudof: bool = False) -> 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
|
return_type
|
Literal['basic', 'summary', 'provenance']
|
|
'basic'
|
output_format
|
Literal['table', 'rdf']
|
|
'table'
|
use_rudof
|
bool
|
If True, use Rudof if installed; otherwise warn and use pySHACL. |
False
|
Source code in kurra/cli/commands/shacl.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
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')
|