public abstract class TripleSourceBase extends Object implements TripleSource
Modifier and Type | Class and Description |
---|---|
protected static interface |
TripleSourceBase.ConnectionOperation<T>
Interface defining the operation to be perform on the connection
|
protected static class |
TripleSourceBase.ResultHolder<T>
Holder for a result iteration to be used with
withConnection(ConnectionOperation) . |
Modifier and Type | Field and Description |
---|---|
protected Endpoint |
endpoint |
protected FederationContext |
federationContext |
protected Monitoring |
monitoringService |
protected FederationEvalStrategy |
strategy |
Constructor and Description |
---|
TripleSourceBase(FederationContext federationContext,
Endpoint endpoint) |
Modifier and Type | Method and Description |
---|---|
protected void |
applyMaxExecutionTimeUpperBound(Operation operation)
Apply an upper bound of the maximum execution time using
FedXUtil.applyMaxQueryExecutionTime(Operation, FederationContext) . |
protected void |
configureInference(Query query,
QueryInfo queryInfo)
Set includeInferred depending on
QueryInfo.getIncludeInferred() |
CloseableIteration<BindingSet,QueryEvaluationException> |
getStatements(String preparedQuery,
BindingSet bindings,
FilterValueExpr filterExpr,
QueryInfo queryInfo)
Evaluate the prepared query (SPARQL query as String) on the provided endpoint.
|
CloseableIteration<BindingSet,QueryEvaluationException> |
getStatements(String preparedQuery,
BindingSet queryBindings,
QueryType queryType,
QueryInfo queryInfo)
Evaluate a given SPARQL query of the provided query type at the given source.
|
boolean |
hasStatements(ExclusiveTupleExpr group,
BindingSet bindings)
Check if the repository can return results for the given
ExclusiveTupleExpr , e.g. |
boolean |
hasStatements(Resource subj,
IRI pred,
Value obj,
QueryInfo queryInfo,
Resource... contexts)
Check if the repository can return results for the given triple pattern represented by subj, pred and obj
|
protected void |
monitorRemoteRequest() |
protected <T> CloseableIteration<T,QueryEvaluationException> |
withConnection(TripleSourceBase.ConnectionOperation<T> operation)
Convenience method to perform an operation on a
RepositoryConnection . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getStatements, getStatements, getStatements, getStatements, hasStatements, usePreparedQuery, usePreparedQuery
protected final FederationContext federationContext
protected final Monitoring monitoringService
protected final Endpoint endpoint
protected final FederationEvalStrategy strategy
public TripleSourceBase(FederationContext federationContext, Endpoint endpoint)
public CloseableIteration<BindingSet,QueryEvaluationException> getStatements(String preparedQuery, BindingSet queryBindings, QueryType queryType, QueryInfo queryInfo) throws RepositoryException, MalformedQueryException, QueryEvaluationException
TripleSource
getStatements
in interface TripleSource
queryBindings
- optional query bindings, use EmptyBindingSet
if there are noneRepositoryException
MalformedQueryException
QueryEvaluationException
public CloseableIteration<BindingSet,QueryEvaluationException> getStatements(String preparedQuery, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo) throws RepositoryException, MalformedQueryException, QueryEvaluationException
TripleSource
getStatements
in interface TripleSource
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 alreadyRepositoryException
MalformedQueryException
QueryEvaluationException
public boolean hasStatements(Resource subj, IRI pred, Value obj, QueryInfo queryInfo, Resource... contexts) throws RepositoryException
TripleSource
hasStatements
in interface TripleSource
RepositoryException
public boolean hasStatements(ExclusiveTupleExpr group, BindingSet bindings) throws RepositoryException, MalformedQueryException, QueryEvaluationException
TripleSource
ExclusiveTupleExpr
, e.g. for an
ExclusiveGroup
with a list of Statements.hasStatements
in interface TripleSource
RepositoryException
MalformedQueryException
QueryEvaluationException
protected void monitorRemoteRequest()
protected void configureInference(Query query, QueryInfo queryInfo)
QueryInfo.getIncludeInferred()
query
- queryInfo
- protected void applyMaxExecutionTimeUpperBound(Operation operation)
FedXUtil.applyMaxQueryExecutionTime(Operation, FederationContext)
.operation
- the operationprotected <T> CloseableIteration<T,QueryEvaluationException> withConnection(TripleSourceBase.ConnectionOperation<T> operation)
RepositoryConnection
. This method takes care for closing
resources as well error handling. The resulting iteration has to be supplied to the TripleSourceBase.ResultHolder
.operation
- the TripleSourceBase.ConnectionOperation
Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.