/** * <p>Answer the property that this property restriction applies to. If there is * more than one such resource, an arbitrary selection is made (though well-defined property restrictions * should not have more than one <code>onProperty</code> statement.</p> * @return The property that this property restriction applies to * @exception ProfileException If the {@link Profile#ON_PROPERTY()} property is not supported in the current language profile. */ @Override public OntProperty getOnProperty() { return objectAs( getProfile().ON_PROPERTY(), "ON_PROPERTY", OntProperty.class ); }
/** * <p>Remove the given property as the property that this restriction applies to. If this statement * is not true of the current model, nothing happens.</p> * @param prop The property to be removed as a the property that this restriction applies to */ @Override public void removeOnProperty( Property prop ) { removePropertyValue( getProfile().ON_PROPERTY(), "ON_PROPERTY", prop ); }
/** * <p>Answer true if this restriction is a property restriction on the given property.</p> * @param prop A property to test against * @return True if this restriction is a restriction on <code>prop</code> * @exception ProfileException If the {@link Profile#ON_PROPERTY()} property is not supported in the current language profile. */ @Override public boolean onProperty( Property prop ) { return hasPropertyValue( getProfile().ON_PROPERTY(), "ON_PROPERTY", prop ); }
/** * <p>Answer true if this restriction is a some values from restriction</p> * @return True if this is a someValuesFrom property restriction * @exception ProfileException if {@link Profile#SOME_VALUES_FROM()} is not supported in the current profile */ @Override public boolean isSomeValuesFromRestriction() { checkProfile( getProfile().SOME_VALUES_FROM(), "SOME_VALUES_FROM" ); return hasProperty( getProfile().SOME_VALUES_FROM() ); }
/** * <p>Answer true if this restriction is a cardinality restriction (ie is a property restriction * constructed with an <code>owl:cardinality</code> operator, or similar). This is not a test for * a restriction that tests cardinalities in general.</p> * @return True if this is a cardinality property restriction * @exception ProfileException if {@link Profile#CARDINALITY()} is not supported in the current profile */ @Override public boolean isCardinalityRestriction() { checkProfile( getProfile().CARDINALITY(), "CARDINALITY" ); return hasProperty( getProfile().CARDINALITY() ); }
/** * <p>Remove the given property as the property that this restriction applies to. If this statement * is not true of the current model, nothing happens.</p> * @param prop The property to be removed as a the property that this restriction applies to */ @Override public void removeOnProperty( Property prop ) { removePropertyValue( getProfile().ON_PROPERTY(), "ON_PROPERTY", prop ); }
/** * <p>Answer true if this restriction is a has value restriction</p> * @return True if this is a hasValue property restriction * @exception ProfileException if {@link Profile#HAS_VALUE()} is not supported in the current profile */ @Override public boolean isHasValueRestriction() { checkProfile( getProfile().HAS_VALUE(), "HAS_VALUE" ); return hasProperty( getProfile().HAS_VALUE() ); }
/** * <p>Answer true if this restriction is a cardinality restriction (ie is a property restriction * constructed with an <code>owl:cardinality</code> operator, or similar). This is not a test for * a restriction that tests cardinalities in general.</p> * @return True if this is a cardinality property restriction * @exception ProfileException if {@link Profile#CARDINALITY()} is not supported in the current profile */ @Override public boolean isCardinalityRestriction() { checkProfile( getProfile().CARDINALITY(), "CARDINALITY" ); return hasProperty( getProfile().CARDINALITY() ); }
/** * <p>Assert that the property that this restriction applies to is the given property. Any existing * statements for <code>onProperty</code> will be removed.</p> * @param prop The property that this restriction applies to * @exception ProfileException If the {@link Profile#ON_PROPERTY()} property is not supported in the current language profile. */ @Override public void setOnProperty( Property prop ) { setPropertyValue( getProfile().ON_PROPERTY(), "ON_PROPERTY", prop ); }
/** * <p>Answer true if this restriction is an all values from restriction</p> * @return True if this is an allValuesFrom property restriction * @exception ProfileException if {@link Profile#ALL_VALUES_FROM()} is not supported in the current profile */ @Override public boolean isAllValuesFromRestriction() { checkProfile( getProfile().ALL_VALUES_FROM(), "ALL_VALUES_FROM" ); return hasProperty( getProfile().ALL_VALUES_FROM() ); }
/** * <p>Answer true if this restriction is a min cardinality restriction (ie is a property restriction * constructed with an <code>owl:minCardinality</code> operator, or similar). This is not a test for * a restriction that tests cardinalities in general.</p> * @return True if this is a minCardinality property restriction * @exception ProfileException if {@link Profile#MIN_CARDINALITY()} is not supported in the current profile */ @Override public boolean isMinCardinalityRestriction() { checkProfile( getProfile().MIN_CARDINALITY(), "MIN_CARDINALITY" ); return hasProperty( getProfile().MIN_CARDINALITY() ); }
/** * <p>Convert this restriction to an all values from class expression.</p> * @param cls The class to which all values of the restricted property must belong, to be in the * extension of this restriction * @return This class, but converted to a AllValuesFromRestriction class expression * @exception ProfileException if {@link Profile#ALL_VALUES_FROM()} is not supported in the current profile */ @Override public AllValuesFromRestriction convertToAllValuesFromRestriction( Resource cls ) { setPropertyValue( getProfile().ALL_VALUES_FROM(), "ALL_VALUES_FROM", cls ); return as( AllValuesFromRestriction.class ); }
/** * <p>Convert this restriction to a some values from class expression</p> * @param cls The class to which at least one value of the restricted property must belong, to be in the * extension of this restriction * @return This class, but converted to a SomeValuesFromRestriction node * @exception ProfileException if {@link Profile#SOME_VALUES_FROM()} is not supported in the current profile */ @Override public SomeValuesFromRestriction convertToSomeValuesFromRestriction( Resource cls ) { setPropertyValue( getProfile().SOME_VALUES_FROM(), "SOME_VALUES_FROM", cls ); return as( SomeValuesFromRestriction.class ); }
/** * <p>Convert this restriction to a some values from class expression</p> * @param cls The class to which at least one value of the restricted property must belong, to be in the * extension of this restriction * @return This class, but converted to a SomeValuesFromRestriction node * @exception ProfileException if {@link Profile#SOME_VALUES_FROM()} is not supported in the current profile */ @Override public SomeValuesFromRestriction convertToSomeValuesFromRestriction( Resource cls ) { setPropertyValue( getProfile().SOME_VALUES_FROM(), "SOME_VALUES_FROM", cls ); return as( SomeValuesFromRestriction.class ); }
/** * <p>Convert this restriction to an all values from class expression.</p> * @param cls The class to which all values of the restricted property must belong, to be in the * extension of this restriction * @return This class, but converted to a AllValuesFromRestriction class expression * @exception ProfileException if {@link Profile#ALL_VALUES_FROM()} is not supported in the current profile */ @Override public AllValuesFromRestriction convertToAllValuesFromRestriction( Resource cls ) { setPropertyValue( getProfile().ALL_VALUES_FROM(), "ALL_VALUES_FROM", cls ); return as( AllValuesFromRestriction.class ); }
/** * <p>Convert this restriction to a min cardinality restriction class expression</p> * @param cardinality The minimum cardinality for the restricted property * @return This class, but converted to a MinCardinalityRestriction node * @exception ProfileException if {@link Profile#MIN_CARDINALITY()} is not supported in the current profile */ @Override public MinCardinalityRestriction convertToMinCardinalityRestriction( int cardinality ) { setPropertyValue( getProfile().MIN_CARDINALITY(), "MIN_CARDINALITY", getModel().createTypedLiteral( cardinality ) ); return as( MinCardinalityRestriction.class ); }
/** * <p>Convert this restriction to a max cardinality restriction class expression</p> * @param cardinality The maximum cardinality for the restricted property * @return This class, but converted to a MaxCardinalityRestriction node * @exception ProfileException if {@link Profile#MAX_CARDINALITY()} is not supported in the current profile */ @Override public MaxCardinalityRestriction convertToMaxCardinalityRestriction( int cardinality ) { setPropertyValue( getProfile().MAX_CARDINALITY(), "MAX_CARDINALITY", getModel().createTypedLiteral( cardinality ) ); return as( MaxCardinalityRestriction.class ); }
/** * <p>Convert this restriction to a cardinality restriction class expression</p> * @param cardinality The exact cardinality for the restricted property * @return This class, but converted to a CardinalityRestriction node * @exception ProfileException if {@link Profile#CARDINALITY()} is not supported in the current profile */ @Override public CardinalityRestriction convertToCardinalityRestriction( int cardinality ) { setPropertyValue( getProfile().CARDINALITY(), "CARDINALITY", getModel().createTypedLiteral( cardinality ) ); return as( CardinalityRestriction.class ); }
/** * <p>Convert this restriction to a max cardinality restriction class expression</p> * @param cardinality The maximum cardinality for the restricted property * @return This class, but converted to a MaxCardinalityRestriction node * @exception ProfileException if {@link Profile#MAX_CARDINALITY()} is not supported in the current profile */ @Override public MaxCardinalityRestriction convertToMaxCardinalityRestriction( int cardinality ) { setPropertyValue( getProfile().MAX_CARDINALITY(), "MAX_CARDINALITY", getModel().createTypedLiteral( cardinality ) ); return as( MaxCardinalityRestriction.class ); }
/** * <p>Convert this restriction to a cardinality restriction class expression</p> * @param cardinality The exact cardinality for the restricted property * @return This class, but converted to a CardinalityRestriction node * @exception ProfileException if {@link Profile#CARDINALITY()} is not supported in the current profile */ @Override public CardinalityRestriction convertToCardinalityRestriction( int cardinality ) { setPropertyValue( getProfile().CARDINALITY(), "CARDINALITY", getModel().createTypedLiteral( cardinality ) ); return as( CardinalityRestriction.class ); }