RDFLib is a Python library for working with RDF,[2] a simple yet powerful language for representing information.
The core class in RDFLib is Graph which is a Python dictionary used to store collections of RDF triples in memory.
RDFLib graphs emulate container types and are best thought of as a set of 3-item triples: RDFLib graphs are not sorted containers; they have ordinary Python set operations, e.g. add() methods that search triples and return them in arbitrary order.
RDFLIb supports a majority of the current SPARQL 1.1 specification and includes a harness for the publicly available RDF DAWG test suite.
The motivation is to outline a standard set of interfaces for providing the necessary support needed in order to persist an RDF Graph in a way that is universal and not tied to any specific implementation.
Such interfaces are standard to most database management systems (Oracle, MySQL, Berkeley DB, Postgres, etc..) The following methods are defined to provide this capability: The configuration string is understood by the store implementation and represents all the necessary parameters needed to locate an individual instance of a store.
An RDF store could provide a standard set of interfaces for the manipulation, management, and/or retrieval of its contained triples (asserted or quoted): This function can be thought of as the primary mechanism for producing triples with nodes that match the corresponding terms and term pattern provided.
Formulae are represented formally by the 'QuotedGraph' class and disjoint from regular RDF graphs in that their statements are quoted.
Currently supported databases: Store instances can be created with the plugin function: There are a few high-level APIs that extend RDFLib graphs into other Pythonic idioms.