rdflib provides an abstracted Store API for persistence of RDF and Notation 3. The Graph class works with instances of this API (as the first argument to its constructor) for triple-based management of an RDF store including: garbage collection, transaction management, update, pattern matching, removal, length, and database management (open() / close() / destroy()).

Additional persistence mechanisms can be supported by implementing this API for a different store.

Currently supported stores

  • Random access memory
  • Sleepycat (via Python’s bsddb or bsddb3 packages)


Store instances can be created with the plugin() function:

from rdflib import plugin
from import Store
plugin.get('.. one of the supported Stores ..',Store)(identifier=.. id of conjunctive graph ..)

Additional store plugins in rdfextras

  • Berkeley DB
  • MySQL
  • PostgreSQL
  • Redland RDF Application Framework
  • SQLite
  • Zope Object Database (ZODB3)

Table Of Contents

Previous topic


Next topic

Persisting Notation 3 Terms

This Page