Package org.eclipse.rdf4j.console.command

## Class QueryEvaluator

- java.lang.Object
- - org.eclipse.rdf4j.console.command.ConsoleCommand
  - - org.eclipse.rdf4j.console.command.QueryEvaluator

- All Implemented Interfaces:
    `Command`, `Help`
  Direct Known Subclasses:
    `Sparql`

      public abstract class QueryEvaluator
      extends ConsoleCommand

  Abstract query evaluator command
  Author:
    Dale Visser, Bart Hanssens

- - ### Field Summary

    - ### Fields inherited from class org.eclipse.rdf4j.console.command.ConsoleCommand

      `LOGGER`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `QueryEvaluator​(TupleAndGraphQueryEvaluator evaluator)` | Constructor

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected abstract void` | `addQueryPrefixes​(StringBuffer result, Collection<Namespace> namespaces)` | Add namespace prefixes to query
    `void` | `executeQuery​(String command, String operation)` | Execute a SPARQL query
    `protected abstract boolean` | `hasQueryPrefixes​(String query)` | Check if query string already contains query prefixes
    `String[]` | `usesSettings()` | Return the names of the settings used.

    - ### Methods inherited from class org.eclipse.rdf4j.console.command.ConsoleCommand

      `askProceed, execute, getConsoleIO, getConsoleSettings, getConsoleState, getHelpLong, getHelpShort, write, writeError, writeError, writeInfo, writeln, writeUnopenedError`

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

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

    - ### Methods inherited from interface org.eclipse.rdf4j.console.Help

      `getName`

- - ### Constructor Detail

    - #### QueryEvaluator

          public QueryEvaluator​(TupleAndGraphQueryEvaluator evaluator)

      Constructor
      Parameters:
        `evaluator` -

  - ### Method Detail

    - #### hasQueryPrefixes

          protected abstract boolean hasQueryPrefixes​(String query)

      Check if query string already contains query prefixes
      Parameters:
        `query` - query string
      Returns:
        true if namespaces are already used

    - #### addQueryPrefixes

          protected abstract void addQueryPrefixes​(StringBuffer result,
                                                   Collection<Namespace> namespaces)

      Add namespace prefixes to query
      Parameters:
        `result` -
        `namespaces` - collection of known namespaces

    - #### usesSettings

          public String[] usesSettings()

      Description copied from interface: `Command`
      Return the names of the settings used.
      Specified by:
        `usesSettings` in interface `Command`
      Overrides:
        `usesSettings` in class `ConsoleCommand`
      Returns:
        string array of settings

    - #### executeQuery

          public void executeQuery​(String command,
                                   String operation)

      Execute a SPARQL query
      Parameters:
        `command` - to execute
        `operation` - "sparql", "base" or SPARQL query form