Interface TripleSource
-
- All Known Implementing Classes:
SailTripleSource
,SparqlTripleSource
,TripleSourceBase
public interface TripleSource
Interface for implementations of triple sources. Particular implementations define how to evaluate the expression on the endpoint. Different implementations might be necessary depending on the underlying repository.- Author:
- Andreas Schwarte
- See Also:
SparqlTripleSource
,SailTripleSource
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default CloseableIteration<BindingSet,QueryEvaluationException>
getStatements(String preparedQuery, QueryType queryType, QueryInfo queryInfo)
Deprecated, for removal: This API element is subject to removal in a future version.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.CloseableIteration<Statement,QueryEvaluationException>
getStatements(Resource subj, IRI pred, Value obj, QueryInfo queryInfo, Resource... contexts)
Return the statements matching the given pattern as aStatement
iteration.CloseableIteration<BindingSet,QueryEvaluationException>
getStatements(StatementPattern stmt, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo)
Evaluate the query expression on the provided endpoint.CloseableIteration<BindingSet,QueryEvaluationException>
getStatements(TupleExpr preparedQuery, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo)
Evaluate the prepared query in its internal representation on the provided endpoint.boolean
hasStatements(ExclusiveTupleExpr expr, BindingSet bindings)
Check if the repository can return results for the givenExclusiveTupleExpr
, 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 objboolean
hasStatements(StatementPattern stmt, BindingSet bindings, QueryInfo queryInfo, Dataset dataset)
Check if the provided statement can return results.default boolean
usePreparedQuery()
Deprecated, for removal: This API element is subject to removal in a future version.replaced withusePreparedQuery(StatementPattern, QueryInfo)
, to be removed in 4.0boolean
usePreparedQuery(StatementPattern stmt, QueryInfo queryInfo)
-
-
-
Method Detail
-
getStatements
CloseableIteration<BindingSet,QueryEvaluationException> getStatements(TupleExpr preparedQuery, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo) throws RepositoryException, MalformedQueryException, QueryEvaluationException
Evaluate 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:
RepositoryException
MalformedQueryException
QueryEvaluationException
-
getStatements
CloseableIteration<BindingSet,QueryEvaluationException> getStatements(String preparedQuery, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo) throws RepositoryException, MalformedQueryException, QueryEvaluationException
Evaluate the prepared query (SPARQL query as String) on the provided endpoint.- 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:
RepositoryException
MalformedQueryException
QueryEvaluationException
-
getStatements
@Deprecated(forRemoval=true) default CloseableIteration<BindingSet,QueryEvaluationException> getStatements(String preparedQuery, QueryType queryType, QueryInfo queryInfo) throws RepositoryException, MalformedQueryException, QueryEvaluationException
Deprecated, for removal: This API element is subject to removal in a future version.Evaluate a given SPARQL query of the provided query type at the given source.- Parameters:
preparedQuery
-queryType
-queryInfo
-- Returns:
- the statements
- Throws:
RepositoryException
MalformedQueryException
QueryEvaluationException
-
getStatements
CloseableIteration<BindingSet,QueryEvaluationException> getStatements(String preparedQuery, BindingSet queryBindings, QueryType queryType, QueryInfo queryInfo) throws RepositoryException, MalformedQueryException, QueryEvaluationException
Evaluate a given SPARQL query of the provided query type at the given source.- Parameters:
preparedQuery
-queryBindings
- optional query bindings, useEmptyBindingSet
if there are nonequeryType
-queryInfo
-- Returns:
- the statements
- Throws:
RepositoryException
MalformedQueryException
QueryEvaluationException
-
getStatements
CloseableIteration<BindingSet,QueryEvaluationException> getStatements(StatementPattern stmt, BindingSet bindings, FilterValueExpr filterExpr, QueryInfo queryInfo) throws RepositoryException, MalformedQueryException, QueryEvaluationException
Evaluate 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:
RepositoryException
MalformedQueryException
QueryEvaluationException
-
getStatements
CloseableIteration<Statement,QueryEvaluationException> getStatements(Resource subj, IRI pred, Value obj, QueryInfo queryInfo, Resource... contexts) throws RepositoryException, MalformedQueryException, QueryEvaluationException
Return the statements matching the given pattern as aStatement
iteration.- Parameters:
subj
-pred
-obj
-contexts
-- Returns:
- the resulting iteration
- Throws:
RepositoryException
MalformedQueryException
QueryEvaluationException
-
hasStatements
boolean hasStatements(StatementPattern stmt, BindingSet bindings, QueryInfo queryInfo, Dataset dataset) throws RepositoryException, MalformedQueryException, QueryEvaluationException
Check if the provided statement can return results.- Parameters:
stmt
-bindings
- a binding set. in case no bindings are present, anEmptyBindingSet
can be used (i.e. never null)queryInfo
-dataset
-- Returns:
- whether the source can return results
- Throws:
RepositoryException
MalformedQueryException
QueryEvaluationException
-
hasStatements
boolean hasStatements(Resource subj, IRI pred, Value obj, QueryInfo queryInfo, Resource... contexts) throws RepositoryException
Check if the repository can return results for the given triple pattern represented by subj, pred and obj- Parameters:
subj
-pred
-obj
-queryInfo
-contexts
-- Returns:
- whether the source can provide results
- Throws:
RepositoryException
-
hasStatements
boolean hasStatements(ExclusiveTupleExpr expr, BindingSet bindings) throws RepositoryException, MalformedQueryException, QueryEvaluationException
Check if the repository can return results for the givenExclusiveTupleExpr
, e.g. for anExclusiveGroup
with a list of Statements.- Parameters:
group
-bindings
-- Returns:
- whether the repository can return results
- Throws:
RepositoryException
MalformedQueryException
QueryEvaluationException
-
usePreparedQuery
@Deprecated(forRemoval=true) default boolean usePreparedQuery()
Deprecated, for removal: This API element is subject to removal in a future version.replaced withusePreparedQuery(StatementPattern, QueryInfo)
, to be removed in 4.0- Returns:
- true if a prepared query is to be used preferably, false otherwise
-
usePreparedQuery
boolean usePreparedQuery(StatementPattern stmt, QueryInfo queryInfo)
- Parameters:
stmt
-queryInfo
-- Returns:
- true if a prepared query is to be used preferably, false otherwise
-
-