Package rdflib :: Package store :: Module IOMemory :: Class IOMemory
[show private | hide private]
[frames | no frames]

Type IOMemory

object --+    
         |    
     Store --+
             |
            IOMemory


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

Uses nested dictionaries to store triples and context. Each triple is stored in six such indices as follows cspo[c][s][p][o] = 1 and cpos[c][p][o][s] = 1 and cosp[c][o][s][p] = 1 as well as spo[s][p][o] = [c] and pos[p][o][s] = [c] and pos[o][s][p] = [c]

Context information is used to track the 'source' of the triple data for merging, unmerging, remerging purposes. context aware store stores consume more memory size than non context stores.
Method Summary
  __init__(self, configuration, identifier)
identifier: URIRef of the Store.
  __len__(self, context)
Number of statements in the store.
  add(self, triple, context, quoted)
Add a triple to the store.
  addContext(self, context)
Add context w/o adding statement.
  bind(self, prefix, namespace)
  contexts(self, triple)
Generator over all contexts in the graph.
  createForward(self)
  createIndex(self)
  createPrefixMap(self)
  createReverse(self)
  defaultContext(self)
  identifierToInt(self, (s, p, o))
Resolve an identifier triple into integers.
  intToIdentifier(self, (si, pi, oi))
Resolve an integer triple into identifers.
  namespace(self, prefix)
  namespaces(self)
  prefix(self, namespace)
  remove(self, triple, context)
  triples(self, triple, context)
A generator over all the triples matching
  uniqueObjects(self, context)
  uniquePredicates(self, context)
  uniqueSubjects(self, context)
  _removeNestedIndex(self, index, *keys)
Remove context from the list of contexts in a nested index.
  _setNestedIndex(self, index, *keys)
    Inherited from Store
  addN(self, quads)
Adds each item in the list of statements to a specific context.
  close(self, commit_pending_transaction)
This closes the database connection.
  commit(self)
  create(self, configuration)
  destroy(self, configuration)
This destroys the instance of the store identified by the configuration string.
  gc(self)
Allows the store to perform any needed garbage collection
  open(self, configuration, create)
Opens the store specified by the configuration string.
  rollback(self)
  triples_choices(self, (subject, predicate, object_), context)
A variant of triples that can take a list of terms instead of a single term in any slot.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Property Summary
    Inherited from Store
  node_pickler

Class Variable Summary
bool context_aware = True
bool formula_aware = True
    Inherited from Store
bool transaction_aware = False

Method Details

__init__(self, configuration=None, identifier=None)
(Constructor)

identifier: URIRef of the Store. Defaults to CWD configuration: string containing infomation open can use to connect to datastore.
Overrides:
rdflib.store.Store.__init__ (inherited documentation)

__len__(self, context=None)
(Length operator)

Number of statements in the store. This should only account for non-quoted (asserted) statements if the context is not specified, otherwise it should return the number of statements in the formula or context given.
Overrides:
rdflib.store.Store.__len__ (inherited documentation)

add(self, triple, context, quoted=False)

Add a triple to the store.
Overrides:
rdflib.store.Store.add

addContext(self, context)

Add context w/o adding statement. Dan you can remove this if you want

contexts(self, triple=None)

Generator over all contexts in the graph. If triple is specified, a generator over all contexts the triple is in.
Overrides:
rdflib.store.Store.contexts (inherited documentation)

identifierToInt(self, (s, p, o))

Resolve an identifier triple into integers.

intToIdentifier(self, (si, pi, oi))

Resolve an integer triple into identifers.

triples(self, triple, context=None)

A generator over all the triples matching
Overrides:
rdflib.store.Store.triples

_removeNestedIndex(self, index, *keys)

Remove context from the list of contexts in a nested index.

Afterwards, recursively remove nested indexes when they became empty.

Class Variable Details

context_aware

Type:
bool
Value:
True                                                                   

formula_aware

Type:
bool
Value:
True                                                                   

Generated by Epydoc 2.1 on Wed Apr 4 16:05:45 2007 http://epydoc.sf.net