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 Description TupleAndGraphQueryEvaluator(ConsoleIO consoleIO, ConsoleState state, Map<String,ConsoleSetting> settings)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
evaluateBooleanQuery(QueryLanguage queryLn, String queryString, QueryResultWriter writer)
Evaluate a boolean SPARQL queryprotected void
evaluateGraphQuery(QueryLanguage queryLn, String queryString, RDFWriter writer, Collection<Namespace> namespaces)
Evaluate SPARQL graph queryprotected void
evaluateTupleQuery(QueryLanguage queryLn, String queryString, QueryResultWriter writer)
Evaluate SPARQL tuple query and send the output to a writer.protected void
executeUpdate(QueryLanguage queryLn, String queryString)
Execute a SPARQL updateprotected ConsoleIO
getConsoleIO()
Get console IOprotected Map<String,ConsoleSetting>
getConsoleSettings()
Get console settingsprotected ConsoleState
getConsoleState()
Get console State
-
-
-
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 tuple query and send the output to a writer. If writer is null, the console will be used for output.- Parameters:
queryLn
- query languagequeryString
- query stringwriter
- 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 graph query- Parameters:
queryLn
- query languagequeryString
- query stringwriter
- RDFWriter to write the results tonamespaces
- 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 query- Parameters:
queryLn
- query languagequeryString
- query stringwriter
-- Throws:
UnsupportedQueryLanguageException
MalformedQueryException
QueryEvaluationException
RepositoryException
-
executeUpdate
protected void executeUpdate(QueryLanguage queryLn, String queryString) throws RepositoryException, UpdateExecutionException, MalformedQueryException
Execute a SPARQL update- Parameters:
queryLn
- query languagequeryString
- query string- Throws:
RepositoryException
UpdateExecutionException
MalformedQueryException
-
-