Class SparqlQueryEvaluator
java.lang.Object
fr.inria.rules.integraal.storage.external.evaluator.SparqlQueryEvaluator
- All Implemented Interfaces:
NativeQueryEvaluator<String, org.eclipse.rdf4j.query.TupleQueryResult>
public class SparqlQueryEvaluator
extends Object
implements NativeQueryEvaluator<String, org.eclipse.rdf4j.query.TupleQueryResult>
Evaluates a SPARQL query using the associated repository.
This evaluator uses rdf4j
This evaluator also provides additional methods for inserting and updating data on the triple store.
RepositoryConnection to execute the query on the triple store
The result is a TupleQueryResult which represents the list of all resulting tuples.
This evaluator also provides additional methods for inserting and updating data on the triple store.
-
Constructor Summary
ConstructorsConstructorDescriptionSparqlQueryEvaluator(org.eclipse.rdf4j.repository.Repository repo) Construct a new evaluator over the triple store represented by the given repository -
Method Summary
Modifier and TypeMethodDescriptionOptional<org.eclipse.rdf4j.query.TupleQueryResult> Evaluate the given query and returns the result This should not do anymore workbooleaninsert(org.eclipse.rdf4j.model.Statement statement) Insert the given statementbooleaninsertBatch(List<org.eclipse.rdf4j.model.Statement> statements) Insert the given statements, using a batch insert and parameters for the querybooleanExecutes the given SPARQL update query
-
Constructor Details
-
SparqlQueryEvaluator
public SparqlQueryEvaluator(org.eclipse.rdf4j.repository.Repository repo) Construct a new evaluator over the triple store represented by the given repository- Parameters:
repo- representing the triple store to connect to- Throws:
org.eclipse.rdf4j.repository.RepositoryException- if the initial connection to the triple store cannot be performed
-
-
Method Details
-
evaluate
Description copied from interface:NativeQueryEvaluatorEvaluate the given query and returns the result This should not do anymore work- Specified by:
evaluatein interfaceNativeQueryEvaluator<String, org.eclipse.rdf4j.query.TupleQueryResult>- Parameters:
query- to evaluate- Returns:
- an optional which contains the results of the query if everything went right, an empty optional otherwise
-
insert
public boolean insert(org.eclipse.rdf4j.model.Statement statement) Insert the given statement- Parameters:
statement- to insert- Returns:
- true iff the query has been executed without problem
-
insertBatch
Insert the given statements, using a batch insert and parameters for the query- Parameters:
statements- to insert- Returns:
- true iff the queries have been executed without problem
-
update
Executes the given SPARQL update query- Parameters:
query- to evaluate- Returns:
- true iff the query has been executed without problem
-