Source for file OntClass.php
Documentation is available at OntClass.php
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
* Class that represents an ontology node characterising a class description.
* @version $Id: fsource_ontModel__ontModelOntClass.php.html 443 2007-06-01 16:25:38Z cax $
* @author Daniel Westphal <mail at d-westphal dot de>
* Add a sub-class of this class.
* @param object ResResource $resResource
return $resResource->addProperty($this->vocabulary->SUB_CLASS_OF(),$this);
* Add a super-class of this class.
* @param object ResResource $resResource
return $this->addProperty($this->vocabulary->SUB_CLASS_OF(),$resResource);
* Answer a class that is the sub-class of this class.
* If there is more than one such class, an arbitrary selection is made.
* @return object OntClass or NULL
$statement =
$this->model->findFirstMatchingStatement(null,$this->vocabulary->SUB_CLASS_OF(),$this);
return $this->model->createOntClass($statement->getLabelSubject());
* Answer a class that is the super-class of this class.
* If there is more than one such class, an arbitrary selection is made.
* @return object OntClass or NULL
* Answer true if the given class is a sub-class of this class.
* $direct - If true, only search the classes that are directly
* adjacent to this class in the class hierarchy.
* @param object ResResource $resResource
return $resResource->hasProperty($this->vocabulary->SUB_CLASS_OF(),$this);
return ($this->_getSubAttributeStatementsRec($this,$this->vocabulary->SUB_CLASS_OF(),$index,$resResource) ===
true);
* Answer true if the given class is a super-class of this class.
* $direct - If true, only search the classes that are directly
* adjacent to this class in the class hierarchy.
* @param object ResResource $resResource
return $this->hasProperty($this->vocabulary->SUB_CLASS_OF(),$resResource);
return ($this->_getSuperAttributeStatementsRec($this,$this->vocabulary->SUB_CLASS_OF(),$index,$resResource) ===
true);
* Answer an ResIterator over the individuals in the model that have this class
* @return object ResIterator
$statements= $this->model->find(null,$this->vocabulary->TYPE(),$this);
foreach ($statements as $statement)
$subjectLabel=$statement->getLabelSubject();
if (!in_array($subjectLabel,$returnIndex))
$returnIndex[]=$subjectLabel;
$return[]=$statement->getSubject();
return new ResIterator(null,$this->vocabulary->TYPE(),$this,'s',$this->model,'Individual');
* Answer an array over the classes that are declared to be sub-classes of this class.
* Each element of the array will be an OntClass.
* $direct - If true, only search the classes that are directly
* adjacent to this class in the class hierarchy.
$statements =
$this->model->find(null,$this->vocabulary->SUB_CLASS_OF(),$this);
$statements =
$this->_getSubAttributeStatementsRec($this,$this->vocabulary->SUB_CLASS_OF(),$index);
foreach ($statements as $statement)
$subjectLabel=
$statement->getLabelSubject();
if (!in_array($subjectLabel,$returnIndex))
$returnIndex[]=
$subjectLabel;
$return[]=
$this->model->createOntClass($subjectLabel);
* Answer an array over the classes that are declared to be super-classes of this class.
* Each element of the array will be an OntClass.
* $direct - If true, only search the classes that are directly
* adjacent to this class in the class hierarchy.
return $this->listProperty($this->vocabulary->SUB_CLASS_OF(),'OntClass');
$statements =
$this->_getSuperAttributeStatementsRec($this,$this->vocabulary->SUB_CLASS_OF(),$index);
foreach ($statements as $statement)
$objectLabel=
$statement->getLabelObject();
if (!in_array($objectLabel,$returnIndex))
$returnIndex[]=
$objectLabel;
$return[]=
$this->model->createOntClass($objectLabel);
* Remove the given class from the sub-classes of this class.
* @param object ResResource $resResource
return $this->model->remove(new Statement($resResource,$this->vocabulary->SUB_CLASS_OF(),$this));
* Remove the given class from the super-classes of this class.
* @param object ResResource $resResource
return $this->removeProperty($this->vocabulary->SUB_CLASS_OF(),$resResource);
* Assert that this class is super-class of the given class.
* Any existing statements for subClassOf on prop will be removed.
* @param object ResResource $resResource
* Assert that this class is sub-class of the given class.
* Any existing statements for subClassOf on prop will be removed.
* @param object ResResource $resResource
* Answer a resource that represents an instance of this OntClass and Individual
* If a resource with the given uri exists in the model, it will be re-used.
* If not, a new one is created in the updateable sub-model of the ontology model.
* @return object Individual
$instance =
$this->model->createIndividual($uri);
$instance->setInstanceRdfType($this);
Documentation generated on Fri, 1 Jun 2007 16:50:06 +0200 by phpDocumentor 1.3.2