Package com.stardog.stark.query

# Interface Query

All Known Subinterfaces:
  `BooleanQuery`, `GraphQuery`, `ReadQuery`, `SelectQuery`, `UpdateQuery`

public interface Query

A query over a semantic graph

Since:
  1.0
Version:
  1.0
Author:
  Michael Grove
Implementation Notes:
  By default, a `Query` is assumed to have no timeout, reasoning disabled, and use `Datasets.NO_DATASET` as its active graph for evaluation.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final long`
  `NO_TIMEOUT`
  Constant for no timeout

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default String`
  `baseIRI()`
  Return the base URI for this query
  `Dataset`
  `dataset()`
  Return the `Dataset` within the database the query should be executed against.
  `Query`
  `dataset(Dataset theDataset)`
  Specify the `Dataset` within the database the query should be executed against.
  `QueryLanguage`
  `language()`
  The language the query is serialized in
  `Query`
  `parameter(String theName, boolean theValue)`
  Set the parameter to the `xsd:boolean` value
  `Query`
  `parameter(String theName, byte theValue)`
  Set the parameter to the xsd:byte value
  `Query`
  `parameter(String theName, double theValue)`
  Set the parameter to the `xsd:double` value
  `Query`
  `parameter(String theName, float theValue)`
  Set the parameter to the `xsd:float` value
  `Query`
  `parameter(String theName, int theValue)`
  Set the parameter to the `xsd:int` value
  `Query`
  `parameter(String theName, long theValue)`
  Set the parameter to the `xsd:long` value
  `Query`
  `parameter(String theName, short theValue)`
  Set the parameter to the `xsd:short` value
  `Query`
  `parameter(String theName, Value theValue)`
  Set the `Value` of the parameter
  `Query`
  `parameter(String theName, Object theObj)`
  Set the parameter to the specified value.
  `Query`
  `parameter(String theName, String theValue)`
  Set the parameter to the xsd:string value
  `Query`
  `parameter(String theName, URI theURI)`
  Set the parameter to the xsd:URI value
  `Query`
  `parameter(String theName, Date theValue)`
  Set the parameter to the xsd:date value
  `Query`
  `parameter(String theName, GregorianCalendar theValue)`
  Set the parameter to the xsd:dateTime value
  `Map<String,Value>`
  `parameters()`
  Return *a copy* of the current parameters.
  `boolean`
  `reasoning()`
  Return whether or not reasoning should be used when evaluating this query
  `Query`
  `reasoning(boolean theEnabled)`
  Set whether or not this query should be evaluated using reasoning
  `Query`
  `removeParameter(String theName)`
  Unset the given parameter.
  `String`
  `string()`
  The query string
  `long`
  `timeout()`
  Return the timeout of this `Query` *in milliseconds*.
  `Query`
  `timeout(long theTimeout, TimeUnit theUnit)`
  Set the timeout of this `Query`

- ## Field Details

  - ### NO_TIMEOUT

    static final long NO_TIMEOUT
    Constant for no timeout
    See Also:
      - Constant Field Values

- ## Method Details

  - ### reasoning

    boolean reasoning()
    Return whether or not reasoning should be used when evaluating this query
    Returns:
      `true` if enabled, `false` otherwise

  - ### reasoning

    @Nonnull Query reasoning(boolean theEnabled)
    Set whether or not this query should be evaluated using reasoning
    Parameters:
      `theEnabled` - `true` to use reasoning, `false` otherwise
    Returns:
      this `Query`

  - ### string

    @Nonnull String string()
    The query string
    Returns:
      the query string

  - ### baseIRI

    @Nonnull default String baseIRI()
    Return the base URI for this query
    Returns:
      the base

  - ### language

    @Nonnull QueryLanguage language()
    The language the query is serialized in
    Returns:
      the query language

  - ### timeout

    long timeout()
    Return the timeout of this `Query` *in milliseconds*.
    Returns:
      the timeout (ms); `-1L` is returned when the timeout value is *not* set

  - ### timeout

    @Nonnull Query timeout(long theTimeout, @Nonnull TimeUnit theUnit)
    Set the timeout of this `Query`
    Parameters:
      `theTimeout` - the timeout, `-1L` should be used to disable the timeout
      `theUnit` - the unit for the timeout value
    Returns:
      this object

  - ### dataset

    @Nonnull Dataset dataset()
    Return the `Dataset` within the database the query should be executed against.
    Returns:
      the active graph for the query
    API Note:
      Some query languages allow the active graph, ie the dataset, to be specified _within_ the query. In those cases, it is expected that this dataset would *override* any provided in the query.

  - ### dataset

    @Nonnull Query dataset(@Nonnull Dataset theDataset)
    Specify the `Dataset` within the database the query should be executed against.
    Parameters:
      `theDataset` - the dataset
    Returns:
      this query
    API Note:
      Some query languages allow the active graph, ie the dataset, to be specified _within_ the query. In those cases, it is expected that this dataset would *override* any provided in the query.

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, @Nonnull Value theValue)
    Set the `Value` of the parameter
    Parameters:
      `theName` - the parameter to set
      `theValue` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, int theValue)
    Set the parameter to the `xsd:int` value
    Parameters:
      `theName` - the parameter to set
      `theValue` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, long theValue)
    Set the parameter to the `xsd:long` value
    Parameters:
      `theName` - the parameter to set
      `theValue` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, float theValue)
    Set the parameter to the `xsd:float` value
    Parameters:
      `theName` - the parameter to set
      `theValue` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, double theValue)
    Set the parameter to the `xsd:double` value
    Parameters:
      `theName` - the parameter to set
      `theValue` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, short theValue)
    Set the parameter to the `xsd:short` value
    Parameters:
      `theName` - the parameter to set
      `theValue` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, boolean theValue)
    Set the parameter to the `xsd:boolean` value
    Parameters:
      `theName` - the parameter to set
      `theValue` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, byte theValue)
    Set the parameter to the xsd:byte value
    Parameters:
      `theName` - the parameter to set
      `theValue` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, @Nonnull String theValue)
    Set the parameter to the xsd:string value
    Parameters:
      `theName` - the parameter to set
      `theValue` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, @Nonnull Date theValue)
    Set the parameter to the xsd:date value
    Parameters:
      `theName` - the parameter to set
      `theValue` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, @Nonnull GregorianCalendar theValue)
    Set the parameter to the xsd:dateTime value
    Parameters:
      `theName` - the parameter to set
      `theValue` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, @Nonnull URI theURI)
    Set the parameter to the xsd:URI value
    Parameters:
      `theName` - the parameter to set
      `theURI` - the value of the parameter
    Returns:
      this query

  - ### parameter

    @Nonnull Query parameter(@Nonnull String theName, @Nonnull Object theObj)
    Set the parameter to the specified value. Convenience method which will delegate to one of the other parameter(...) methods
    Parameters:
      `theName` - the parameter name
      `theObj` - the param value
    Returns:
      this query

  - ### removeParameter

    @Nonnull Query removeParameter(@Nonnull String theName)
    Unset the given parameter. If it is not set, this method does nothing.
    Parameters:
      `theName` - the parameter
    Returns:
      this query

  - ### parameters

    @Nonnull Map<String,Value> parameters()
    Return *a copy* of the current parameters. Modifications to this `Map` are not reflected in the current set parameters.
    Returns:
      the parameters