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("http://eikeon.com/foaf.rdf")
>>> 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.

Filename, size & hash SHA256 hash help File type Python version Upload date
rdf-0.9a6-py2.5.egg (86.8 kB) Copy SHA256 hash SHA256 Egg 2.5
rdf-0.9a6.tar.gz (48.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page