Source for file OntProperty.php
Documentation is available at OntProperty.php
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
* Class encapsulating a property in an ontology.
* @version $Id: fsource_ontModel__ontModelOntProperty.php.html 443 2007-06-01 16:25:38Z cax $
* @author Daniel Westphal <mail at d-westphal dot de>
* Add a resource representing the domain of this property.
* @param object ResResource $resResource
return $this->addProperty($this->vocabulary->DOMAIN(),$resResource);
* Add a resource representing the range of this property.
* @param object ResResource $resResource
return $this->addProperty($this->vocabulary->RANGE(),$resResource);
* Add a sub-property of this property.
* @param object ResProperty $resProperty
return $resProperty->addProperty($this->vocabulary->SUB_PROPERTY_OF(),$this);
* Add a super-property of this property.
* @param object ResProperty $resProperty
return $this->addProperty($this->vocabulary->SUB_PROPERTY_OF(),$resProperty);
* Answer a OntClass that represents the domain class of this property.
* If there is more than one such resource, an arbitrary selection is made.
* @return object OntClass
* Answer a OntClass that represents the range class of this property.
* If there is more than one such resource, an arbitrary selection is made.
* @return object OntClass
* Answer a property that is the sub-property of this property.
* If there is more than one such property, an arbitrary selection is made.
* @return object OntProperty
$statement =
$this->model->findFirstMatchingStatement(null,$this->vocabulary->SUB_PROPERTY_OF(),$this);
* Answer a property that is the super-property of this property.
* If there is more than one such property, an arbitrary selection is made.
* @return object OntProperty
return $this->getPropertyValue($this->vocabulary->SUB_PROPERTY_OF(),'OntProperty');
* Answer true if the given resource a class specifying the domain of this property.
* @param object ResResource $resResource
return $this->hasProperty($this->vocabulary->DOMAIN(),$resResource);
* Answer true if the given resource a class specifying the range of this property.
* @param object ResResource $resResource
return $this->hasProperty($this->vocabulary->RANGE(),$resResource);
* Answer true if the given property is a sub-property of this property.
* If $direct is set to true, only consider the direcly adjacent
* properties in the property hierarchy
* @param object ResResource $resProperty
return $resProperty->hasProperty($this->vocabulary->SUB_PROPERTY_OF(),$this);
return ($this->_getSubAttributeStatementsRec($this,$this->vocabulary->SUB_PROPERTY_OF(),$index,$resProperty) ===
true);
* Answer true if the given property is a super-property of this property.
* If $direct is set to true, only consider the direcly adjacent
* properties in the property hierarchy
* @param object ResResource $resProperty
return $this->hasProperty($this->vocabulary->SUB_PROPERTY_OF(),$resProperty);
return ($this->_getSuperAttributeStatementsRec($this,$this->vocabulary->SUB_PROPERTY_OF(),$index,$resProperty) ===
true);
* Answer an array of all of the declared domain classes of this property.
* Each element of the iterator will be an OntClass.
* @return array of OntClasses
return $this->listProperty($this->vocabulary->DOMAIN(),'OntClass');
* Answer an array of all of the declared range classes of this property.
* Each element of the iterator will be an OntClass.
* @return array of OntClasses
return $this->listProperty($this->vocabulary->RANGE(),'OntClass');
* Answer an array of all the properties that are declared to be
* sub-properties of this property. Each element of the iterator will be an
* If $direct is set to true, only consider the direcly adjacent
* properties in the property hierarchy
* @return array of OntProperties
$statements =
$this->model->find(null,$this->vocabulary->SUB_PROPERTY_OF(),$this);
$statements =
$this->_getSubAttributeStatementsRec($this,$this->vocabulary->SUB_PROPERTY_OF(),$index);
foreach ($statements as $statement)
$objectLabel=
$statement->getLabelSubject();
if (!in_array($objectLabel,$returnIndex))
$returnIndex[]=
$objectLabel;
$return[]=
new OntProperty($statement->getLabelSubject());
* Answer an array of all the properties that are declared to be
* super-properties of this property. Each element of the iterator will be an
* If $direct is set to true, only consider the direcly adjacent
* properties in the property hierarchy
* @return array of OntProperties
return $this->listProperty($this->vocabulary->SUB_PROPERTY_OF(),'OntProperty');
$statements =
$this->_getSuperAttributeStatementsRec($this,$this->vocabulary->SUB_PROPERTY_OF(),$index);
foreach ($statements as $statement)
$objectLabel=
$statement->getLabelObject();
if (!in_array($objectLabel,$returnIndex))
$returnIndex[]=
$objectLabel;
$return[]=
new OntProperty($statement->getLabelObject());
* Remove the given class from the stated domain(s) of this property.
* @param object ResResource $resResource
return $this->removeProperty($this->vocabulary->DOMAIN(),$resResource);
* Remove the given class from the stated range(es) of this property.
* @param object ResResource $resResource
return $this->removeProperty($this->vocabulary->RANGE(),$resResource);
* Remove the given property from the sub-properties of this property.
* @param object ResProperty $resProperty
return $this->model->remove(new Statement($resProperty,$this->vocabulary->SUB_PROPERTY_OF(),$this));
* Remove the given property from the super-properties of this property.
* @param object ResProperty $resProperty
return $this->removeProperty($this->vocabulary->SUB_PROPERTY_OF(),$resProperty);
* Assert that the given resource represents the class of individuals
* that form the domain of this property. Any existing domain statements
* for this property are removed.
* @param object ResResource $resResource
* Assert that the given resource represents the class of individuals
* that form the range of this property. Any existing range statements
* for this property are removed.
* @param object ResResource $resResource
* Assert that this property is super-property of the given property.
* Any existing statements for superPropertyOf on prop will be removed.
* @param object ResProperty $resProperty
* Assert that this property is sub-property of the given property.
* Any existing statements for subPropertyOf on prop will be removed.
* @param object ResProperty $resProperty
Documentation generated on Fri, 1 Jun 2007 16:50:10 +0200 by phpDocumentor 1.3.2