Class SparqlEngineDb

Description

SPARQL engine optimized for databases.

Generates SQL statements to directly query the database, letting the database system do all the hard work like selecting, joining, filtering and ordering results.

Located in /sparql/SparqlEngineDb.php (line 18)


	
			
Variable Summary
Method Summary
SparqlEngineDb __construct ( $model)
mixed execute (array $arVariables, [string $resultform = false])
void getQuery ()
void getSqlGenerator ()
void getTypeSorter ()
mixed queryDb (array $arSql,  $nOffset,  $nLimit)
array/string queryModel ( $dataset, Query $query, [string $resultform = false])
array queryMultiple (array $arSqls)
Variables
array $arPrepared = null (line 50)

Prepared SQL statements are stored in here.

  • access: protected
boolean $bRealPrepared = false (line 56)

If the prepared statement is really prepared, or if we just emulate it.

  • access: protected
Dataset $dataset (line 31)

RDF dataset object.

  • access: protected
ADOConnection $dbConn (line 37)

Database connection object.

  • access: protected
int $modelID (line 44)

Internal ID for our graph model.

Stored in the database along the statements.

  • access: protected
SparqlEngineDb_Preparator $pr = null (line 74)

Prepared statments preparator instance

  • access: protected
Query $query (line 25)

Sparql Query object.

  • access: protected
SparqlEngineDb_SqlGenerator $sg = null (line 62)

SQL generator instance

  • access: protected
SparqlEngineDb_TypeSorter $ts = null (line 68)

Type sorting instance

  • access: protected
Methods
Constructor __construct (line 81)

Use SparqlEngine::factory() to create the instance

  • access: public
SparqlEngineDb __construct ( $model)
execute (line 189)

Execute a prepared statement by filling it with variables

  • return: Result according to $resultform
  • access: public
mixed execute (array $arVariables, [string $resultform = false])
  • array $arVariables: Array with (variable name => value) pairs
  • string $resultform: Which form the result should have
getQuery (line 329)
  • access: public
void getQuery ()
getSqlGenerator (line 336)
  • access: public
void getSqlGenerator ()
getTypeSorter (line 343)
  • access: public
void getTypeSorter ()
prepare (line 142)

Create a prepared statement that can be executed later.

  • return: Prepared statment that can be execute()d later.
  • access: public
SparqlEngineDb_PreparedStatement prepare ( $dataset, Query $query)
  • Dataset $dataset: RDF Dataset
  • Query $query: Parsed SPARQL query
queryDb (line 287)

Sends the sql to the database and returns the results.

  • return: Anything ADOConnection::Execute() may return
  • throws: Exception If Database query does not work
mixed queryDb (array $arSql,  $nOffset,  $nLimit)
  • array $arSql: Array that gets a SQL query string once imploded
  • $nOffset
  • $nLimit
queryModel (line 102)

Query the database with the given SPARQL query.

  • return: array of triple arrays, or XML. Format depends on $resultform parameter.
  • access: public
array/string queryModel ( $dataset, Query $query, [string $resultform = false])
  • Dataset $dataset: RDF Dataset
  • Query $query: Parsed SPARQL query
  • string $resultform: Result form. If set to 'xml' the result will be SPARQL Query Results XML Format as described in http://www.w3.org/TR/rdf-sparql-XMLres/ .
queryMultiple (line 235)

Executes multiple SQL queries and returns an array of results.

  • return: Array of query results
  • access: protected
array queryMultiple (array $arSqls)
  • array $arSqls: Array of SQL queries

Documentation generated on Fri, 1 Jun 2007 16:52:08 +0200 by phpDocumentor 1.3.2