Class SomeValuesFromRestrictionImpl

All Implemented Interfaces:
FrontsNode, OntClass, OntResource, Restriction, SomeValuesFromRestriction, RDFNode, Resource

public class SomeValuesFromRestrictionImpl extends RestrictionImpl implements SomeValuesFromRestriction

Implementation of the someValuesFrom restriction abstraction.

  • Field Details

    • factory

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

    • SomeValuesFromRestrictionImpl

      public SomeValuesFromRestrictionImpl(Node n, EnhGraph g)

      Construct a hasValue 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

    • setSomeValuesFrom

      public void setSomeValuesFrom(Resource cls)

      Assert that this restriction restricts the property to have at least one value that is a member of the given class. Any existing statements for someValuesFrom will be removed.

      Specified by:
      setSomeValuesFrom in interface SomeValuesFromRestriction
      Parameters:
      cls - The class that at least one value of the property must belong to
      Throws:
      ProfileException - If the Profile.SOME_VALUES_FROM() property is not supported in the current language profile.
    • getSomeValuesFrom

      public Resource getSomeValuesFrom()

      Answer the resource characterising the constraint on at least one value of the restricted property. This may be a class, the URI of a concrete datatype, a DataRange object or the URI rdfs:Literal.

      Specified by:
      getSomeValuesFrom in interface SomeValuesFromRestriction
      Returns:
      A resource, which will have been pre-converted to the appropriate Java value type (OntClass or DataRange) if appropriate.
      Throws:
      ProfileException - If the Profile.SOME_VALUES_FROM() property is not supported in the current language profile.
    • hasSomeValuesFrom

      public boolean hasSomeValuesFrom(Resource cls)

      Answer true if this property restriction has the given class as the class to which at least one value of the restricted property must belong.

      Specified by:
      hasSomeValuesFrom in interface SomeValuesFromRestriction
      Parameters:
      cls - A class to test
      Returns:
      True if the given class is the class to which at least one value must belong
      Throws:
      ProfileException - If the Profile.SOME_VALUES_FROM() property is not supported in the current language profile.
    • removeSomeValuesFrom

      public void removeSomeValuesFrom(Resource cls)

      Remove the statement that this restriction has some values from the given class among the values for the restricted property. If this statement is not true of the current model, nothing happens.

      Specified by:
      removeSomeValuesFrom in interface SomeValuesFromRestriction
      Parameters:
      cls - A Resource the denotes the class to be removed from this restriction