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.

Documentation

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

Installation

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

$ wget http://infomesh.net/pyrple/pyrple-2004-06-06.tar.gz
$ 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:

#!/usr/bin/python

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

QueryTriples = (Triple(VAR.someone, FOAF.knows, VAR.person), 
                Triple(VAR.person, FOAF.name, VAR.name), 
                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[VAR.name], result[VAR.homepage]

if __name__=="__main__": 
   import sys
   main(sys.argv[1])

Design Features

Lightweight: small API
Modular: minimally interdependent

FAQ

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

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