djangordf.loaders

Read-only loaders for external SKOS vocabularies. Pull GND, AAT, Wikidata, or any other RDF dump into the configured triple store under a dedicated external graph.

Read-only loaders for external SKOS vocabularies.

The generic load_skos() accepts an HTTP/HTTPS URL, a filesystem path, or an in-memory rdflib.Graph, parses it into a graph, and writes the triples into the configured triple store under a dedicated “external” named graph. Format detection falls back through an explicit format= argument, the HTTP Content-Type, and the URL extension.

The optional load_external_concept() is a thin wrapper that issues an HTTP GET with content-negotiation headers, intended for dereferencing a single SKOS / GND / AAT / Wikidata IRI.

djangordf.loaders.load_skos(source, *, backend=None, graph=None, format=None)[source]

Load triples from source into the configured backend.

source may be a filesystem path, an HTTP/HTTPS URL, or an in-memory rdflib.Graph instance. Returns the number of triples written. Triples are inserted into the configured external graph (settings.DJANGORDF_EXTERNAL_GRAPH, default urn:djangordf:external) unless graph= overrides it. The write goes through backend.add so backend-specific bulk handling applies.

Return type:

int

Parameters:
djangordf.loaders.load_external_concept(iri, *, backend=None, graph=None)[source]

Dereference a single concept IRI over HTTP and load the response into the backend. Thin wrapper around load_skos() that always speaks HTTP content negotiation.

Return type:

int

Parameters: