Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.hp.hpl.jena.ontology
Interface OntProperty  view OntProperty download OntProperty.java

All Superinterfaces:
com.hp.hpl.jena.graph.FrontsNode, OntResource, com.hp.hpl.jena.rdf.model.Property, com.hp.hpl.jena.rdf.model.RDFNode, com.hp.hpl.jena.rdf.model.Resource
All Known Subinterfaces:
DatatypeProperty, FunctionalProperty, InverseFunctionalProperty, ObjectProperty, SymmetricProperty, TransitiveProperty

public interface OntProperty
extends OntResource, com.hp.hpl.jena.rdf.model.Property

Interface encapsulating a property in an ontology. This is an extension to the standard com.hp.hpl.jena.rdf.model.Property interface, adding a collection of convenience methods for accessing the additional semantic features of properties in OWL, RDFS and DAML+OIL, such as domain, range, inverse, etc. Not all such capabilities exist in all supported ontology languages.

Version:
CVS $Id: OntProperty.java,v 1.16 2005/04/11 16:41:41 ian_dickinson Exp $

Method Summary
 void addDomain(com.hp.hpl.jena.rdf.model.Resource res)
          Add a resource representing the domain of this property.
 void addEquivalentProperty(com.hp.hpl.jena.rdf.model.Property prop)
          Add a property that is equivalent to this property.
 void addInverseOf(com.hp.hpl.jena.rdf.model.Property prop)
          Add a property that this property is the inverse of.
 void addRange(com.hp.hpl.jena.rdf.model.Resource res)
          Add a resource representing the range of this property.
 void addSubProperty(com.hp.hpl.jena.rdf.model.Property prop)
          Add a sub-property of this property.
 void addSuperProperty(com.hp.hpl.jena.rdf.model.Property prop)
          Add a super-property of this property.
 DatatypeProperty asDatatypeProperty()
          Answer a view of this property as a datatype property
 FunctionalProperty asFunctionalProperty()
          Answer a view of this property as a functional property
 InverseFunctionalProperty asInverseFunctionalProperty()
          Answer a view of this property as an inverse functional property
 ObjectProperty asObjectProperty()
          Answer a view of this property as an object property
 SymmetricProperty asSymmetricProperty()
          Answer a view of this property as a symmetric property
 TransitiveProperty asTransitiveProperty()
          Answer a view of this property as a transitive property
 DatatypeProperty convertToDatatypeProperty()
          Answer a facet of this property as a datatype property, adding additional information to the model if necessary.
 FunctionalProperty convertToFunctionalProperty()
          Answer a facet of this property as a functional property, adding additional information to the model if necessary.
 InverseFunctionalProperty convertToInverseFunctionalProperty()
          Answer a facet of this property as an inverse functional property, adding additional information to the model if necessary.
 ObjectProperty convertToObjectProperty()
          Answer a facet of this property as an object property, adding additional information to the model if necessary.
 SymmetricProperty convertToSymmetricProperty()
          Answer a facet of this property as a symmetric property, adding additional information to the model if necessary.
 TransitiveProperty convertToTransitiveProperty()
          Answer a facet of this property as a transitive property, adding additional information to the model if necessary.
 OntResource getDomain()
          Answer a resource that represents the domain class of this property.
 OntProperty getEquivalentProperty()
          Answer a property that is equivalent to this property.
 OntProperty getInverse()
          Answer the property that has declared itself to be the inverse of this property, if any such property is defined.
 OntProperty getInverseOf()
          Answer a property of which this property is the inverse, if known, or null if there is no such property.
 OntResource getRange()
          Answer a resource that represents the range class of this property.
 OntProperty getSubProperty()
          Answer a property that is the sub-property of this property.
 OntProperty getSuperProperty()
          Answer a property that is the super-property of this property.
 boolean hasDomain(com.hp.hpl.jena.rdf.model.Resource res)
          Answer true if the given resource a class specifying the domain of this property.
 boolean hasEquivalentProperty(com.hp.hpl.jena.rdf.model.Property prop)
          Answer true if the given property is equivalent to this property.
 boolean hasInverse()
          Answer true if there is at least one inverse property for this property.
 boolean hasRange(com.hp.hpl.jena.rdf.model.Resource res)
          Answer true if the given resource a class specifying the range of this property.
 boolean hasSubProperty(com.hp.hpl.jena.rdf.model.Property prop, boolean direct)
          Answer true if the given property is a sub-property of this property.
 boolean hasSuperProperty(com.hp.hpl.jena.rdf.model.Property prop, boolean direct)
          Answer true if the given property is a super-property of this property.
 boolean isDatatypeProperty()
          Answer true if this property is a datatype property
 boolean isFunctionalProperty()
          Answer true if this property is a functional property
 boolean isInverseFunctionalProperty()
          Answer true if this property is an inverse functional property
 boolean isInverseOf(com.hp.hpl.jena.rdf.model.Property prop)
          Answer true if this property is the inverse of the given property.
 boolean isObjectProperty()
          Answer true if this property is an object property
 boolean isSymmetricProperty()
          Answer true if this property is a symmetric property
 boolean isTransitiveProperty()
          Answer true if this property is a transitive property
 com.hp.hpl.jena.util.iterator.ExtendedIterator listDeclaringClasses()
          Answer an iterator of all of the classes in this ontology, such that each returned class has this property as one of its properties in OntClass.listDeclaredProperties() 55 .
 com.hp.hpl.jena.util.iterator.ExtendedIterator listDeclaringClasses(boolean direct)
          Answer an iterator of all of the classes in this ontology, such that each returned class has this property as one of its properties in OntClass.listDeclaredProperties(boolean) 55 .
 com.hp.hpl.jena.util.iterator.ExtendedIterator listDomain()
          Answer an iterator over all of the declared domain classes of this property.
 com.hp.hpl.jena.util.iterator.ExtendedIterator listEquivalentProperties()
          Answer an iterator over all of the properties that are declared to be equivalent properties to this property.
 com.hp.hpl.jena.util.iterator.ExtendedIterator listInverse()
          Answer an iterator over the properties that are defined to be inverses of this property.
 com.hp.hpl.jena.util.iterator.ExtendedIterator listInverseOf()
          Answer an iterator over all of the properties that this property is declared to be the inverse of.
 com.hp.hpl.jena.util.iterator.ExtendedIterator listRange()
          Answer an iterator over all of the declared range classes of this property.
 com.hp.hpl.jena.util.iterator.ExtendedIterator listSubProperties()
          Answer an iterator over all of the properties that are declared to be sub-properties of this property.
 com.hp.hpl.jena.util.iterator.ExtendedIterator listSubProperties(boolean direct)
          Answer an iterator over all of the properties that are declared to be sub-properties of this property.
 com.hp.hpl.jena.util.iterator.ExtendedIterator listSuperProperties()
          Answer an iterator over all of the properties that are declared to be super-properties of this property.
 com.hp.hpl.jena.util.iterator.ExtendedIterator listSuperProperties(boolean direct)
          Answer an iterator over all of the properties that are declared to be super-properties of this property.
 void removeDomain(com.hp.hpl.jena.rdf.model.Resource cls)
          Remove the given class from the stated domain(s) of this property.
 void removeEquivalentProperty(com.hp.hpl.jena.rdf.model.Property prop)
          Remove the statement that this property and the given property are equivalent.
 void removeInverseProperty(com.hp.hpl.jena.rdf.model.Property prop)
          Remove the statement that this property is the inverse of the given property.
 void removeRange(com.hp.hpl.jena.rdf.model.Resource cls)
          Remove the given class from the stated range(s) of this property.
 void removeSubProperty(com.hp.hpl.jena.rdf.model.Property prop)
          Remove the given property from the sub-properties of this property.
 void removeSuperProperty(com.hp.hpl.jena.rdf.model.Property prop)
          Remove the given property from the super-properties of this property.
 void setDomain(com.hp.hpl.jena.rdf.model.Resource res)
          Assert that the given resource represents the class of individuals that form the domain of this property.
 void setEquivalentProperty(com.hp.hpl.jena.rdf.model.Property prop)
          Assert that the given property is equivalent to this property.
 void setInverseOf(com.hp.hpl.jena.rdf.model.Property prop)
          Assert that this property is the inverse of the given property.
 void setRange(com.hp.hpl.jena.rdf.model.Resource res)
          Assert that the given resource represents the class of individuals that form the range of this property.
 void setSubProperty(com.hp.hpl.jena.rdf.model.Property prop)
          Assert that this property is super-property of the given property.
 void setSuperProperty(com.hp.hpl.jena.rdf.model.Property prop)
          Assert that this property is sub-property of the given property.
 
