Class TripleSourceBase
java.lang.Object
org.eclipse.rdf4j.federated.evaluation.TripleSourceBase
- All Implemented Interfaces:
TripleSource
- Direct Known Subclasses:
SailTripleSource,SparqlTripleSource
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceInterface defining the operation to be perform on the connectionprotected static classHolder for a result iteration to be used withwithConnection(ConnectionOperation). -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Endpointprotected final FederationContextprotected final Monitoring -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidapplyMaxExecutionTimeUpperBound(Operation operation) Apply an upper bound of the maximum execution time usingFedXUtil.applyMaxQueryExecutionTime(Operation, FederationContext).protected voidconfigureInference(Query query, QueryInfo queryInfo) Set includeInferred depending onQueryInfo.getIncludeInferred()getStatements(String preparedQuery, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo) Evaluate the prepared query (SPARQL query as String) on the provided endpoint.getStatements(String preparedQuery, BindingSet queryBindings, QueryType queryType, QueryInfo queryInfo) Evaluate a given SPARQL query of the provided query type at the given source.booleanhasStatements(ExclusiveTupleExpr group, BindingSet bindings) Check if the repository can return results for the givenExclusiveTupleExpr, e.g.booleanCheck if the repository can return results for the given triple pattern represented by subj, pred and objprotected voidprotected <T> CloseableIteration<T>withConnection(TripleSourceBase.ConnectionOperation<T> operation) Convenience method to perform an operation on aRepositoryConnection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.rdf4j.federated.evaluation.TripleSource
getStatements, getStatements, getStatements, hasStatements, usePreparedQuery
-
Field Details
-
federationContext
-
monitoringService
-
endpoint
-
-
Constructor Details
-
TripleSourceBase
-
-
Method Details
-
getStatements
public CloseableIteration<BindingSet> getStatements(String preparedQuery, BindingSet queryBindings, QueryType queryType, QueryInfo queryInfo) throws RepositoryException, MalformedQueryException, QueryEvaluationException Description copied from interface:TripleSourceEvaluate a given SPARQL query of the provided query type at the given source.- Specified by:
getStatementsin interfaceTripleSourcequeryBindings- optional query bindings, useEmptyBindingSetif there are none- Returns:
- the statements
- Throws:
RepositoryExceptionMalformedQueryExceptionQueryEvaluationException
-
getStatements
public CloseableIteration<BindingSet> getStatements(String preparedQuery, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo) throws RepositoryException, MalformedQueryException, QueryEvaluationException Description copied from interface:TripleSourceEvaluate the prepared query (SPARQL query as String) on the provided endpoint.- Specified by:
getStatementsin interfaceTripleSource- Parameters:
preparedQuery- a prepared query to evaluate (SPARQL query as String)bindings- the bindings to usefilterExpr- the filter expression to apply or null if there is no filter or if it is evaluated already- Returns:
- the resulting iteration
- Throws:
RepositoryExceptionMalformedQueryExceptionQueryEvaluationException
-
hasStatements
public boolean hasStatements(Resource subj, IRI pred, Value obj, QueryInfo queryInfo, Resource... contexts) throws RepositoryException Description copied from interface:TripleSourceCheck if the repository can return results for the given triple pattern represented by subj, pred and obj- Specified by:
hasStatementsin interfaceTripleSource- Returns:
- whether the source can provide results
- Throws:
RepositoryException
-
hasStatements
public boolean hasStatements(ExclusiveTupleExpr group, BindingSet bindings) throws RepositoryException, MalformedQueryException, QueryEvaluationException Description copied from interface:TripleSourceCheck if the repository can return results for the givenExclusiveTupleExpr, e.g. for anExclusiveGroupwith a list of Statements.- Specified by:
hasStatementsin interfaceTripleSource- Returns:
- whether the repository can return results
- Throws:
RepositoryExceptionMalformedQueryExceptionQueryEvaluationException
-
monitorRemoteRequest
protected void monitorRemoteRequest() -
configureInference
Set includeInferred depending onQueryInfo.getIncludeInferred()- Parameters:
query-queryInfo-
-
applyMaxExecutionTimeUpperBound
Apply an upper bound of the maximum execution time usingFedXUtil.applyMaxQueryExecutionTime(Operation, FederationContext).- Parameters:
operation- the operation
-
withConnection
protected <T> CloseableIteration<T> withConnection(TripleSourceBase.ConnectionOperation<T> operation) Convenience method to perform an operation on aRepositoryConnection. This method takes care for closing resources as well error handling. The resulting iteration has to be supplied to theTripleSourceBase.ResultHolder.- Parameters:
operation- theTripleSourceBase.ConnectionOperation- Returns:
- the resulting iteration
-