Store implementation for RDFlib using Django models as its backend
Project description
A store implementation for rdflib that uses Django as its backend.
The current implementation is context-aware but not formula-aware. Furthermore, performance has not yet been considered.
The implementation assumes that contexts are used for named graphs.
Quick start
Install rdflib-django with your package manager:
pip install rdflib-django
Add rdflib_django to your INSTALLED_APPS:
INSTALLED_APPS = ( # other apps 'rdflib_django'. )
You can now use the following examples to obtain a graph.
Getting a graph using rdflib’s store API:
from rdflib import Graph graph = Graph('Django') graph.open(create=True)
This example will give you a graph identified by a blank node within the default store.
Getting a conjunctive graph using rdflib’s store API:
from rdflib import ConjunctiveGraph graph = ConjunctiveGraph('Django')
This example will give you a conjunctive graph in the default store.
Getting a named graph using rdflib-django’s API:
from rdflib_django import utils graph = utils.get_named_graph('http://example.com')
Getting the conjunctive graph using rdflib-django’s API:
from rdflib_django import utils graph = utils.get_conjunctive_graph()
Management commands
rdflib-django includes two management commands to import and export RDF:
$ python manage.py import_rdf --context=http://example.com my_file.rdf $ python manage.py export_rdf --context=http://example.com
License
rdflib-django is licensed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for rdflib-django-0.2.dev-201210061248.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 371d49ea8b71cafe6189e1a053973aa5968b37af2f91366b03fa4c35bc5bab65 |
|
MD5 | fedac59af321973727e7f97930b6040e |
|
BLAKE2b-256 | dd935e952f95369d4719e75a8af702bfd2d949ccdcae0ca98f6ab179d6e00857 |
Hashes for rdflib_django-0.2.dev_201210061248-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f6987f85597fdb8ecd82a5de1602946fe9c772b9fb147de2624078749d1aa41 |
|
MD5 | ab4436735c22d7caf36d7fba9fcda092 |
|
BLAKE2b-256 | 9c4e7ec6437327414487710bb8142c6fa2207bb18f37c4c09e830bb1dc138f22 |