Methods inherited from interface com.hp.hpl.jena.ontology.OntResource
addComment, addComment, addDifferentFrom, addIsDefinedBy, addLabel, addLabel, addRDFType, addSameAs, addSeeAlso, addVersionInfo, asAllDifferent, asAnnotationProperty, asClass, asDataRange, asIndividual, asOntology, asProperty, getCardinality, getComment, getDifferentFrom, getIsDefinedBy, getLabel, getProfile, getPropertyValue, getRDFType, getRDFType, getSameAs, getSeeAlso, getVersionInfo, hasComment, hasComment, hasLabel, hasLabel, hasRDFType, hasRDFType, hasRDFType, hasSeeAlso, hasVersionInfo, isAllDifferent, isAnnotationProperty, isClass, isDataRange, isDefinedBy, isDifferentFrom, isIndividual, isOntLanguageTerm, isOntology, isProperty, isSameAs, listComments, listDifferentFrom, listIsDefinedBy, listLabels, listPropertyValues, listRDFTypes, listSameAs, listSeeAlso, listVersionInfo, remove, removeComment, removeComment, removeDefinedBy, removeDifferentFrom, removeLabel, removeLabel, removeProperty, removeRDFType, removeSameAs, removeSeeAlso, removeVersionInfo, setComment, setDifferentFrom, setIsDefinedBy, setLabel, setPropertyValue, setRDFType, setSameAs, setSeeAlso, setVersionInfo
 
