Class DbStore

Description

DbStore is a persistent store of RDF data using relational database technology.

DbStore uses ADOdb Library for PHP V3.60 (http://php.weblogs.com/ADODB), which allows to connect to multiple databases in a portable manner. This class also provides methods for creating tables for MsAccess, MySQL, and MS SQL Server. If you want to use other databases, you will have to create tables by yourself according to the abstract database schema described in the API documentation.



History:

  • access: public
  • author: Radoslaw Oldakowski <radol@gmx.de>
  • version: V0.9.1

Located in /model/DbStore.php (line 30)

Object
   |
   --DbStore
Method Summary
DbStore DbStore ([string $dbDriver = ADODB_DB_DRIVER], [string $host = ADODB_DB_HOST], [string $dbName = ADODB_DB_NAME], [string $user = ADODB_DB_USER], [string $password = ADODB_DB_PASSWORD])
void close ()
void createTables (string $databaseType)
object DbModel getModel (string $modelURI)
object DbModel getNewModel (string $modelURI, [string $baseURI = NULL])
void isSetup ([string $databaseType = "MySQL"])
array listModels ()
boolean modelExists (string $modelURI)
boolean putModel (object Model &$model, [string $modelURI = NULL])
Methods
Constructor DbStore (line 52)

Constructor: Set the database connection with the given parameters.

  • access: public
DbStore DbStore ([string $dbDriver = ADODB_DB_DRIVER], [string $host = ADODB_DB_HOST], [string $dbName = ADODB_DB_NAME], [string $user = ADODB_DB_USER], [string $password = ADODB_DB_PASSWORD])
  • string $dbDriver
  • string $host
  • string $dbName
  • string $user
  • string $password
close (line 233)

Close the DbStore.

!!! Warning: If you close the DbStore all active instances of DbModel from this !!! DbStore will lose their database connection !!!

  • access: public
void close ()
createTables (line 85)

Create tables and indexes for the given database type.

Currently supported: MsAccess and MySQL. If you want to use other databases, you will have to create tables by yourself according to the abstract <a href="database_schema.html">database schema</a> described in the API documentation.

  • access: public
  • throws: PhpError
void createTables (string $databaseType)
  • string $databaseType
getModel (line 159)

Create a new instance of DbModel with the given $modelURI and load the corresponding values of modelID and baseURI from the database.

Return FALSE if the DbModel does not exist.

  • access: public
object DbModel getModel (string $modelURI)
  • string $modelURI
getNewModel (line 183)

Create a new instance of DbModel with the given $modelURI and insert the DbModel variables into the database.

Return FALSE if there is already a model with the given URI.

  • access: public
  • throws: SqlError
object DbModel getNewModel (string $modelURI, [string $baseURI = NULL])
  • string $modelURI
  • string $baseURI
isSetup (line 354)

Checks if tables are setup for RAP

  • access: public
  • throws: SqlError
void isSetup ([string $databaseType = "MySQL"])
  • string $databaseType
listModels (line 108)

List all DbModels stored in the database.

  • access: public
  • throws: SqlError
array listModels ()
modelExists (line 137)

Check if the DbModel with the given modelURI is already stored in the database

  • access: public
  • throws: SqlError
boolean modelExists (string $modelURI)
  • string $modelURI
putModel (line 209)

Store a MemModel or another DbModel from a different DbStore in the database.

Return FALSE if there is already a model with modelURI matching the modelURI of the given model.

  • access: public
boolean putModel (object Model &$model, [string $modelURI = NULL])

Inherited Methods

Inherited From Object

Object::toString()

Documentation generated on Fri, 17 Dec 2004 16:14:39 +0100 by phpDocumentor 1.3.0RC3