4Suite API Documentation

Module Ft.Rdf.Drivers.Postgres

A persistent RDF model driver using the PygreSQL adapter to PostgreSQL
See http://www.postgresql.org/

Copyright 2005 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/
Classes:
Functions:
Globals:

Classes

class DbAdapter(Ft.Rdf.Drivers.SQL.SqlAdapter)

Methods

__init__(self, connString, modelName='default', db=None)
Overrides: __init__ from class SqlAdapter
begin(self)
Overrides: begin from class SqlAdapter
commit(self)
Overrides: commit from class SqlAdapter
rollback(self)
Overrides: rollback from class SqlAdapter

Methods inherited from class Ft.Rdf.Drivers.SQL.SqlAdapter

Functions

BuildObjectsFromSubAndPreds(subject, predicates, modelName, scope=None)
BuildSubjectsFromPredAndObjs(predicate, objects, modelName, scope=None)
BuildSubjectsFromPredsAndObj(predicates, object, modelName, scope=None)
CheckVersion(db, connString, modelName)
CreateDb(connString, modelName='default')
DestroyDb(connString, modelName='default')
ExistsDb(connString, modelName='default')
GetDb(dbName, 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.
SplitDbConnectString(connString)

Globals

CREATE_BOUND_TABLE = '\nCREATE TABLE ftrdf_%s_bound (\n name text,\n object varchar,\n domain text)\n'
CREATE_STATEMENT_TABLE = '\nCREATE TABLE ftrdf_%s_statement (\n subject ...\n domain text,\n otype text)\n'
INDICES = {'source': ('ftrdf_%s_statement', ['domain']), 'sp': ('ftrdf_%s_statement', ['subject', 'predicate'])}
OBJECT_TYPE_LITERAL = 'L'
OBJECT_TYPE_RESOURCE = 'R'
VERSION = '0.2'
bits = 31
complete = "SELECT subject, predicate, object, statementUri,...(statementUri)s' AND domain%(scopeOp)s'%(scope)s'"
contains = "SELECT COUNT(subject) FROM ftrdf_%(modelName)s_s...(statementUri)s' AND domain%(scopeOp)s'%(scope)s'"
key = (True, True, True, True, 1)
parts = ["subject%(subjectOp)s'%(subject)s'", "predicate%(predicateOp)s'%(predicate)s'", "object%(objectOp)s'%(object)s'", "statementUri%(statementUriOp)s'%(statementUri)s'", "domain%(scopeOp)s'%(scope)s'"]
remove = "DELETE FROM ftrdf_%(modelName)s_statement WHERE...(statementUri)s' AND domain%(scopeOp)s'%(scope)s'"
where = "subject%(subjectOp)s'%(subject)s' AND predicate%...(statementUri)s' AND domain%(scopeOp)s'%(scope)s'"