4Suite™ API Documentation

# ► Module Ft.Rdf.Drivers.Psyco

A persistent RDF model driver using the PsycoPG adapter for PostgreSQL
See http://initd.org/projects/psycopg1
Copyright 2005 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/

Classes: DbAdapter |  |  |  | Functions: ConnectStringToDict, CreateDb, DestroyDb, ExistsDb, GetDb, InitializeModule, MapObjectType, ProcessFlags, SplitUri, dec_utf8 |  |  |  | Fields: CREATE_DDL, CREATE_FUNCS, DESTROY_DDL, FLAG_DICT, HTTPPLUS_PATTERN, MAILTO_PATTERN, OBJECT_TYPE_LITERAL, OBJECT_TYPE_RESOURCE, OBJECT_TYPE_UNKNOWN, QUICK_TEST, RDF_MS_BASE, UUID_PATTERN

## Classes

class DbAdapter

### Methods

__init__(self, connString, modelName='default', db=None)
add(self, statements)
####### Legacy API #######
begin(self)
commit(self)
complete(self, subject, predicate, object, statementUri, domain, flags)
contains(self, subject, predicate, object, statementUri, domain, flags)
isResource(self, res)
objectsFromSubAndPreds(self, subject, predicates, scope=None)
remove(self, statements)
removePattern(self, subject, predicate, object, statementUri, domain, flags)
resources(self)
rollback(self)
size(self, domain=None)
subjectsFromPredAndObjs(self, predicate, objects, scope=None)
subjectsFromPredsAndObj(self, predicates, object, scope=None)
####### Versa API #######

## Functions

ConnectStringToDict(connStr)
CreateDb(connString, modelName='default')
DestroyDb(connString, modelName='default')
ExistsDb(connString, modelName='default')
GetDb(connStr, 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.
MapObjectType(ot)
ProcessFlags(flags)
flags is a dict. keys are subjectFlags, predicateFlags, objectFlags, statementUriFlags and domainFlags values are Model.NORMAL, Model.IGNORE_CASE and Model.REGEX
SplitUri(uri)
dec_utf8 = lambda(x)

## Fields

CREATE_DDL = 'CREATE TABLE %(model)sUriHead (\nID integer prim...AclIdent (Name);\nCOMMIT; VACUUM ANALYZE; BEGIN;\n\n'
CREATE_FUNCS = "CREATE FUNCTION %(model)s_rlookup_func (int4)\n ... WHERE STR.id = $2 OR R.id = $2;'\nLANGUAGE 'sql'\n"
DESTROY_DDL = 'DROP TABLE %(model)sUriHead;\nDROP TABLE %(model)...gLiteralIDX;\n--DROP INDEX %(model)sACLIdentName;\n'
FLAG_DICT = {0: '=', 2: '~', 3: '~*'}
HTTPPLUS_PATTERN = <_sre.SRE_Pattern object>
Compiled regular expression objects
MAILTO_PATTERN = <_sre.SRE_Pattern object>
Compiled regular expression objects
OBJECT_TYPE_LITERAL = 'L'
OBJECT_TYPE_RESOURCE = 'R'
OBJECT_TYPE_UNKNOWN = '?'
QUICK_TEST = "RDF_FILE = 'w3c1.rdf'\nfrom Ft.Rdf.Drivers import...Map=NSMAP)\nprint r\nprint Util.VersaDataToXml(r)\n\n"
RDF_MS_BASE = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
UUID_PATTERN = <_sre.SRE_Pattern object>
Compiled regular expression objects