Class QualifiedRestrictionImpl

    • Field Detail

      • 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 Detail

      • QualifiedRestrictionImpl

        public QualifiedRestrictionImpl​(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 Detail

      • 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 EnhNode
      • setHasClassQ

        public void setHasClassQ​(OntClass cls)

        Assert that this qualified restriction restricts the property to have a given cardinality and to have values belonging to the class denoted by hasClassQ. Any existing statements for hasClassQ will be removed.

        Specified by:
        setHasClassQ in interface QualifiedRestriction
        Parameters:
        cls - The class to which all of the value of the restricted property must belong
        Throws:
        ProfileException - If the Profile.HAS_CLASS_Q() property is not supported in the current language profile.
      • hasHasClassQ

        public boolean hasHasClassQ​(OntClass cls)

        Answer true if this qualified property restriction has the given class as the class to which all of the property values must belong.

        Specified by:
        hasHasClassQ in interface QualifiedRestriction
        Parameters:
        cls - The class to test against
        Returns:
        True if the given class is the class to which all members of this restriction must belong
        Throws:
        ProfileException - If the Profile.HAS_CLASS_Q() property is not supported in the current language profile.
      • hasHasClassQ

        public boolean hasHasClassQ​(DataRange dr)

        Answer true if this qualified property restriction has the given datarange as the class to which all of the property values must belong.

        Specified by:
        hasHasClassQ in interface QualifiedRestriction
        Parameters:
        dr - The datarange to test against
        Returns:
        True if the given class is the class to which all members of this restriction must belong
        Throws:
        ProfileException - If the Profile.HAS_CLASS_Q() property is not supported in the current language profile.
      • removeHasClassQ

        public void removeHasClassQ​(OntClass cls)

        Remove the statement that this restriction has the given class as the class to which all values must belong. If this statement is not true of the current model, nothing happens.

        Specified by:
        removeHasClassQ in interface QualifiedRestriction
        Parameters:
        cls - The ont class that is the object of the hasClassQ property.
      • removeHasClassQ

        public void removeHasClassQ​(DataRange dr)

        Remove the statement that this restriction has the given datarange as the class to which all values must belong. If this statement is not true of the current model, nothing happens.

        Specified by:
        removeHasClassQ in interface QualifiedRestriction
        Parameters:
        dr - The datarange that is the object of the hasClassQ property.