Methods inherited from interface com.hp.hpl.jena.rdf.model.Resource
abort, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getLocalName, getModel, getNameSpace, getNode, getProperty, getRequiredProperty, getURI, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, isAnon, listProperties, listProperties, removeAll, removeProperties, toString
 
Methods inherited from interface com.hp.hpl.jena.rdf.model.RDFNode
as, canAs, inModel, visitWith
 
Methods inherited from interface com.hp.hpl.jena.graph.FrontsNode
asNode
 
Methods inherited from interface com.hp.hpl.jena.rdf.model.Property
getLocalName, getNameSpace, getOrdinal, isProperty
 

Method Detail

setSuperProperty

public void setSuperProperty(com.hp.hpl.jena.rdf.model.Property prop)

Assert that this property is sub-property of the given property. Any existing statements for subPropertyOf will be removed.


addSuperProperty

public void addSuperProperty(com.hp.hpl.jena.rdf.model.Property prop)

Add a super-property of this property.


getSuperProperty

public OntProperty getSuperProperty()

Answer a property that is the super-property of this property. If there is more than one such property, an arbitrary selection is made.


listSuperProperties

public com.hp.hpl.jena.util.iterator.ExtendedIterator listSuperProperties()

Answer an iterator over all of the properties that are declared to be super-properties of this property. Each element of the iterator will be an OntProperty.


listSuperProperties

public com.hp.hpl.jena.util.iterator.ExtendedIterator listSuperProperties(boolean direct)

Answer an iterator over all of the properties that are declared to be super-properties of this property. Each element of the iterator will be an OntProperty.


hasSuperProperty

public boolean hasSuperProperty(com.hp.hpl.jena.rdf.model.Property prop,
                                boolean direct)

Answer true if the given property is a super-property of this property.


removeSuperProperty

public void removeSuperProperty(com.hp.hpl.jena.rdf.model.Property prop)

Remove the given property from the super-properties of this property. If this statement is not true of the current model, nothing happens.


setSubProperty

public void setSubProperty(com.hp.hpl.jena.rdf.model.Property prop)

Assert that this property is super-property of the given property. Any existing statements for subPropertyOf on prop will be removed.


addSubProperty

public void addSubProperty(com.hp.hpl.jena.rdf.model.Property prop)

Add a sub-property of this property.


getSubProperty

public OntProperty getSubProperty()

Answer a property that is the sub-property of this property. If there is more than one such property, an arbitrary selection is made.


listSubProperties

public com.hp.hpl.jena.util.iterator.ExtendedIterator listSubProperties()

Answer an iterator over all of the properties that are declared to be sub-properties of this property. Each element of the iterator will be an OntProperty.


listSubProperties

public com.hp.hpl.jena.util.iterator.ExtendedIterator listSubProperties(boolean direct)

Answer an iterator over all of the properties that are declared to be sub-properties of this property. Each element of the iterator will be an OntProperty.


