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,v 1.10 2006/06/26 12:34:13 tgauss Exp $
* @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
* 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);
* 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
* 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();
* 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);
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.
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
* Remove the given class from the super-classes of this class.
* @param object ResResource $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 Mon, 26 Jun 2006 14:25:44 +0200 by phpDocumentor 1.3.0RC6