org.eclipse.rdf4j.console.command

## Class TupleAndGraphQueryEvaluator

- java.lang.Object
- - org.eclipse.rdf4j.console.command.TupleAndGraphQueryEvaluator

-     public class TupleAndGraphQueryEvaluator
      extends Object

  Evaluator tuple and graph queries
  Author:
    dale

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TupleAndGraphQueryEvaluator(ConsoleIO consoleIO, ConsoleState state, Map<String,ConsoleSetting> settings)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `evaluateBooleanQuery(QueryLanguage queryLn, String queryString, QueryResultWriter writer)` Evaluate a boolean SPARQL or SERQL query
    `protected void` | `evaluateGraphQuery(QueryLanguage queryLn, String queryString, RDFWriter writer, Collection<Namespace> namespaces)` Evaluate SPARQL or SERQL graph query
    `protected void` | `evaluateTupleQuery(QueryLanguage queryLn, String queryString, QueryResultWriter writer)` Evaluate SPARQL or SERQL tuple query and send the output to a writer.
    `protected void` | `executeUpdate(QueryLanguage queryLn, String queryString)` Execute a SPARQL or SERQL update
    `protected ConsoleIO` | `getConsoleIO()` Get console IO
    `protected Map<String,ConsoleSetting>` | `getConsoleSettings()` Get console settings
    `protected ConsoleState` | `getConsoleState()` Get console State

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

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

- - ### Constructor Detail

    - #### TupleAndGraphQueryEvaluator

          public TupleAndGraphQueryEvaluator(ConsoleIO consoleIO,
                                             ConsoleState state,
                                             Map<String,ConsoleSetting> settings)

      Constructor
      Parameters:
        `consoleIO` -
        `state` -
        `settings` -

  - ### Method Detail

    - #### getConsoleIO

          protected ConsoleIO getConsoleIO()

      Get console IO
      Returns:
        console IO

    - #### getConsoleState

          protected ConsoleState getConsoleState()

      Get console State
      Returns:
        console state

    - #### getConsoleSettings

          protected Map<String,ConsoleSetting> getConsoleSettings()

      Get console settings
      Returns:
        console settings

    - #### evaluateTupleQuery

          protected void evaluateTupleQuery(QueryLanguage queryLn,
                                            String queryString,
                                            QueryResultWriter writer)
                                     throws UnsupportedQueryLanguageException,
                                            MalformedQueryException,
                                            QueryEvaluationException,
                                            RepositoryException

      Evaluate SPARQL or SERQL tuple query and send the output to a writer. If writer is null, the console will be used for output.
      Parameters:
        `queryLn` - query language
        `queryString` - query string
        `writer` - result writer or null
      Throws:
        `UnsupportedQueryLanguageException`
        `MalformedQueryException`
        `QueryEvaluationException`
        `RepositoryException`

    - #### evaluateGraphQuery

          protected void evaluateGraphQuery(QueryLanguage queryLn,
                                            String queryString,
                                            RDFWriter writer,
                                            Collection<Namespace> namespaces)
                                     throws UnsupportedQueryLanguageException,
                                            MalformedQueryException,
                                            QueryEvaluationException,
                                            RepositoryException

      Evaluate SPARQL or SERQL graph query
      Parameters:
        `queryLn` - query language
        `queryString` - query string
        `writer` - RDFWriter to write the results to
        `namespaces` - namespaces to write to the RDFWriter
      Throws:
        `UnsupportedQueryLanguageException`
        `MalformedQueryException`
        `QueryEvaluationException`
        `RepositoryException`

    - #### evaluateBooleanQuery

          protected void evaluateBooleanQuery(QueryLanguage queryLn,
                                              String queryString,
                                              QueryResultWriter writer)
                                       throws UnsupportedQueryLanguageException,
                                              MalformedQueryException,
                                              QueryEvaluationException,
                                              RepositoryException

      Evaluate a boolean SPARQL or SERQL query
      Parameters:
        `queryLn` - query language
        `queryString` - query string
        `writer` -
      Throws:
        `UnsupportedQueryLanguageException`
        `MalformedQueryException`
        `QueryEvaluationException`
        `RepositoryException`

    - #### executeUpdate

          protected void executeUpdate(QueryLanguage queryLn,
                                       String queryString)
                                throws RepositoryException,
                                       UpdateExecutionException,
                                       MalformedQueryException

      Execute a SPARQL or SERQL update
      Parameters:
        `queryLn` - query language
        `queryString` - query string
      Throws:
        `RepositoryException`
        `UpdateExecutionException`
        `MalformedQueryException`

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