Labels¶
kurra.labels
¶
These functions are used to find RDF elements in a given scope that are missing labels and the to acquire them from either KurrawongAI's 'Semantic Background' dataset or other, provided, context.
find_missing_labels(p: Path | str | Graph, local_context: Path | Graph = None) -> set[URIRef]
¶
Finds all the IRIs in a graph missing labels.
If local_context is supplied - and it must be a Path to an RDF file or directory of RDF files or a Graph - then labels from that context will be used too.
Source code in kurra/labels.py
get_missing_labels(iris: list[URIRef], context: Graph | str | Path = 'https://fuseki.dev.kurrawong.ai/semback/sparql', return_type: Literal['graph', 'dict'] = 'graph', http_client: httpx.Client = None) -> Graph | dict[URIRef, str]
¶
Gets labels for given IRIs from a given context