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

Type IOMemory

object --+    
         |    
   Backend --+
             |
            IOMemory


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

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 backends consume more memory size than non context backends.
Method Summary
  __init__(self, default_context)
  __len__(self, context)
  add(self, triple, context)
Add a triple to the store.
  addContext(self, context)
Add context w/o adding statement.
  bind(self, prefix, namespace)
  contexts(self, triple)
  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)
  remove_context(self, context)
  triples(self, triple, context)
A generator over all the triples matching
  uniqueObjects(self, context)
  uniquePredicates(self, context)
  uniqueSubjects(self, context)
    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)

Method Details

add(self, triple, context=None)

Add a triple to the store.

addContext(self, context)

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

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

Generated by Epydoc 2.1 on Wed Jun 29 09:50:16 2005 http://epydoc.sf.net