hasSubProperty

public boolean hasSubProperty(com.hp.hpl.jena.rdf.model.Property prop,
                              boolean direct)

Answer true if the given property is a sub-property of this property.


removeSubProperty

public void removeSubProperty(com.hp.hpl.jena.rdf.model.Property prop)

Remove the given property from the sub-properties of this property. If this statement is not true of the current model, nothing happens.


setDomain

public void setDomain(com.hp.hpl.jena.rdf.model.Resource res)

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.


addDomain

public void addDomain(com.hp.hpl.jena.rdf.model.Resource res)

Add a resource representing the domain of this property.


getDomain

public OntResource getDomain()

Answer a resource that represents the domain class of this property. If there is more than one such resource, an arbitrary selection is made.


listDomain

public com.hp.hpl.jena.util.iterator.ExtendedIterator listDomain()

Answer an iterator over all of the declared domain classes of this property. Each element of the iterator will be an OntResource.


hasDomain

public boolean hasDomain(com.hp.hpl.jena.rdf.model.Resource res)

Answer true if the given resource a class specifying the domain of this property.


removeDomain

public void removeDomain(com.hp.hpl.jena.rdf.model.Resource cls)

Remove the given class from the stated domain(s) of this property. If this statement is not true of the current model, nothing happens.


setRange

public void setRange(com.hp.hpl.jena.rdf.model.Resource res)

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.


addRange

public void addRange(com.hp.hpl.jena.rdf.model.Resource res)

Add a resource representing the range of this property.


getRange

public OntResource getRange()

Answer a resource that represents the range class of this property. If there is more than one such resource, an arbitrary selection is made.


listRange

public com.hp.hpl.jena.util.iterator.ExtendedIterator listRange()

Answer an iterator over all of the declared range classes of this property. Each element of the iterator will be an OntResource.


hasRange

public boolean hasRange(com.hp.hpl.jena.rdf.model.Resource res)

Answer true if the given resource a class specifying the range of this property.


removeRange

public void removeRange(com.hp.hpl.jena.rdf.model.Resource cls)

Remove the given class from the stated range(s) of this property. If this statement is not true of the current model, nothing happens.


setEquivalentProperty

public void setEquivalentProperty(com.hp.hpl.jena.rdf.model.Property prop)

Assert that the given property is equivalent to this property. Any existing statements for equivalentProperty will be removed.


addEquivalentProperty

public void addEquivalentProperty(com.hp.hpl.jena.rdf.model.Property prop)

Add a property that is equivalent to this property.


getEquivalentProperty

public OntProperty getEquivalentProperty()

Answer a property that is equivalent to this property. If there is more than one such property, an arbitrary selection is made.


listEquivalentProperties

public com.hp.hpl.jena.util.iterator.ExtendedIterator listEquivalentProperties()

Answer an iterator over all of the properties that are declared to be equivalent properties to this property. Each element of the iterator will be an OntProperty.


hasEquivalentProperty

public boolean hasEquivalentProperty(com.hp.hpl.jena.rdf.model.Property prop)

Answer true if the given property is equivalent to this property.


removeEquivalentProperty

public void removeEquivalentProperty(com.hp.hpl.jena.rdf.model.Property prop)

Remove the statement that this property and the given property are equivalent. If this statement is not true of the current model, nothing happens.


setInverseOf

public void setInverseOf(com.hp.hpl.jena.rdf.model.Property prop)

Assert that this property is the inverse of the given property. Any existing statements for inverseOf will be removed.


addInverseOf

public void addInverseOf(com.hp.hpl.jena.rdf.model.Property prop)

Add a property that this property is the inverse of.


getInverseOf

public OntProperty getInverseOf()

Answer a property of which this property is the inverse, if known, or null if there is no such property. If there is more than one such property, an arbitrary selection is made.

Note that this method is slightly different to getInverse() 55 . See the Javadoc on getInverse() 55 for a detailed explanation.


listInverseOf

public com.hp.hpl.jena.util.iterator.ExtendedIterator listInverseOf()

Answer an iterator over all of the properties that this property is declared to be the inverse of. Each element of the iterator will be an OntProperty.


isInverseOf

public boolean isInverseOf(com.hp.hpl.jena.rdf.model.Property prop)

Answer true if this property is the inverse of the given property.


removeInverseProperty

