4Suite™ API Documentation

# ► Module Ft.Rdf.Drivers.BerkeleyDB

A persistent RDF model driver using Berkeley (BSD) database files
This driver implements 4RDF in the same structural format as SQL.py,
but applies this interface on top of the embedded Berkeley DB.
Requires pybsddb (http://pybsddb.sourceforge.net/bsddb3.html), which is
the standard bsddb module in Python 2.3 and up. However, even if you are
using Python 2.3 up, it is possible that you won't have a functioning
bsddb at all, or it may be wrapping the db185 Berkeley DB C libraries.
If necessary, update your C libs (db4+ preferred for compatibility with
Berkeley DB XML). And if possible, upgrade or install pybsddb (this is
mandatory on Python 2.2, if you want this driver to work).
Copyright 2005 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/

Classes: DbAdapter |  |  |  | Functions: CreateDb, DestroyDb, ExistsDb, GetDb, InitializeModule, addStatementPartCondition |  |  |  | Fields: OBJECT_TYPE_UNKNOWN, STATEMENTS_TABLE_NAME, STATEMENT_PARTS, VERSION

## Classes

class DbAdapter

### Methods

__init__(self, modelName, db=None)
add(self, statements)
begin(self)
bind(self, object_, name, scope)
commit(self)
complete(self, subject, predicate, object_, statementUri, scope, flags)
contains(self, subject, predicate, object_, statementUri, scope, flags)
has_key(self, name, scope)
isResource(self, res)
keys(self, scope)
lookup(self, name, scope)
objectsFromSubAndPreds(self, subject, predicates, scope)
Get a list of obejcts with the given predicates and subject
objectsFromSubsAndPred(self, subjects, predicate, scope)
Get a list of obejcts with the given predicate and subjects
objectsFromSubsAndPredNonDistinct(self, subjects, predicate, scope)
Get a list of *non-distinct* objects with the given predicate and subjects
remove(self, statements)
removePattern(self, subject, predicate, object_, statementUri, scope, flags)
resources(self, scope)
rollback(self)
size(self, scope)
subjectsFromPredAndObjs(self, predicate, objects, scope)
Get a list of resources with the given predicate and object
subjectsFromPredsAndObj(self, predicates, object_, scope)
unbind(self, name, scope)

## Functions

CreateDb(modelName='default')
DestroyDb(modelName='default')
ExistsDb(modelName='default')
GetDb(modelName='default')
InitializeModule()
Post-import hook to initialize module's runtime variables that are not required at import time, but will be needed before the module-level functions are called.
addStatementPartCondition(conditions, stmtPart, value, flags=None)

## Fields

OBJECT_TYPE_UNKNOWN = '?'
STATEMENTS_TABLE_NAME = 'ftrdf_statements'
STATEMENT_PARTS = ['subject', 'predicate', 'object', 'statementUri', 'scope', 'otype']
VERSION = '0.1'