Class MaxCardinalityQRestrictionImpl

All Implemented Interfaces:
FrontsNode, MaxCardinalityQRestriction, OntClass, OntResource, QualifiedRestriction, Restriction, RDFNode, Resource

public class MaxCardinalityQRestrictionImpl extends QualifiedRestrictionImpl implements MaxCardinalityQRestriction

Implementation of the max qualified cardinality restriction

  • Field Details

    • factory

      public static Implementation factory
      A factory for generating QualifiedRestriction facets from nodes in enhanced graphs. Note: should not be invoked directly by user code: use as() instead.
  • Constructor Details

    • MaxCardinalityQRestrictionImpl

      public MaxCardinalityQRestrictionImpl(Node n, EnhGraph g)

      Construct a qualified restriction node represented by the given node in the given graph.

      Parameters:
      n - The node that represents the resource
      g - The enh graph that contains n
  • Method Details

    • isMaxCardinalityQRestriction

      public static boolean isMaxCardinalityQRestriction(Node node, EnhGraph eg)
    • isValid

      public boolean isValid()
      Description copied from class: Polymorphic
      answer true iff this enhanced node is still underpinned in the graph by triples appropriate to its type.
      Overrides:
      isValid in class QualifiedRestrictionImpl
    • setMaxCardinalityQ

      public void setMaxCardinalityQ(int cardinality)

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

      Specified by:
      setMaxCardinalityQ in interface MaxCardinalityQRestriction
      Parameters:
      cardinality - The cardinality of the restricted property
      Throws:
      ProfileException - If the Profile.MAX_CARDINALITY_Q() property is not supported in the current language profile.
    • getMaxCardinalityQ

      public int getMaxCardinalityQ()

      Answer the cardinality of the restricted property.

      Specified by:
      getMaxCardinalityQ in interface MaxCardinalityQRestriction
      Returns:
      The cardinality of the restricted property
      Throws:
      ProfileException - If the Profile.MAX_CARDINALITY_Q() property is not supported in the current language profile.
    • hasMaxCardinalityQ

      public boolean hasMaxCardinalityQ(int cardinality)

      Answer true if this property restriction has the given cardinality.

      Specified by:
      hasMaxCardinalityQ in interface MaxCardinalityQRestriction
      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.MAX_CARDINALITY_Q() property is not supported in the current language profile.
    • removeMaxCardinalityQ

      public void removeMaxCardinalityQ(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.

      Specified by:
      removeMaxCardinalityQ in interface MaxCardinalityQRestriction
      Parameters:
      cardinality - A cardinality value to be removed from this restriction
      Throws:
      ProfileException - If the Profile.MAX_CARDINALITY_Q() property is not supported in the current language profile.