public void removeInverseProperty(com.hp.hpl.jena.rdf.model.Property prop)

Remove the statement that this property is the inverse of the given property. If this statement is not true of the current model, nothing happens.


asFunctionalProperty

public FunctionalProperty asFunctionalProperty()

Answer a view of this property as a functional property


asDatatypeProperty

public DatatypeProperty asDatatypeProperty()

Answer a view of this property as a datatype property

Specified by:
asDatatypeProperty in interface OntResource

asObjectProperty

public ObjectProperty asObjectProperty()

Answer a view of this property as an object property

Specified by:
asObjectProperty in interface OntResource

asTransitiveProperty

public TransitiveProperty asTransitiveProperty()

Answer a view of this property as a transitive property


asInverseFunctionalProperty

public InverseFunctionalProperty asInverseFunctionalProperty()

Answer a view of this property as an inverse functional property


asSymmetricProperty

public SymmetricProperty asSymmetricProperty()

Answer a view of this property as a symmetric property


convertToFunctionalProperty

public FunctionalProperty convertToFunctionalProperty()

Answer a facet of this property as a functional property, adding additional information to the model if necessary.


convertToDatatypeProperty

public DatatypeProperty convertToDatatypeProperty()

Answer a facet of this property as a datatype property, adding additional information to the model if necessary.


convertToObjectProperty

public ObjectProperty convertToObjectProperty()

Answer a facet of this property as an object property, adding additional information to the model if necessary.


convertToTransitiveProperty

public TransitiveProperty convertToTransitiveProperty()

Answer a facet of this property as a transitive property, adding additional information to the model if necessary.


convertToInverseFunctionalProperty

public InverseFunctionalProperty convertToInverseFunctionalProperty()

Answer a facet of this property as an inverse functional property, adding additional information to the model if necessary.


convertToSymmetricProperty

public SymmetricProperty convertToSymmetricProperty()

Answer a facet of this property as a symmetric property, adding additional information to the model if necessary.


isFunctionalProperty

public boolean isFunctionalProperty()

Answer true if this property is a functional property


isDatatypeProperty

public boolean isDatatypeProperty()

Answer true if this property is a datatype property

Specified by:
isDatatypeProperty in interface OntResource

isObjectProperty

public boolean isObjectProperty()

Answer true if this property is an object property

Specified by:
isObjectProperty in interface OntResource

isTransitiveProperty

public boolean isTransitiveProperty()

Answer true if this property is a transitive property


isInverseFunctionalProperty

public boolean isInverseFunctionalProperty()

Answer true if this property is an inverse functional property


isSymmetricProperty

public boolean isSymmetricProperty()

Answer true if this property is a symmetric property


getInverse

public OntProperty getInverse()

Answer the property that has declared itself to be the inverse of this property, if any such property is defined. If no such property is defined, return null. If more than one inverse is defined, return an abritrary selection.

Note that this method is slightly different from getInverseOf() 55 . Suppose that we have:

 :p an owl:ObjectProperty.
 :q an owl:ObjectProperty.
 :p owl:inverseOf :q.
 

Then, getInverse() called on the OntProperty corresponding to q will return p, since q declares itself to be p's inverse. However, unless an OWL reasoner is used, calling getInverse() on p will return null. Conversely, absent a reasoner, getInverseOf() 55 on p will return q, but will return null when called on q. In the presence of an OWL reasoner, getInverse() and getInverseOf() are equivalent, since owl:inverseOf is a symmetric property.


listInverse

public com.hp.hpl.jena.util.iterator.ExtendedIterator listInverse()

Answer an iterator over the properties that are defined to be inverses of this property.


hasInverse

public boolean hasInverse()

Answer true if there is at least one inverse property for this property.


listDeclaringClasses

public com.hp.hpl.jena.util.iterator.ExtendedIterator listDeclaringClasses()

Answer an iterator of all of the classes in this ontology, such that each returned class has this property as one of its properties in OntClass.listDeclaredProperties() 55 . This simulates a frame-like view of properties and classes; for more details see the RDF frames howto.


listDeclaringClasses

public com.hp.hpl.jena.util.iterator.ExtendedIterator listDeclaringClasses(boolean direct)

Answer an iterator of all of the classes in this ontology, such that each returned class has this property as one of its properties in OntClass.listDeclaredProperties(boolean) 55 . This simulates a frame-like view of properties and classes; for more details see the RDF frames howto.