Label commands¶
kurra.cli.commands.labels ¶
CLI commands for managing RDF labels.
find_command ¶
find_command(f: str = typer.Argument(..., help='The RDF file to fine IRIs missing labels within'), local_context: str = typer.Option(None, '--local-context', '-l', help='An RDF file or directory of RDF files containing labels')) -> None
Print every IRI in an RDF file or directory that is missing an rdfs:label.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f
|
str
|
The RDF file or directory of RDF files to scan for IRIs missing labels. |
Argument(..., help='The RDF file to fine IRIs missing labels within')
|
local_context
|
str
|
An RDF file or directory of files containing labels to check against, in addition to |
Option(None, '--local-context', '-l', help='An RDF file or directory of RDF files containing labels')
|
Source code in kurra/cli/commands/labels.py
get_command ¶
get_command(f: str = typer.Argument(..., help='The RDF file to fine IRIs missing labels within'), local_context: str = typer.Option(None, '--local-context', '-l', help='An RDF file or directory of RDF files containing labels'), additional_context: str = typer.Option('https://fuseki.dev.kurrawong.ai/semback/sparql', '--additional-context', '-c', help='An additional source of labels'), return_type: str = typer.Option('graph', '--return-type', '-r', help="Return RDF in the longturtle format or a printed table of IRIs and labels. Either 'graph' or 'table'")) -> None
Fetch and print labels for IRIs that are missing them from a given context (local_context) or additional context (additional_context), by default the KurrawongAI Semantic Background.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f
|
str
|
The RDF file or directory of RDF files to scan for IRIs missing labels. |
Argument(..., help='The RDF file to fine IRIs missing labels within')
|
local_context
|
str
|
An RDF file or directory of files containing labels to check against, in addition to |
Option(None, '--local-context', '-l', help='An RDF file or directory of RDF files containing labels')
|
additional_context
|
str
|
A further RDF source (file, directory, or SPARQL endpoint) to fetch missing labels from. |
Option('https://fuseki.dev.kurrawong.ai/semback/sparql', '--additional-context', '-c', help='An additional source of labels')
|
return_type
|
str
|
|
Option('graph', '--return-type', '-r', help="Return RDF in the longturtle format or a printed table of IRIs and labels. Either 'graph' or 'table'")
|
Source code in kurra/cli/commands/labels.py
context_command ¶
Generate a JSON-LD context from the labels in a given RDF file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rdf
|
Path
|
The RDF file to generate a JSON-LD context from. |
required |
local_context
|
Path | None
|
An RDF file or directory of files containing labels to source from, in addition to |
None
|