Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A pure Python package providing the core RDF constructs.

Project description

A pure Python package providing the core RDF constructs.

The packages is intended to provide the core RDF types and interfaces that other packages can build on. The package defines a plugin interface for parsers, stores, and serializers that other packages can use to implement parsers, stores, and serializers that will plug into the rdf package.

The rdf package does not itself contain any plugin implementation. So, you will want to install a library that builds upon rdf and defines some plugin implementations. One such library is rdflib version 3.x.

The primary interface rdf exposes to work with RDF is rdf.graph.Graph.

A tiny example:

>>> from rdf.graph import Graph
>>> g = Graph()
>>> result = g.parse("")
>>> print "graph has %s statements." % len(g)
graph has 34 statements.
>>> for s, p, o in g:
...     if (s, p, o) not in g:
...         raise Exception("It better be!")
>>> s = g.serialize(format='n3')

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rdf, version 0.9a6
Filename, size File type Python version Upload date Hashes
Filename, size rdf-0.9a6-py2.5.egg (86.8 kB) File type Egg Python version 2.5 Upload date Hashes View
Filename, size rdf-0.9a6.tar.gz (48.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page