Loader¶
kgm.loader
¶
Either creates an n-quads files containing the content of a Manifest file or uploads the content to Fuseki.
It creates:
- A Named Graph for each resource using the item's IRI as the graph IRI
- A Named Graph for the catalogue, either using the catalogue's IRI as the graph IRI + "-catalogue" if given, or by making one up - a Blank Node
- All the triples in resources with roles mrr:CompleteCatalogueAndResourceLabels & mrr:IncompleteCatalogueAndResourceLabels within a Named Graph with IRI https://background
- An Olis Virtual Graph, https://olis.dev/VirtualGraph object using the catalogue IRI, if give, which is as an alias for all the Named Graphs from 1., 2. & 3.
- Multiple entries in the System Graph - Named Graph with IRI https://olis.dev/SystemGraph - for each Named and the Virtual Graph from 1., 2. & 3.
Run this script with the -h flag for more help, i.e. ~$ python loader.py -h
load(manifest: Path | tuple[Path, Path, Graph], sparql_endpoint: str = None, sparql_username: str = None, sparql_password: str = None, timeout: int = 60, destination_file: Path = None, return_data_type: ReturnDatatype = ReturnDatatype.none) -> None | Graph | Dataset
¶
Loads a catalogue of data from a Manifest file, whose content are valid according to the KGM Model (https://kurrawong.github.io/prez.dev/manifest/) either into a specified quads file in the Trig format, or into a given SPARQL Endpoint.