Class AbstractOperation

  • All Implemented Interfaces:
    Operation
    Direct Known Subclasses:
    AbstractQuery, AbstractUpdate

    public abstract class AbstractOperation
    extends java.lang.Object
    implements Operation
    Abstract super class of all operation types.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractOperation()
      Creates a new operation object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clearBindings()
      Removes all previously set bindings.
      BindingSet getBindings()
      Retrieves the bindings that have been set on this operation.
      Dataset getDataset()
      Gets the dataset that has been set using Operation.setDataset(Dataset), if any.
      boolean getIncludeInferred()
      Returns whether or not this operation will return inferred statements (if any are present in the repository).
      int getMaxExecutionTime()
      Returns the maximum operation execution time.
      void removeBinding​(java.lang.String name)
      Removes a previously set binding on the supplied variable.
      void setBinding​(java.lang.String name, Value value)
      Binds the specified variable to the supplied value.
      void setDataset​(Dataset dataset)
      Specifies the dataset against which to execute an operation, overriding any dataset that is specified in the operation itself.
      void setIncludeInferred​(boolean includeInferred)
      Determine whether evaluation results of this operation should include inferred statements (if any inferred statements are present in the repository).
      void setMaxExecutionTime​(int maxExecutionTimeSeconds)
      Specifies the maximum time that an operation is allowed to run.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • dataset

        protected Dataset dataset
      • includeInferred

        protected boolean includeInferred
      • maxExecutionTimeSeconds

        private int maxExecutionTimeSeconds
    • Constructor Detail

      • AbstractOperation

        protected AbstractOperation()
        Creates a new operation object.
    • Method Detail

      • setBinding

        public void setBinding​(java.lang.String name,
                               Value value)
        Description copied from interface: Operation
        Binds the specified variable to the supplied value. Any value that was previously bound to the specified value will be overwritten.
        Specified by:
        setBinding in interface Operation
        Parameters:
        name - The name of the variable that should be bound.
        value - The (new) value for the specified variable.
      • removeBinding

        public void removeBinding​(java.lang.String name)
        Description copied from interface: Operation
        Removes a previously set binding on the supplied variable. Calling this method with an unbound variable name has no effect.
        Specified by:
        removeBinding in interface Operation
        Parameters:
        name - The name of the variable from which the binding is to be removed.
      • clearBindings

        public void clearBindings()
        Description copied from interface: Operation
        Removes all previously set bindings.
        Specified by:
        clearBindings in interface Operation
      • setDataset

        public void setDataset​(Dataset dataset)
        Description copied from interface: Operation
        Specifies the dataset against which to execute an operation, overriding any dataset that is specified in the operation itself.
        Specified by:
        setDataset in interface Operation
      • setIncludeInferred

        public void setIncludeInferred​(boolean includeInferred)
        Description copied from interface: Operation
        Determine whether evaluation results of this operation should include inferred statements (if any inferred statements are present in the repository). The default setting is 'true'.
        Specified by:
        setIncludeInferred in interface Operation
        Parameters:
        includeInferred - indicates whether inferred statements should be included in the result.
      • getIncludeInferred

        public boolean getIncludeInferred()
        Description copied from interface: Operation
        Returns whether or not this operation will return inferred statements (if any are present in the repository).
        Specified by:
        getIncludeInferred in interface Operation
        Returns:
        true if inferred statements will be returned, false otherwise.
      • setMaxExecutionTime

        public void setMaxExecutionTime​(int maxExecutionTimeSeconds)
        Description copied from interface: Operation
        Specifies the maximum time that an operation is allowed to run. The operation will be interrupted when it exceeds the time limit. Any consecutive requests to fetch query results will result in QueryInterruptedExceptions or UpdateExecutionExceptions (depending on whether the operation is a query or an update).
        Specified by:
        setMaxExecutionTime in interface Operation
        Parameters:
        maxExecutionTimeSeconds - The maximum query time, measured in seconds. A negative or zero value indicates an unlimited execution time (which is the default).