djangordf¶
A Django library for managing RDF data with a declarative model layer. Domain classes are written like Django models but persist as triples in a SPARQL 1.1 triple store, with built-in SKOS conventions, language-tagged literals, and a lazy queryset that mirrors Django’s manager API.
Why djangordf¶
Familiar surface.
Term.objects.create(...),Term.objects.get(iri),Term.objects.filter(...)— the manager API mirrorsdjango.db.models.RDF native. Storage is triples in a real SPARQL 1.1 store (Apache Jena Fuseki, GraphDB, Blazegraph, Stardog, or the in-process rdflib backend for tests and local development).
SKOS by default. Properties named
pref_label,broader,definition, etc. resolve to their SKOS predicates automatically; no boilerplatepredicate=arguments needed for the conventions.Language-tagged literals. First-class support for
rdf:langStringvia theLangString(value, lang)dataclass.Round-trips.
save()is idempotent and overwrites stale triples in a single SPARQL update;delete()strips every triple for the IRI.
Contents¶
- Installation
- Quickstart
- Declare a model
- Bidirectional links via
inverse= - Create, link, fetch
- Update and delete
- Query lazily
- Custom predicates and CURIE class IRIs
- The walking-skeleton example
- Dump the schema as an OWL ontology
- Importing external SKOS vocabularies
- Bulk operations and signals
- Hybrid mode: relational auth alongside RDF data
- Django admin for RDFModel
- RDF schema migrations
- Reasoning
- RDF schema migrations
- Settings
- API reference