plugins Package

plugins Package

Default plugins for rdflib.

This is a namespace package and contains the default plugins for rdflib.

memory Module

class rdflib.plugins.memory.Memory(configuration=None, identifier=None)[source]

Bases: rdflib.store.Store

An in memory implementation of a triple store.

This triple store uses nested dictionaries to store triples. Each triple is stored in two such indices as follows spo[s][p][o] = 1 and pos[p][o][s] = 1.

Authors: Michel Pelletier, Daniel Krech, Stefan Niederhauser

__init__(configuration=None, identifier=None)[source]
__len__(context=None)[source]
__module__ = 'rdflib.plugins.memory'
add(triple, context, quoted=False)[source]

Add a triple to the store of triples.

bind(prefix, namespace)[source]
namespace(prefix)[source]
namespaces()[source]
prefix(namespace)[source]
remove(triple_pattern, context=None)[source]
triples(triple_pattern, context=None)[source]

A generator over all the triples matching

class rdflib.plugins.memory.IOMemory(configuration=None, identifier=None)[source]

Bases: rdflib.store.Store

An integer-key-optimized context-aware in-memory store.

Uses three dict indices (for subjects, objects and predicates) holding sets of triples. Context information is tracked in a separate dict, with the triple as key and a dict of {context: quoted} items as value. The context information is used to filter triple query results.

Memory usage is low due to several optimizations. RDF nodes are not stored directly in the indices; instead, the indices hold integer keys and the actual nodes are only stored once in int-to-object and object-to-int mapping dictionaries. A default context is determined based on the first triple that is added to the store, and no context information is actually stored for subsequent other triples with the same context information.

Most operations should be quite fast, but a triples() query with two bound parts requires a set intersection operation, which may be slow in some cases. When multiple contexts are used in the same store, filtering based on context has to be done after each query, which may also be slow.

__init__(configuration=None, identifier=None)[source]
__len__(context=None)[source]
__module__ = 'rdflib.plugins.memory'
add(triple, context, quoted=False)[source]
add_graph(graph)[source]
bind(prefix, namespace)[source]
context_aware = True
contexts(triple=None)[source]
formula_aware = True
graph_aware = True
namespace(prefix)[source]
namespaces()[source]
prefix(namespace)[source]
remove(triplepat, context=None)[source]
remove_graph(graph)[source]
triples(triplein, context=None)[source]

sleepycat Module

class rdflib.plugins.sleepycat.Sleepycat(configuration=None, identifier=None)[source]

Bases: rdflib.store.Store

__init__(configuration=None, identifier=None)[source]
__len__(context=None)[source]
__module__ = 'rdflib.plugins.sleepycat'
add(triple, context, quoted=False, txn=None)[source]

Add a triple to the store of triples.

add_graph(graph)[source]
bind(prefix, namespace)[source]
close(commit_pending_transaction=False)[source]
context_aware = True
contexts(triple=None)[source]
db_env = None
formula_aware = True
graph_aware = True
identifier
is_open()[source]
namespace(prefix)[source]
namespaces()[source]
open(path, create=True)[source]
prefix(namespace)[source]
remove(spo, context, txn=None)[source]
remove_graph(graph)[source]
sync()[source]
transaction_aware = False
triples(spo, context=None, txn=None)[source]

A generator over all the triples matching