Source for file ModelFactory.php
Documentation is available at ModelFactory.php
require_once RDFAPI_INCLUDE_DIR .
'model/DbStore.php';
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
* ModelFactory is a static class which provides methods for creating different
* types of RAP models. RAP models have to be created trough a ModelFactory
* instead of creating them directly with the 'new' operator because of RAP's
* dynamic code inclusion mechanism.
* @version $Id: fsource_model__modelModelFactory.php.html 443 2007-06-01 16:25:38Z cax $
* @author Daniel Westphal <mail at d-westphal.de>
* @author Richard Cyganiak <richard@cyganiak.de>
* You can supply a base URI
* @return object MemModel
* Returns a NamedGraphSetMem.
* You can supply a GraphSet name.
* @param string $graphSetId
require_once RDFAPI_INCLUDE_DIR .
'dataset/DatasetMem.php';
* You can supply a base URI
* @return object MemModel
require_once RDFAPI_INCLUDE_DIR .
'model/MemModel.php';
* Returns a DbModel with the database connection
* defined in constants.php.
* You can supply a base URI. If a model with the given base
* URI exists in the DbStore, it'll be opened.
* If not, a new model will be created.
* Returns a new DbModel using the database connection
* You can supply a base URI. If a model with the given base
* URI exists in the DbStore, it'll be opened.
* If not, a new model will be created.
* @param object DbStore $dbStore
if ($dbStore->modelExists($baseURI)) {
return $dbStore->getModel($baseURI);
return $dbStore->getNewModel($baseURI);
* Returns a database connection with the given parameters.
* Paramters, which are not defined are taken from the constants.php
* @param string $dbDriver
* @param string $password
function & getDbStore($dbDriver=
ADODB_DB_DRIVER, $host=
ADODB_DB_HOST, $dbName=
ADODB_DB_NAME,
$user=
ADODB_DB_USER, $password=
ADODB_DB_PASSWORD)
$dbs =
new DbStore($dbDriver, $host, $dbName,$user, $password);
* (MemModel with forward chaining inference engine)
* Configurations can be done in constants.php
* You can supply a base URI
* @return object MemModel
require_once RDFAPI_INCLUDE_DIR .
'infModel/InfModelF.php';
* (MemModel with backward chaining inference engine)
* Configurations can be done in constants.php
* You can supply a base URI
* @return object MemModel
require_once RDFAPI_INCLUDE_DIR .
'infModel/InfModelB.php';
* $modelType has to be one of the following constants:
* MEMMODEL,DBMODEL,INFMODELF,INFMODELB to create a resmodel with a new
* model from defined type.
* You can supply a base URI
* @param constant $modelType
* @return object ResModel
* Creates a ResModel that wraps an existing base model.
* @param object Model $baseModel
* @return object ResModel
require_once RDFAPI_INCLUDE_DIR .
'resModel/ResModel.php';
* $modelType has to be one of the following constants:
* MEMMODEL, DBMODEL, INFMODELF, INFMODELB to create a OntModel
* with a new model from defined type.
* $vocabulary defines the ontology language. Currently only
* RDFS_VOCABULARY is supported. You can supply a model base URI.
* @param constant $modelType
* @param constant $vocabulary
* @return object OntModel
function & getOntModel($modelType,$vocabulary, $baseURI =
null)
* Creates an OntModel that wraps an existing base model.
* $vocabulary defines the ontology language. Currently only
* RDFS_VOCABULARY is supported.
* @param object Model $baseModel
* @param constant $vocabulary
* @return object OntModel
require_once RDFAPI_INCLUDE_DIR .
'ontModel/OntModel.php';
trigger_error("Unknown vocabulary constant '$vocabulary'; only RDFS_VOCABULARY is supported", E_USER_WARNING);
$mod =
new OntModel($baseModel, $vocab_object);
* Creates a SparqlClient.
* @param String $server Link to a SPARQL endpoint.
* @return SparqlClient the SparqlClient object.
Documentation generated on Fri, 1 Jun 2007 16:49:54 +0200 by phpDocumentor 1.3.2