📄 ontpropertyimpl.java
字号:
}
/**
* <p>Add a resource representing the domain of this property.</p>
* @param res A resource that represents a domain class for this property.
* @exception OntProfileException If the {@link Profile#DOMAIN()} property is not supported in the current language profile.
*/
public void addDomain( Resource res ) {
addPropertyValue( getProfile().DOMAIN(), "DOMAIN", res );
}
/**
* <p>Answer a resource that represents the domain class of this property. If there is
* more than one such resource, an arbitrary selection is made.</p>
* @return An resource representing the class that forms the domain of this property
* @exception OntProfileException If the {@link Profile#DOMAIN()} property is not supported in the current language profile.
*/
public OntResource getDomain() {
return objectAsResource( getProfile().DOMAIN(), "DOMAIN" );
}
/**
* <p>Answer an iterator over all of the declared domain classes of this property.
* Each elemeent of the iterator will be an {@link OntResource}.</p>
* @return An iterator over the classes that form the domain of this property.
* @exception OntProfileException If the {@link Profile#DOMAIN()} property is not supported in the current language profile.
*/
public ExtendedIterator listDomain() {
return listAs( getProfile().DOMAIN(), "DOMAIN", OntClass.class );
}
/**
* <p>Answer true if the given resource a class specifying the domain of this property.</p>
* @param res A resource representing a class
* @return True if the given resource is one of the domain classes of this property.
*/
public boolean hasDomain( Resource res ) {
return hasPropertyValue( getProfile().DOMAIN(), "DOMAIN", res );
}
/**
* <p>Remove the given class from the stated domain(s) of this property. If this statement
* is not true of the current model, nothing happens.</p>
* @param cls A class to be removed from the declared domain(s) of this property
* @exception OntProfileException If the {@link Profile#DOMAIN()} property is not supported in the current language profile.
*/
public void removeDomain( Resource cls ) {
removePropertyValue( getProfile().DOMAIN(), "DOMAIN", cls );
}
// range
/**
* <p>Assert that the given resource represents the class of individuals that form the
* range of this property. Any existing <code>range</code> statements for this property are removed.</p>
* @param res The resource that represents the range class for this property.
* @exception OntProfileException If the {@link Profile#RANGE()} property is not supported in the current language profile.
*/
public void setRange( Resource res ) {
setPropertyValue( getProfile().RANGE(), "RANGE", res );
}
/**
* <p>Add a resource representing the range of this property.</p>
* @param res A resource that represents a range class for this property.
* @exception OntProfileException If the {@link Profile#RANGE()} property is not supported in the current language profile.
*/
public void addRange( Resource res ) {
addPropertyValue( getProfile().RANGE(), "RANGE", res );
}
/**
* <p>Answer a resource that represents the range class of this property. If there is
* more than one such resource, an arbitrary selection is made.</p>
* @return An resource representing the class that forms the range of this property
* @exception OntProfileException If the {@link Profile#RANGE()} property is not supported in the current language profile.
*/
public OntResource getRange() {
return objectAsResource( getProfile().RANGE(), "RANGE" );
}
/**
* <p>Answer an iterator over all of the declared range classes of this property.
* Each elemeent of the iterator will be an {@link OntResource}.</p>
* @return An iterator over the classes that form the range of this property.
* @exception OntProfileException If the {@link Profile#RANGE()} property is not supported in the current language profile.
*/
public ExtendedIterator listRange() {
return listAs( getProfile().RANGE(), "RANGE", OntClass.class );
}
/**
* <p>Answer true if the given resource a class specifying the range of this property.</p>
* @param res A resource representing a class
* @return True if the given resource is one of the range classes of this property.
*/
public boolean hasRange( Resource res ) {
return hasPropertyValue( getProfile().RANGE(), "RANGE", res );
}
/**
* <p>Remove the given class from the stated range(s) of this property. If this statement
* is not true of the current model, nothing happens.</p>
* @param cls A class to be removed from the declared range(s) of this property
* @exception OntProfileException If the {@link Profile#RANGE()} property is not supported in the current language profile.
*/
public void removeRange( Resource cls ) {
removePropertyValue( getProfile().RANGE(), "RANGE", cls );
}
// relationships between properties
// equivalentProperty
/**
* <p>Assert that the given property is equivalent to this property. Any existing
* statements for <code>equivalentProperty</code> will be removed.</p>
* @param prop The property that this property is a equivalent to.
* @exception OntProfileException If the {@link Profile#EQUIVALENT_PROPERTY()} property is not supported in the current language profile.
*/
public void setEquivalentProperty( Property prop ) {
setPropertyValue( getProfile().EQUIVALENT_PROPERTY(), "EQUIVALENT_PROPERTY", prop );
}
/**
* <p>Add a property that is equivalent to this property.</p>
* @param prop A property that is equivalent to this property.
* @exception OntProfileException If the {@link Profile#EQUIVALENT_PROPERTY()} property is not supported in the current language profile.
*/
public void addEquivalentProperty( Property prop ) {
addPropertyValue( getProfile().EQUIVALENT_PROPERTY(), "EQUIVALENT_PROPERTY", prop );
}
/**
* <p>Answer a property that is equivalent to this property. If there is
* more than one such property, an arbitrary selection is made.</p>
* @return A property equivalent to this property
* @exception OntProfileException If the {@link Profile#EQUIVALENT_PROPERTY()} property is not supported in the current language profile.
*/
public OntProperty getEquivalentProperty() {
return objectAsProperty( getProfile().EQUIVALENT_PROPERTY(), "EQUIVALENT_PROPERTY" );
}
/**
* <p>Answer an iterator over all of the properties that are declared to be equivalent properties to
* this property. Each elemeent of the iterator will be an {@link OntProperty}.</p>
* @return An iterator over the properties equivalent to this property.
* @exception OntProfileException If the {@link Profile#EQUIVALENT_PROPERTY()} property is not supported in the current language profile.
*/
public ExtendedIterator listEquivalentProperties() {
return listAs( getProfile().EQUIVALENT_PROPERTY(), "EQUIVALENT_PROPERTY", OntProperty.class );
}
/**
* <p>Answer true if the given property is equivalent to this property.</p>
* @param prop A property to test for
* @return True if the given property is equivalent to this property.
*/
public boolean hasEquivalentProperty( Property prop ) {
return hasPropertyValue( getProfile().EQUIVALENT_PROPERTY(), "EQUIVALENT_PROPERTY", prop );
}
/**
* <p>Remove the statement that this property and the given property are
* equivalent. If this statement
* is not true of the current model, nothing happens.</p>
* @param prop A property that may be declared to be equivalent to this property
* @exception OntProfileException If the {@link Profile#EQUIVALENT_PROPERTY()} property is not supported in the current language profile.
*/
public void removeEquivalentProperty( Property prop ) {
removePropertyValue( getProfile().EQUIVALENT_PROPERTY(), "EQUIVALENT_PROPERTY", prop );
}
// inverseProperty
/**
* <p>Assert that the given property is the inverse of this property. Any existing
* statements for <code>inverseOf</code> will be removed.</p>
* @param prop The property that this property is a inverse to.
* @exception OntProfileException If the {@link Profile#INVERSE_OF()} property is not supported in the current language profile.
*/
public void setInverseOf( Property prop ) {
setPropertyValue( getProfile().INVERSE_OF(), "INVERSE_OF", prop );
}
/**
* <p>Add a property that is the inverse of this property.</p>
* @param prop A property that is the inverse of this property.
* @exception OntProfileException If the {@link Profile#INVERSE_OF()} property is not supported in the current language profile.
*/
public void addInverseOf( Property prop ) {
addPropertyValue( getProfile().INVERSE_OF(), "INVERSE_OF", prop );
}
/**
* <p>Answer a property that is an inverse of this property. If there is
* more than one such property, an arbitrary selection is made.</p>
* @return A property inverse to this property
* @exception OntProfileException If the {@link Profile#INVERSE_OF()} property is not supported in the current language profile.
*/
public OntProperty getInverseOf() {
return objectAsProperty( getProfile().INVERSE_OF(), "INVERSE_OF" );
}
/**
* <p>Answer an iterator over all of the properties that are declared to be inverse properties of
* this property. Each elemeent of the iterator will be an {@link OntProperty}.</p>
* @return An iterator over the properties inverse to this property.
* @exception OntProfileException If the {@link Profile#INVERSE_OF()} property is not supported in the current language profile.
*/
public ExtendedIterator listInverseOf() {
return listAs( getProfile().INVERSE_OF(), "INVERSE_OF", OntProperty.class );
}
/**
* <p>Answer true if this property is the inverse of the given property.</p>
* @param prop A property to test for
* @return True if the this property is the inverse of the the given property.
*/
public boolean isInverseOf( Property prop ) {
return hasPropertyValue( getProfile().INVERSE_OF(), "INVERSE_OF", prop );
}
/**
* <p>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.</p>
* @param prop A property that may be declared to be inverse to this property
* @exception OntProfileException If the {@link Profile#INVERSE_OF()} property is not supported in the current language profile.
*/
public void removeInverseProperty( Property prop ) {
removePropertyValue( getProfile().INVERSE_OF(), "INVERSE_OF", prop );
}
/**
* <p>Answer a view of this property as a functional property</p>
* @return This property, but viewed as a FunctionalProperty node
* @exception ConversionException if the resource cannot be converted to a functional property
* given the lanuage profile and the current state of the underlying model.
*/
public FunctionalProperty asFunctionalProperty() {
return (FunctionalProperty) as( FunctionalProperty.class );
}
/**
* <p>Answer a view of this property as a datatype property</p>
* @return This property, but viewed as a DatatypeProperty node
* @exception ConversionException if the resource cannot be converted to a datatype property
* given the lanuage profile and the current state of the underlying model.
*/
public DatatypeProperty asDatatypeProperty() {
return (DatatypeProperty) as( DatatypeProperty.class );
}
/**
* <p>Answer a view of this property as an object property</p>
* @return This property, but viewed as an ObjectProperty node
* @exception ConversionException if the resource cannot be converted to an object property
* given the lanuage profile and the current state of the underlying model.
*/
public ObjectProperty asObjectProperty() {
return (ObjectProperty) as( ObjectProperty.class );
}
/**
* <p>Answer a view of this property as a transitive property</p>
* @return This property, but viewed as a TransitiveProperty node
* @exception ConversionException if the resource cannot be converted to a transitive property
* given the lanuage profile and the current state of the underlying model.
*/
public TransitiveProperty asTransitiveProperty() {
return (TransitiveProperty) as( TransitiveProperty.class );
}
/**
* <p>Answer a view of this property as an inverse functional property</p>
* @return This property, but viewed as an InverseFunctionalProperty node
* @exception ConversionException if the resource cannot be converted to an inverse functional property
* given the lanuage profile and the current state of the underlying model.
*/
public InverseFunctionalProperty asInverseFunctionalProperty() {
return (InverseFunctionalProperty) as( InverseFunctionalProperty.class );
}
/**
* <p>Answer a view of this property as a symmetric property</p>
* @return This property, but viewed as a SymmetricProperty node
* @exception ConversionException if the resource cannot be converted to a symmetric property
* given the lanuage profile and the current state of the underlying model.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -