Class SailTripleSource
java.lang.Object
org.eclipse.rdf4j.federated.evaluation.TripleSourceBase
org.eclipse.rdf4j.federated.evaluation.SailTripleSource
- All Implemented Interfaces:
TripleSource
A triple source to be used on any repository.
- Author:
- Andreas Schwarte
-
Nested Class Summary
Nested classes/interfaces inherited from class TripleSourceBase
TripleSourceBase.ConnectionOperation<T>, TripleSourceBase.ResultHolder<T>Modifier and TypeClassDescriptionprotected static interfaceInterface defining the operation to be perform on the connectionprotected static classHolder for a result iteration to be used withTripleSourceBase.withConnection(ConnectionOperation). -
Field Summary
Fields inherited from class TripleSourceBase
endpoint, federationContext, monitoringServiceModifier and TypeFieldDescriptionprotected final Endpointprotected final FederationContextprotected final Monitoring -
Method Summary
Modifier and TypeMethodDescriptionReturn the statements matching the given pattern as aStatementiteration.getStatements(StatementPattern stmt, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo) Evaluate the query expression on the provided endpoint.getStatements(TupleExpr preparedQuery, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo) Evaluate the prepared query in its internal representation on the provided endpoint.booleanhasStatements(StatementPattern stmt, BindingSet bindings, QueryInfo queryInfo, Dataset dataset) Check if the provided statement can return results.booleanusePreparedQuery(StatementPattern stmt, QueryInfo queryInfo) Methods inherited from class TripleSourceBase
applyMaxExecutionTimeUpperBound, configureInference, getStatements, getStatements, hasStatements, hasStatements, monitorRemoteRequest, withConnectionModifier 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. for anExclusiveGroupwith a list of Statements.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.
-
Method Details
-
getStatements
public CloseableIteration<BindingSet> getStatements(StatementPattern stmt, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo) throws RepositoryException, MalformedQueryException, QueryEvaluationException Description copied from interface:TripleSourceEvaluate the query expression on the provided endpoint.- Parameters:
stmt- the stmt expression to evaluatebindings- 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
-
getStatements
public CloseableIteration<Statement> getStatements(Resource subj, IRI pred, Value obj, QueryInfo queryInfo, Resource... contexts) throws RepositoryException, MalformedQueryException, QueryEvaluationException Description copied from interface:TripleSourceReturn the statements matching the given pattern as aStatementiteration.- Parameters:
subj-pred-obj-contexts-- Returns:
- the resulting iteration
- Throws:
RepositoryExceptionMalformedQueryExceptionQueryEvaluationException
-
hasStatements
public boolean hasStatements(StatementPattern stmt, BindingSet bindings, QueryInfo queryInfo, Dataset dataset) throws RepositoryException, MalformedQueryException, QueryEvaluationException Description copied from interface:TripleSourceCheck if the provided statement can return results.- Parameters:
stmt-bindings- a binding set. in case no bindings are present, anEmptyBindingSetcan be used (i.e. never null)queryInfo-dataset-- Returns:
- whether the source can return results
- Throws:
RepositoryExceptionMalformedQueryExceptionQueryEvaluationException
-
usePreparedQuery
- Parameters:
stmt-queryInfo-- Returns:
- true if a prepared query is to be used preferably, false otherwise
-
getStatements
public CloseableIteration<BindingSet> getStatements(TupleExpr preparedQuery, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo) throws RepositoryException, MalformedQueryException, QueryEvaluationException Description copied from interface:TripleSourceEvaluate the prepared query in its internal representation on the provided endpoint.- Parameters:
preparedQuery- a prepared query to evaluatebindings- 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
-