Source for file ModelFactory.php
Documentation is available at ModelFactory.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,v 1.10 2006/06/26 12:34:12 tgauss Exp $
* @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
include_once(RDFAPI_INCLUDE_DIR .
PACKAGE_DATASET);
* You can supply a base URI
* @return object MemModel
* 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)
return 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 .
PACKAGE_INFMODEL);
* (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 .
PACKAGE_INFMODEL);
* $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 .
PACKAGE_RESMODEL);
* $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 .
PACKAGE_ONTMODEL);
require_once(RDFAPI_INCLUDE_DIR.
'ontModel/'.
RDFS_VOCABULARY);
trigger_error("Unknown vocabulary constant '$vocabulary'; only RDFS_VOCABULARY is supported", E_USER_WARNING);
return new OntModel($baseModel, $vocab_object);
* Creates a SparqlClient.
* @param String $server Link to a SPARQL endpoint.
* @return SparqlClient the SparqlClient object.
Documentation generated on Mon, 26 Jun 2006 14:25:39 +0200 by phpDocumentor 1.3.0RC6