Class 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.
    • Method Detail

      • replace

        private static void replace​(QueryModelNode pattern,
                                    java.util.function.Supplier<? extends QueryModelNode> replacement)
        Replace the given pattern with a new instance of the given replacement type.
        Parameters:
        pattern - the pattern to remove
        replacement - the replacement type
      • append

        private static void append​(StatementPattern pattern,
                                   java.lang.StringBuilder buffer)
      • append

        private static void append​(Var var,
                                   java.lang.StringBuilder buffer)
      • 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.
      • getMatchesVariableName

        public java.lang.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
      • getScoreVariableName

        public java.lang.String getScoreVariableName()
        The variable name associated with the query score
        Returns:
        the name or null, if no score is queried in the pattern
      • 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()
      • isEvaluable

        public boolean isEvaluable()
      • isHighlight

        public boolean isHighlight()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getCatQuery

        public java.lang.String getCatQuery()