pySesame - a Python wrapper for Sesame

Sesame ( is an open source RDF Schema-based storage and querying facility.

pySesame is a Python wrapper for Sesame's REST HTTP API, as described in chapter 8 of the Sesame Manual. Now you can easily do the following from your Python script:

RQL, RDQL and SeRQL queries will return results as Python data structures, HTML or RDF.


pySesame at SemWebCentral.

Example usage:

>>> from pySesame import SesameConnection >>> connection = SesameConnection('', '/sesame/') >>> connection.login('test', 'pySesame') >>> connection.repositories() [{'writeable': u'true', 'readable': u'true', 'id': u'pySesame', 'title': u'pySesame Test Suite'}] >>> connection.uploadURL('pySesame', '') 1 >>> rdqlQuery = """SELECT ?date ... WHERE ... (?resource, <rdf:type>, <pstcn:Movement>), ... (?resource, <pstcn:movementType>,?value), ... (?resource, <dc:date>, ?date) ... AND (?value eq "Add") ... USING pstcn FOR <>, ... rdf for <>, ... dc for <>""" >>> connection.tableQuery('pySesame', 'RDQL', rdqlQuery) {'header': [u'date'], 'tuples': [[{'type': u'literal', 'value': u'1998-01-01T00:00:00-05:00'}]]} >>> connection.logout() Logged out successfully

Status and ToDo:

pySesame should be pretty complete. The test suite covers most, but not all of the functionality.

Outstanding issues:



Tom Hoffman, *-pike