org.eclipse.rdf4j.sparqlbuilder.core.query

## Class SelectQuery

- java.lang.Object
- - org.eclipse.rdf4j.sparqlbuilder.core.query.Query<T>
  - - org.eclipse.rdf4j.sparqlbuilder.core.query.OuterQuery<SelectQuery>
    - - org.eclipse.rdf4j.sparqlbuilder.core.query.SelectQuery

- All Implemented Interfaces:
    QueryElement

      public class SelectQuery
      extends OuterQuery<SelectQuery>

  A SPARQL Select query
  See Also:
    SPARQL Select Query

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.rdf4j.sparqlbuilder.core.query.OuterQuery

      `base, prefixes`

    - ### Fields inherited from class org.eclipse.rdf4j.sparqlbuilder.core.query.Query

      `bnodeCount, from, groupBy, having, limit, LIMIT, offset, OFFSET, orderBy, varCount, where`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SelectQuery` | `all()` Specify that this query's projection should select all in-scope expressions
    `SelectQuery` | `all(boolean selectAll)` Specify if this query's projection should select all in-scope expressions or not.
    `SelectQuery` | `distinct()` Specify the query's projection to be distinct
    `SelectQuery` | `distinct(boolean isDistinct)` Specify if the query's projection should be distinct or not
    `protected String` | `getQueryActionString()`
    `SelectQuery` | `select(Projectable... projectables)` Add expressions to the query's projection
    `SelectQuery` | `select(Projection select)` Set this query's projection

    - ### Methods inherited from class org.eclipse.rdf4j.sparqlbuilder.core.query.OuterQuery

      `base, base, getQueryString, prefix, prefix`

    - ### Methods inherited from class org.eclipse.rdf4j.sparqlbuilder.core.query.Query

      `bNode, from, from, groupBy, groupBy, having, having, limit, offset, orderBy, orderBy, var, where, where`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### distinct

          public SelectQuery distinct()

      Specify the query's projection to be distinct
      Returns:
        this
      See Also:
        `Projection.distinct()`

    - #### distinct

          public SelectQuery distinct(boolean isDistinct)

      Specify if the query's projection should be distinct or not
      Parameters:
        `isDistinct` - if this query's projection should be distinct
      Returns:
        this
      See Also:
        `Projection.distinct(boolean)`

    - #### all

          public SelectQuery all()

      Specify that this query's projection should select all in-scope expressions

      NOTE: setting this takes precedence over any expressions added to the projection via `select(Projectable...)` or `select(Projection)` when printing

      Returns:
        this
      See Also:
        `Projection.all()`

    - #### all

          public SelectQuery all(boolean selectAll)

      Specify if this query's projection should select all in-scope expressions or not.

      NOTE: if called with `true`, this setting will take precedence over any expressions added to the projection via `select(Projectable...)` or `select(Projection)` when converting to string via `OuterQuery.getQueryString()`

      Parameters:
        `selectAll` - if all in-scope expressions should be selected
      Returns:
        this
      See Also:
        `Projection.all(boolean)`

    - #### select

          public SelectQuery select(Projectable... projectables)

      Add expressions to the query's projection

      NOTE: if SELECT * has been specified (by `all()` or calling `all(boolean)` with `true`), that will take precedence over specified expressions when converting to string via `OuterQuery.getQueryString()`

      Parameters:
        `projectables` - expressions to add
      Returns:
        this
      See Also:
        `Projection.select(Projectable...)`

    - #### select

          public SelectQuery select(Projection select)

      Set this query's projection

      NOTE: if SELECT * has been specified (by `all()` or calling `all(boolean)` with `true`), that will take precedence over specified expressions when converting to string via `OuterQuery.getQueryString()`

      Parameters:
        `select` - the `Projection` to set
      Returns:
        this

    - #### getQueryActionString

          protected String getQueryActionString()

      Specified by:
        `getQueryActionString` in class `Query<SelectQuery>`

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.