pyrple (python rdf api)

Download | Documentation | Installation | Examples & Applications | FAQ

Pyrple parses RDF/XML, N3, and N-Triples. It has in-memory storage with API-level querying, experimental marshalling, many utilities, and is small and minimally interdependent. It can do graph isomorphism testing, rule application, etc.

Source code: pyrple-2004-06-06.tar.gz (alpha)

You can also browse the source via HTTP. The hoot OWL Syntax Checker and RDFe schema-aware RDF editor are implemented using Pyrple.


Minimal whilst the API is in flux. There's some in the source documentation directory.


Requirements: Python 2.3 or later. On non-Windows boxen:

$ wget
$ tar -zxvf pyrple-2004-06-06.tar.gz
$ su -c mv pyrple-2004-06-06 /usr/lib/python2.3/site-packages/pyrple

On windows boxen:

Examples & Applications

There are some applications built on top of Pyrple which you can play around with right now:

More to come soon. For example, I've a series of utilities being worked on which includes scripts such as the following:


from pyrple import Graph, Var, Triple
from pyrple.namespaces import FOAF, VAR

QueryTriples = (Triple(VAR.someone, FOAF.knows, VAR.person), 
                Triple(VAR.person, FOAF.homepage, VAR.homepage))

def main(uri): 
   foaf = Graph(uri=uri)
   query = Graph(triples=QueryTriples)
   for result in foaf.query(query): 
      print result[], result[VAR.homepage]

if __name__=="__main__": 
   import sys

Design Features

Lightweight: small API
Modular: minimally interdependent


If you've any comments or feedback, please don't hesitate to contact me: you can either email me at, or speak to me on IRC as sbp on (on #rdfig, #sbp, and #foaf). IRC is preferred at the moment.

Waxing homepage: Sean B. Palmer
Waning homepage: Sean B. Palmer