Interface MaxCardinalityRestriction

All Superinterfaces:
FrontsNode, OntClass, OntResource, RDFNode, Resource, Restriction
All Known Implementing Classes:
MaxCardinalityRestrictionImpl

public interface MaxCardinalityRestriction extends Restriction

A property restriction that requires the named property to have have at most the given number of values for a given instance to be a member of the class defined by the restriction.

  • Method Details

    • setMaxCardinality

      void setMaxCardinality(int cardinality)

      Assert that this restriction restricts the property to have the given maximum cardinality. Any existing statements for maxCardinality will be removed.

      Parameters:
      cardinality - The maximum cardinality of the restricted property
      Throws:
      ProfileException - If the Profile.MAX_CARDINALITY() property is not supported in the current language profile.
    • getMaxCardinality

      int getMaxCardinality()

      Answer the maximum cardinality of the restricted property.

      Returns:
      The maximum cardinality of the restricted property
      Throws:
      ProfileException - If the Profile.MAX_CARDINALITY() property is not supported in the current language profile.
    • hasMaxCardinality

      boolean hasMaxCardinality(int cardinality)

      Answer true if this property restriction has the given maximum cardinality.

      Parameters:
      cardinality - The cardinality to test against
      Returns:
      True if the given cardinality is the max cardinality of the restricted property in this restriction
      Throws:
      ProfileException - If the Profile.MAX_CARDINALITY() property is not supported in the current language profile.
    • removeMaxCardinality

      void removeMaxCardinality(int cardinality)

      Remove the statement that this restriction has the given maximum cardinality for the restricted property. If this statement is not true of the current model, nothing happens.

      Parameters:
      cardinality - A max cardinality value to be removed from this restriction