Interface CardinalityRestriction

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

public interface CardinalityRestriction extends Restriction

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

  • Method Details

    • setCardinality

      void setCardinality(int cardinality)

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

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

      int getCardinality()

      Answer the cardinality of the restricted property.

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

      boolean hasCardinality(int cardinality)

      Answer true if this property restriction has the given cardinality.

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

      void removeCardinality(int cardinality)

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

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