Package org.eclipse.rdf4j.sail.lucene

## Class QuerySpec

- java.lang.Object
- - org.eclipse.rdf4j.sail.lucene.AbstractSearchQueryEvaluator
  - - org.eclipse.rdf4j.sail.lucene.QuerySpec

- All Implemented Interfaces:
    `SearchQueryEvaluator`

      public class QuerySpec
      extends AbstractSearchQueryEvaluator

  A QuerySpec holds information extracted from a TupleExpr corresponding with a single Lucene query. Access the patterns or use the get-methods to get the names of the variables to bind.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `QuerySpec​(String matchesVarName, String propertyVarName, String scoreVarName, String snippetVarName, Resource subject, String queryString, IRI propertyURI)` |
    `QuerySpec​(StatementPattern matchesPattern, StatementPattern queryPattern, StatementPattern propertyPattern, StatementPattern scorePattern, StatementPattern snippetPattern, StatementPattern typePattern, Resource subject, String queryString, IRI propertyURI)` |
    `QuerySpec​(StatementPattern matchesPattern, StatementPattern queryPattern, StatementPattern propertyPattern, StatementPattern scorePattern, StatementPattern snippetPattern, StatementPattern typePattern, StatementPattern idPattern, Resource subject, String queryString, IRI propertyURI)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `StatementPattern` | `getIdPattern()` |
    `StatementPattern` | `getMatchesPattern()` |
    `String` | `getMatchesVariableName()` | return the name of the bound variable that should match the query
    `QueryModelNode` | `getParentQueryModelNode()` |
    `StatementPattern` | `getPropertyPattern()` |
    `IRI` | `getPropertyURI()` |
    `String` | `getPropertyVariableName()` |
    `StatementPattern` | `getQueryPattern()` |
    `String` | `getQueryString()` | return the literal expression of the query or null, if none set.
    `IRI` | `getQueryType()` | the type of query, must equal `LuceneSailSchema.LUCENE_QUERY`.
    `StatementPattern` | `getScorePattern()` |
    `String` | `getScoreVariableName()` | The variable name associated with the query score
    `StatementPattern` | `getSnippetPattern()` |
    `String` | `getSnippetVariableName()` |
    `Resource` | `getSubject()` |
    `StatementPattern` | `getTypePattern()` |
    `boolean` | `isEvaluable()` |
    `QueryModelNode` | `removeQueryPatterns()` | Removes the query patterns and returns a placeholder where the query results could be placed.
    `String` | `toString()` |

    - ### Methods inherited from class org.eclipse.rdf4j.sail.lucene.AbstractSearchQueryEvaluator

      `replaceQueryPatternsWithResults`

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

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

- - ### Constructor Detail

    - #### QuerySpec

          public QuerySpec​(StatementPattern matchesPattern,
                           StatementPattern queryPattern,
                           StatementPattern propertyPattern,
                           StatementPattern scorePattern,
                           StatementPattern snippetPattern,
                           StatementPattern typePattern,
                           Resource subject,
                           String queryString,
                           IRI propertyURI)

    - #### QuerySpec

          public QuerySpec​(StatementPattern matchesPattern,
                           StatementPattern queryPattern,
                           StatementPattern propertyPattern,
                           StatementPattern scorePattern,
                           StatementPattern snippetPattern,
                           StatementPattern typePattern,
                           StatementPattern idPattern,
                           Resource subject,
                           String queryString,
                           IRI propertyURI)

    - #### QuerySpec

          public QuerySpec​(String matchesVarName,
                           String propertyVarName,
                           String scoreVarName,
                           String snippetVarName,
                           Resource subject,
                           String queryString,
                           IRI propertyURI)

  - ### Method Detail

    - #### getParentQueryModelNode

          public QueryModelNode getParentQueryModelNode()

    - #### removeQueryPatterns

          public QueryModelNode removeQueryPatterns()

      Description copied from interface: `SearchQueryEvaluator`
      Removes the query patterns and returns a placeholder where the query results could be placed.

    - #### getMatchesPattern

          public StatementPattern getMatchesPattern()

    - #### getMatchesVariableName

          public String getMatchesVariableName()

      return the name of the bound variable that should match the query
      Returns:
        the name of the variable or null, if no name set

    - #### getQueryPattern

          public StatementPattern getQueryPattern()

    - #### getPropertyPattern

          public StatementPattern getPropertyPattern()

    - #### getIdPattern

          public StatementPattern getIdPattern()

    - #### getPropertyVariableName

          public String getPropertyVariableName()

    - #### getScorePattern

          public StatementPattern getScorePattern()

    - #### getScoreVariableName

          public String getScoreVariableName()

      The variable name associated with the query score
      Returns:
        the name or null, if no score is queried in the pattern

    - #### getSnippetPattern

          public StatementPattern getSnippetPattern()

    - #### getSnippetVariableName

          public String getSnippetVariableName()

    - #### getTypePattern

          public StatementPattern getTypePattern()

    - #### getQueryType

          public IRI getQueryType()

      the type of query, must equal `LuceneSailSchema.LUCENE_QUERY`. A null type is possible, but not valid.
      Returns:
        the type of the Query or null, if no type assigned.

    - #### getSubject

          public Resource getSubject()

    - #### getQueryString

          public String getQueryString()

      return the literal expression of the query or null, if none set. (null values are possible, but not valid).
      Returns:
        the query or null

    - #### getPropertyURI

          public IRI getPropertyURI()

      Returns:
        The URI of the property who's literal values should be searched, or `null`

    - #### isEvaluable

          public boolean isEvaluable()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`