Class OntPropertyImpl
- java.lang.Object
-
- org.apache.jena.enhanced.Polymorphic<RDFNode>
-
- org.apache.jena.enhanced.EnhNode
-
- org.apache.jena.rdf.model.impl.ResourceImpl
-
- org.apache.jena.ontology.impl.OntResourceImpl
-
- org.apache.jena.ontology.impl.OntPropertyImpl
-
- All Implemented Interfaces:
FrontsNode
,OntProperty
,OntResource
,Property
,RDFNode
,Resource
- Direct Known Subclasses:
AnnotationPropertyImpl
,DatatypePropertyImpl
,FunctionalPropertyImpl
,ObjectPropertyImpl
public class OntPropertyImpl extends OntResourceImpl implements OntProperty
Implementation of the abstraction representing a general ontology property.
-
-
Field Summary
Fields Modifier and Type Field Description static Implementation
factory
A factory for generating OntProperty facets from nodes in enhanced graphs.-
Fields inherited from class org.apache.jena.ontology.impl.OntResourceImpl
KNOWN_LANGUAGES
-
Fields inherited from class org.apache.jena.rdf.model.impl.ResourceImpl
rdfNodeFactory
-
-
Constructor Summary
Constructors Constructor Description OntPropertyImpl(Node n, EnhGraph g)
Construct an ontology property represented by the given node in the given graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDomain(Resource res)
Add a resource representing the domain of this property.void
addEquivalentProperty(Property prop)
Add a property that is equivalent to this property.void
addInverseOf(Property prop)
Add a property that is the inverse of this property.void
addRange(Resource res)
Add a resource representing the range of this property.void
addSubProperty(Property prop)
Add a sub-property of this property.void
addSuperProperty(Property prop)
Add a super-property of this property.DatatypeProperty
asDatatypeProperty()
Answer a view of this property as a datatype propertyFunctionalProperty
asFunctionalProperty()
Answer a view of this property as a functional propertyInverseFunctionalProperty
asInverseFunctionalProperty()
Answer a view of this property as an inverse functional propertyObjectProperty
asObjectProperty()
Answer a view of this property as an object propertySymmetricProperty
asSymmetricProperty()
Answer a view of this property as a symmetric propertyTransitiveProperty
asTransitiveProperty()
Answer a view of this property as a transitive propertyDatatypeProperty
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 is the inverse of this property.OntProperty
getInverseOf()
Answer a property that is an inverse of this property.int
getOrdinal()
Returns the ordinal value of a containment 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(Resource res)
Answer true if the given resource a class specifying the domain of this property.boolean
hasEquivalentProperty(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(Resource res)
Answer true if the given resource a class specifying the range of this property.boolean
hasSubProperty(Property prop, boolean direct)
Answer true if the given property is a sub-property of this property.boolean
hasSuperProperty(Property prop, boolean direct)
Answer true if the given property is a super-property of this property.Property
inModel(Model m)
Answer a property that is attached to the given model, which will either be this property or a new property object with the same URI in the given model.boolean
isDatatypeProperty()
Answer true if this property is a datatype propertyboolean
isFunctionalProperty()
Answer true if this property is a functional propertyboolean
isInverseFunctionalProperty()
Answer true if this property is an inverse functional propertyboolean
isInverseOf(Property prop)
Answer true if this property is the inverse of the given property.boolean
isObjectProperty()
Answer true if this property is an object propertyboolean
isProperty()
Answer true to indicate that this resource is an RDF property.boolean
isSymmetricProperty()
Answer true if this property is a symmetric propertyboolean
isTransitiveProperty()
Answer true if this property is a transitive propertyExtendedIterator<OntClass>
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 inOntClass.listDeclaredProperties()
.ExtendedIterator<OntClass>
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 inOntClass.listDeclaredProperties(boolean)
.ExtendedIterator<OntClass>
listDomain()
Answer an iterator over all of the declared domain classes of this property.ExtendedIterator<OntProperty>
listEquivalentProperties()
Answer an iterator over all of the properties that are declared to be equivalent properties to this property.ExtendedIterator<OntProperty>
listInverse()
Answer an iterator over the properties that are defined to be inverses of this property.ExtendedIterator<? extends OntProperty>
listInverseOf()
Answer an iterator over all of the properties that are declared to be inverse properties of this property.ExtendedIterator<OntClass>
listRange()
Answer an iterator over all of the declared range classes of this property.ExtendedIterator<Restriction>
listReferringRestrictions()
Answer an iterator over any restrictions that mention this property as the property that the restriction is adding some constraint to.ExtendedIterator<OntProperty>
listSubProperties()
Answer an iterator over all of the properties that are declared to be sub-properties of this property.ExtendedIterator<OntProperty>
listSubProperties(boolean direct)
Answer an iterator over all of the properties that are declared to be sub-properties of this property.ExtendedIterator<OntProperty>
listSuperProperties()
Answer an iterator over all of the properties that are declared to be super-properties of this property.ExtendedIterator<OntProperty>
listSuperProperties(boolean direct)
Answer an iterator over all of the properties that are declared to be super-properties of this property.void
removeDomain(Resource cls)
Remove the given class from the stated domain(s) of this property.void
removeEquivalentProperty(Property prop)
Remove the statement that this property and the given property are equivalent.void
removeInverseProperty(Property prop)
Remove the statement that this property is the inverse of the given property.void
removeRange(Resource cls)
Remove the given class from the stated range(s) of this property.void
removeSubProperty(Property prop)
Remove the given property from the sub-properties of this property.void
removeSuperProperty(Property prop)
Remove the given property from the super-properties of this property.void
setDomain(Resource res)
Assert that the given resource represents the class of individuals that form the domain of this property.void
setEquivalentProperty(Property prop)
Assert that the given property is equivalent to this property.void
setInverseOf(Property prop)
Assert that the given property is the inverse of this property.void
setRange(Resource res)
Assert that the given resource represents the class of individuals that form the range of this property.void
setSubProperty(Property prop)
Assert that this property is super-property of the given property.void
setSuperProperty(Property prop)
Assert that this property is sub-property of the given property.-
Methods inherited from class org.apache.jena.ontology.impl.OntResourceImpl
addComment, addComment, addDifferentFrom, addIsDefinedBy, addLabel, addLabel, addRDFType, addSameAs, addSeeAlso, addVersionInfo, asAllDifferent, asAnnotationProperty, asClass, asDataRange, asIndividual, asOntology, asProperty, getCardinality, getComment, getDifferentFrom, getIsDefinedBy, getLabel, getOntModel, 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, 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 class org.apache.jena.rdf.model.impl.ResourceImpl
abort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, addProperty, asLiteral, asResource, begin, commit, getId, getLocalName, getModel, getNameSpace, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getRequiredProperty, getStmtTerm, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, listProperties, listProperties, listProperties, removeAll, removeProperties, toString, visitWith
-
Methods inherited from class org.apache.jena.enhanced.EnhNode
as, asNode, canAs, equals, getGraph, hashCode, isAnon, isLiteral, isResource, isStmtResource, isURIResource, isValid, viewAs
-
Methods inherited from class org.apache.jena.enhanced.Polymorphic
addView, supports
-
Methods inherited from interface org.apache.jena.graph.FrontsNode
asNode
-
Methods inherited from interface org.apache.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, getOntModel, 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, 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 org.apache.jena.rdf.model.Property
getLocalName, getNameSpace
-
Methods inherited from interface org.apache.jena.rdf.model.RDFNode
as, asLiteral, asResource, canAs, getModel, isAnon, isLiteral, isResource, isStmtResource, isURIResource, visitWith
-
Methods inherited from interface org.apache.jena.rdf.model.Resource
abort, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addLiteral, addProperty, addProperty, addProperty, addProperty, begin, commit, equals, getId, getProperty, getProperty, getPropertyResourceValue, getRequiredProperty, getRequiredProperty, getStmtTerm, getURI, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasLiteral, hasProperty, hasProperty, hasProperty, hasProperty, hasURI, listProperties, listProperties, listProperties, removeAll, removeProperties, toString
-
-
-
-
Field Detail
-
factory
public static Implementation factory
A factory for generating OntProperty facets from nodes in enhanced graphs. Note: should not be invoked directly by user code: useas()
instead.
-
-
Method Detail
-
isProperty
public boolean isProperty()
Answer true to indicate that this resource is an RDF property.
- Specified by:
isProperty
in interfaceOntResource
- Specified by:
isProperty
in interfaceProperty
- Overrides:
isProperty
in classOntResourceImpl
- Returns:
- True.
-
getOrdinal
public int getOrdinal()
Description copied from interface:Property
Returns the ordinal value of a containment property.RDF containers use properties of the form _1, _2, _3 etc to represent the containment relationship between the container and the objects it contains. When invoked on such a containment property, this method returns the integer part of the property name. When invoked on other properties, it returns 0.
- Specified by:
getOrdinal
in interfaceProperty
- Returns:
- The ordinal value of a containment property, or 0 otherwise.
- See Also:
Property.getOrdinal()
-
setSuperProperty
public void setSuperProperty(Property prop)
Assert that this property is sub-property of the given property. Any existing statements for
subPropertyOf
will be removed.- Specified by:
setSuperProperty
in interfaceOntProperty
- Parameters:
prop
- The property that this property is a sub-property of- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
addSuperProperty
public void addSuperProperty(Property prop)
Add a super-property of this property.
- Specified by:
addSuperProperty
in interfaceOntProperty
- Parameters:
prop
- A property that is a super-property of this property.- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
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.
- Specified by:
getSuperProperty
in interfaceOntProperty
- Returns:
- A super-property of this property
- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
listSuperProperties
public ExtendedIterator<OntProperty> 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
.- Specified by:
listSuperProperties
in interfaceOntProperty
- Returns:
- An iterator over the super-properties of this property.
- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
listSuperProperties
public ExtendedIterator<OntProperty> 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
.- Specified by:
listSuperProperties
in interfaceOntProperty
- Parameters:
direct
- If true, only answer the directly adjacent properties in the property hierarchy: i.e. eliminate any property for which there is a longer route to reach that child under the super-property relation.- Returns:
- An iterator over the super-properties of this property.
- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
hasSuperProperty
public boolean hasSuperProperty(Property prop, boolean direct)
Answer true if the given property is a super-property of this property.
- Specified by:
hasSuperProperty
in interfaceOntProperty
- Parameters:
prop
- A property to test.direct
- If true, only consider the directly adjacent properties in the property hierarchy- Returns:
- True if the given property is a super-property of this property.
-
removeSuperProperty
public void removeSuperProperty(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.
- Specified by:
removeSuperProperty
in interfaceOntProperty
- Parameters:
prop
- A property to be removed from the super-properties of this property- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
setSubProperty
public void setSubProperty(Property prop)
Assert that this property is super-property of the given property. Any existing statements for
subPropertyOf
onprop
will be removed.- Specified by:
setSubProperty
in interfaceOntProperty
- Parameters:
prop
- The property that is a sub-property of this property- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
addSubProperty
public void addSubProperty(Property prop)
Add a sub-property of this property.
- Specified by:
addSubProperty
in interfaceOntProperty
- Parameters:
prop
- A property that is a sub-property of this property.- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
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.
- Specified by:
getSubProperty
in interfaceOntProperty
- Returns:
- A sub-property of this property
- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
listSubProperties
public ExtendedIterator<OntProperty> 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
.- Specified by:
listSubProperties
in interfaceOntProperty
- Returns:
- An iterator over the sub-properties of this property.
- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
listSubProperties
public ExtendedIterator<OntProperty> 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
.- Specified by:
listSubProperties
in interfaceOntProperty
- Parameters:
direct
- If true, only answer the direcly adjacent properties in the property hierarchy: i.e. eliminate any property for which there is a longer route to reach that child under the sub-property relation.- Returns:
- An iterator over the sub-properties of this property.
- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
hasSubProperty
public boolean hasSubProperty(Property prop, boolean direct)
Answer true if the given property is a sub-property of this property.
- Specified by:
hasSubProperty
in interfaceOntProperty
- Parameters:
prop
- A property to test.direct
- If true, only consider the direcly adjacent properties in the property hierarchy- Returns:
- True if the given property is a sub-property of this property.
-
removeSubProperty
public void removeSubProperty(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.
- Specified by:
removeSubProperty
in interfaceOntProperty
- Parameters:
prop
- A property to be removed from the sub-properties of this property- Throws:
ProfileException
- If theProfile.SUB_PROPERTY_OF()
property is not supported in the current language profile.
-
setDomain
public void setDomain(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.- Specified by:
setDomain
in interfaceOntProperty
- Parameters:
res
- The resource that represents the domain class for this property.- Throws:
ProfileException
- If theProfile.DOMAIN()
property is not supported in the current language profile.
-
addDomain
public void addDomain(Resource res)
Add a resource representing the domain of this property.
- Specified by:
addDomain
in interfaceOntProperty
- Parameters:
res
- A resource that represents a domain class for this property.- Throws:
ProfileException
- If theProfile.DOMAIN()
property is not supported in the current language profile.
-
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.
- Specified by:
getDomain
in interfaceOntProperty
- Returns:
- An resource representing the class that forms the domain of this property
- Throws:
ProfileException
- If theProfile.DOMAIN()
property is not supported in the current language profile.
-
listDomain
public ExtendedIterator<OntClass> listDomain()
Answer an iterator over all of the declared domain classes of this property. Each element of the iterator will be an
OntResource
.- Specified by:
listDomain
in interfaceOntProperty
- Returns:
- An iterator over the classes that form the domain of this property.
- Throws:
ProfileException
- If theProfile.DOMAIN()
property is not supported in the current language profile.
-
hasDomain
public boolean hasDomain(Resource res)
Answer true if the given resource a class specifying the domain of this property.
- Specified by:
hasDomain
in interfaceOntProperty
- Parameters:
res
- A resource representing a class- Returns:
- True if the given resource is one of the domain classes of this property.
-
removeDomain
public void removeDomain(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.
- Specified by:
removeDomain
in interfaceOntProperty
- Parameters:
cls
- A class to be removed from the declared domain(s) of this property- Throws:
ProfileException
- If theProfile.DOMAIN()
property is not supported in the current language profile.
-
setRange
public void setRange(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.- Specified by:
setRange
in interfaceOntProperty
- Parameters:
res
- The resource that represents the range class for this property.- Throws:
ProfileException
- If theProfile.RANGE()
property is not supported in the current language profile.
-
addRange
public void addRange(Resource res)
Add a resource representing the range of this property.
- Specified by:
addRange
in interfaceOntProperty
- Parameters:
res
- A resource that represents a range class for this property.- Throws:
ProfileException
- If theProfile.RANGE()
property is not supported in the current language profile.
-
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.
- Specified by:
getRange
in interfaceOntProperty
- Returns:
- An resource representing the class that forms the range of this property
- Throws:
ProfileException
- If theProfile.RANGE()
property is not supported in the current language profile.
-
listRange
public ExtendedIterator<OntClass> listRange()
Answer an iterator over all of the declared range classes of this property. Each element of the iterator will be an
OntResource
.- Specified by:
listRange
in interfaceOntProperty
- Returns:
- An iterator over the classes that form the range of this property.
- Throws:
ProfileException
- If theProfile.RANGE()
property is not supported in the current language profile.
-
hasRange
public boolean hasRange(Resource res)
Answer true if the given resource a class specifying the range of this property.
- Specified by:
hasRange
in interfaceOntProperty
- Parameters:
res
- A resource representing a class- Returns:
- True if the given resource is one of the range classes of this property.
-
removeRange
public void removeRange(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.
- Specified by:
removeRange
in interfaceOntProperty
- Parameters:
cls
- A class to be removed from the declared range(s) of this property- Throws:
ProfileException
- If theProfile.RANGE()
property is not supported in the current language profile.
-
setEquivalentProperty
public void setEquivalentProperty(Property prop)
Assert that the given property is equivalent to this property. Any existing statements for
equivalentProperty
will be removed.- Specified by:
setEquivalentProperty
in interfaceOntProperty
- Parameters:
prop
- The property that this property is a equivalent to.- Throws:
ProfileException
- If theProfile.EQUIVALENT_PROPERTY()
property is not supported in the current language profile.
-
addEquivalentProperty
public void addEquivalentProperty(Property prop)
Add a property that is equivalent to this property.
- Specified by:
addEquivalentProperty
in interfaceOntProperty
- Parameters:
prop
- A property that is equivalent to this property.- Throws:
ProfileException
- If theProfile.EQUIVALENT_PROPERTY()
property is not supported in the current language profile.
-
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.
- Specified by:
getEquivalentProperty
in interfaceOntProperty
- Returns:
- A property equivalent to this property
- Throws:
ProfileException
- If theProfile.EQUIVALENT_PROPERTY()
property is not supported in the current language profile.
-
listEquivalentProperties
public ExtendedIterator<OntProperty> 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
.- Specified by:
listEquivalentProperties
in interfaceOntProperty
- Returns:
- An iterator over the properties equivalent to this property.
- Throws:
ProfileException
- If theProfile.EQUIVALENT_PROPERTY()
property is not supported in the current language profile.
-
hasEquivalentProperty
public boolean hasEquivalentProperty(Property prop)
Answer true if the given property is equivalent to this property.
- Specified by:
hasEquivalentProperty
in interfaceOntProperty
- Parameters:
prop
- A property to test for- Returns:
- True if the given property is equivalent to this property.
-
removeEquivalentProperty
public void removeEquivalentProperty(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.
- Specified by:
removeEquivalentProperty
in interfaceOntProperty
- Parameters:
prop
- A property that may be declared to be equivalent to this property- Throws:
ProfileException
- If theProfile.EQUIVALENT_PROPERTY()
property is not supported in the current language profile.
-
setInverseOf
public void setInverseOf(Property prop)
Assert that the given property is the inverse of this property. Any existing statements for
inverseOf
will be removed.- Specified by:
setInverseOf
in interfaceOntProperty
- Parameters:
prop
- The property that this property is a inverse to.- Throws:
ProfileException
- If theProfile.INVERSE_OF()
property is not supported in the current language profile.
-
addInverseOf
public void addInverseOf(Property prop)
Add a property that is the inverse of this property.
- Specified by:
addInverseOf
in interfaceOntProperty
- Parameters:
prop
- A property that is the inverse of this property.- Throws:
ProfileException
- If theProfile.INVERSE_OF()
property is not supported in the current language profile.
-
getInverseOf
public OntProperty getInverseOf()
Answer a property that is an inverse of this property. If there is more than one such property, an arbitrary selection is made.
- Specified by:
getInverseOf
in interfaceOntProperty
- Returns:
- A property inverse to this property
- Throws:
ProfileException
- If theProfile.INVERSE_OF()
property is not supported in the current language profile.
-
listInverseOf
public ExtendedIterator<? extends OntProperty> listInverseOf()
Answer an iterator over all of the properties that are declared to be inverse properties of this property. Each element of the iterator will be an
OntProperty
.- Specified by:
listInverseOf
in interfaceOntProperty
- Returns:
- An iterator over the properties inverse to this property.
- Throws:
ProfileException
- If theProfile.INVERSE_OF()
property is not supported in the current language profile.
-
isInverseOf
public boolean isInverseOf(Property prop)
Answer true if this property is the inverse of the given property.
- Specified by:
isInverseOf
in interfaceOntProperty
- Parameters:
prop
- A property to test for- Returns:
- True if the this property is the inverse of the the given property.
-
removeInverseProperty
public void removeInverseProperty(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.
- Specified by:
removeInverseProperty
in interfaceOntProperty
- Parameters:
prop
- A property that may be declared to be inverse to this property- Throws:
ProfileException
- If theProfile.INVERSE_OF()
property is not supported in the current language profile.
-
asFunctionalProperty
public FunctionalProperty asFunctionalProperty()
Answer a view of this property as a functional property
- Specified by:
asFunctionalProperty
in interfaceOntProperty
- Returns:
- This property, but viewed as a FunctionalProperty node
- Throws:
ConversionException
- if the resource cannot be converted to a functional property given the language profile and the current state of the underlying model.
-
asDatatypeProperty
public DatatypeProperty asDatatypeProperty()
Answer a view of this property as a datatype property
- Specified by:
asDatatypeProperty
in interfaceOntProperty
- Specified by:
asDatatypeProperty
in interfaceOntResource
- Overrides:
asDatatypeProperty
in classOntResourceImpl
- Returns:
- This property, but viewed as a DatatypeProperty node
- Throws:
ConversionException
- if the resource cannot be converted to a datatype property given the language profile and the current state of the underlying model.
-
asObjectProperty
public ObjectProperty asObjectProperty()
Answer a view of this property as an object property
- Specified by:
asObjectProperty
in interfaceOntProperty
- Specified by:
asObjectProperty
in interfaceOntResource
- Overrides:
asObjectProperty
in classOntResourceImpl
- Returns:
- This property, but viewed as an ObjectProperty node
- Throws:
ConversionException
- if the resource cannot be converted to an object property given the language profile and the current state of the underlying model.
-
asTransitiveProperty
public TransitiveProperty asTransitiveProperty()
Answer a view of this property as a transitive property
- Specified by:
asTransitiveProperty
in interfaceOntProperty
- Returns:
- This property, but viewed as a TransitiveProperty node
- Throws:
ConversionException
- if the resource cannot be converted to a transitive property given the language profile and the current state of the underlying model.
-
asInverseFunctionalProperty
public InverseFunctionalProperty asInverseFunctionalProperty()
Answer a view of this property as an inverse functional property
- Specified by:
asInverseFunctionalProperty
in interfaceOntProperty
- Returns:
- This property, but viewed as an InverseFunctionalProperty node
- Throws:
ConversionException
- if the resource cannot be converted to an inverse functional property given the language profile and the current state of the underlying model.
-
asSymmetricProperty
public SymmetricProperty asSymmetricProperty()
Answer a view of this property as a symmetric property
- Specified by:
asSymmetricProperty
in interfaceOntProperty
- Returns:
- This property, but viewed as a SymmetricProperty node
- Throws:
ConversionException
- if the resource cannot be converted to a symmetric property given the language profile and the current state of the underlying model.
-
convertToFunctionalProperty
public FunctionalProperty convertToFunctionalProperty()
Answer a facet of this property as a functional property, adding additional information to the model if necessary.
- Specified by:
convertToFunctionalProperty
in interfaceOntProperty
- Returns:
- This property, but converted to a FunctionalProperty facet
-
convertToDatatypeProperty
public DatatypeProperty convertToDatatypeProperty()
Answer a facet of this property as a datatype property, adding additional information to the model if necessary.
- Specified by:
convertToDatatypeProperty
in interfaceOntProperty
- Returns:
- This property, but converted to a DatatypeProperty facet
-
convertToObjectProperty
public ObjectProperty convertToObjectProperty()
Answer a facet of this property as an object property, adding additional information to the model if necessary.
- Specified by:
convertToObjectProperty
in interfaceOntProperty
- Returns:
- This property, but converted to an ObjectProperty facet
-
convertToTransitiveProperty
public TransitiveProperty convertToTransitiveProperty()
Answer a facet of this property as a transitive property, adding additional information to the model if necessary.
- Specified by:
convertToTransitiveProperty
in interfaceOntProperty
- Returns:
- This property, but converted to a TransitiveProperty facet
-
convertToInverseFunctionalProperty
public InverseFunctionalProperty convertToInverseFunctionalProperty()
Answer a facet of this property as an inverse functional property, adding additional information to the model if necessary.
- Specified by:
convertToInverseFunctionalProperty
in interfaceOntProperty
- Returns:
- This property, but converted to an InverseFunctionalProperty facet
-
convertToSymmetricProperty
public SymmetricProperty convertToSymmetricProperty()
Answer a facet of this property as a symmetric property, adding additional information to the model if necessary.
- Specified by:
convertToSymmetricProperty
in interfaceOntProperty
- Returns:
- This property, but converted to a SymmetricProperty facet
-
isFunctionalProperty
public boolean isFunctionalProperty()
Answer true if this property is a functional property
- Specified by:
isFunctionalProperty
in interfaceOntProperty
- Returns:
- True if this this property has an
rdf:type
that defines it as a functional property.
-
isDatatypeProperty
public boolean isDatatypeProperty()
Answer true if this property is a datatype property
- Specified by:
isDatatypeProperty
in interfaceOntProperty
- Specified by:
isDatatypeProperty
in interfaceOntResource
- Overrides:
isDatatypeProperty
in classOntResourceImpl
- Returns:
- True if this this property has an
rdf:type
that defines it as a datatype property.
-
isObjectProperty
public boolean isObjectProperty()
Answer true if this property is an object property
- Specified by:
isObjectProperty
in interfaceOntProperty
- Specified by:
isObjectProperty
in interfaceOntResource
- Overrides:
isObjectProperty
in classOntResourceImpl
- Returns:
- True if this this property has an
rdf:type
that defines it as an object property.
-
isTransitiveProperty
public boolean isTransitiveProperty()
Answer true if this property is a transitive property
- Specified by:
isTransitiveProperty
in interfaceOntProperty
- Returns:
- True if this this property has an
rdf:type
that defines it as a transitive property.
-
isInverseFunctionalProperty
public boolean isInverseFunctionalProperty()
Answer true if this property is an inverse functional property
- Specified by:
isInverseFunctionalProperty
in interfaceOntProperty
- Returns:
- True if this this property has an
rdf:type
that defines it as an inverse functional property.
-
isSymmetricProperty
public boolean isSymmetricProperty()
Answer true if this property is a symmetric property
- Specified by:
isSymmetricProperty
in interfaceOntProperty
- Returns:
- True if this this property has an
rdf:type
that defines it as a symmetric property.
-
getInverse
public OntProperty getInverse()
Answer the property that is the inverse of this property. If no such property is defined, return null. If more than one inverse is defined, return an arbitrary selection.
- Specified by:
getInverse
in interfaceOntProperty
- Returns:
- The property that is the inverse of this property, or null.
-
listInverse
public ExtendedIterator<OntProperty> listInverse()
Answer an iterator over the properties that are defined to be inverses of this property.
- Specified by:
listInverse
in interfaceOntProperty
- Returns:
- An iterator over the properties that declare themselves the
inverseOf
this property.
-
hasInverse
public boolean hasInverse()
Answer true if there is at least one inverse property for this property.
- Specified by:
hasInverse
in interfaceOntProperty
- Returns:
- True if property has an inverse.
-
listDeclaringClasses
public ExtendedIterator<OntClass> 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()
. This simulates a frame-like view of properties and classes; for more details see the RDF frames howto.- Specified by:
listDeclaringClasses
in interfaceOntProperty
- Returns:
- An iterator of the classes having this property as one of their declared properties
-
listDeclaringClasses
public ExtendedIterator<OntClass> 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)
. This simulates a frame-like view of properties and classes; for more details see the RDF frames howto.- Specified by:
listDeclaringClasses
in interfaceOntProperty
- Parameters:
direct
- If true, use only direct associations between classes and properties- Returns:
- An iterator of the classes having this property as one of their declared properties
-
listReferringRestrictions
public ExtendedIterator<Restriction> listReferringRestrictions()
Answer an iterator over any restrictions that mention this property as the property that the restriction is adding some constraint to. For example:
<owl:Restriction> <owl:onProperty rdf:resource="#childOf" /> <owl:hasValue rdf:resource="#ian" /> </owl:Restriction>
Note that any such restrictions do not affect the global semantics of this property itself. Restrictions define new class expressions, and the property constraints are local to that class expression. This method is provided as a convenience to assist callers to navigate the relationships in the model.
- Specified by:
listReferringRestrictions
in interfaceOntProperty
- Returns:
- An iterator whose values are the restrictions from the local model that reference this property.
-
-