Skip to main content

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.

Source Distribution

rdf-0.9a6.tar.gz (48.5 kB view hashes)

Uploaded source

Built Distribution

rdf-0.9a6-py2.5.egg (86.8 kB view hashes)

Uploaded 2 5

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page