function testGetOntModelForBaseModel()
 {
     $baseModel = ModelFactory::getDefaultModel();
     $resModel = ModelFactory::getOntModelForBaseModel($baseModel, RDFS_VOCABULARY);
     $this->assertIsEmptyResModel($resModel, 'OntModel');
     $this->addAStatement($baseModel);
     $this->assertIdentical(1, $resModel->size());
 }
Example #2
0
 /** 
  * Returns an OntModel.
  * $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
  * @param   	string  	$baseURI
  * @return	object		OntModel
  * @access	public
  */
 function &getOntModel($modelType, $vocabulary, $baseURI = null)
 {
     switch ($modelType) {
         case DBMODEL:
             $baseModel = ModelFactory::getDefaultDbModel($baseURI);
             break;
         case INFMODELF:
             $baseModel = ModelFactory::getInfModelF($baseURI);
             break;
         case INFMODELB:
             $baseModel = ModelFactory::getInfModelB($baseURI);
             break;
         default:
             $baseModel = ModelFactory::getMemModel($baseURI);
     }
     return ModelFactory::getOntModelForBaseModel($baseModel, $vocabulary);
 }
Example #3
0
 /**
  * Returns an OntModel with this model as baseModel.
  * $vocabulary has to be one of the following constants (currently only one is supported):
  * RDFS_VOCABULARY to select a RDFS Vocabulary.
  *
  * This is the same as ModelFactory::getOntModelForBaseModel($this, $vocabulary).
  *
  * @param   constant  $vocabulary
  * @return	object	OntModel
  * @access	public
  */
 function &getOntModel($vocabulary)
 {
     return ModelFactory::getOntModelForBaseModel($this, $vocabulary);
 }