Package org.eclipse.rdf4j.sail.base
Class SailDatasetTripleSource
java.lang.Object
org.eclipse.rdf4j.sail.base.SailDatasetTripleSource
- All Implemented Interfaces:
AvailableStatementOrder
,RDFStarTripleSource
,TripleSource
Implementation of the TripleSource interface using
SailDataset
-
Field Summary
Fields inherited from interface org.eclipse.rdf4j.query.algebra.evaluation.TripleSource
EMPTY_ITERATION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDifferent underlying datastructures may have different ways of ordering statements.CloseableIteration
<? extends Triple> getRdfStarTriples
(Resource subj, IRI pred, Value obj) Gets all Triple nodes that have a specific subject, predicate and/or object.CloseableIteration
<? extends Statement> getStatements
(StatementOrder order, Resource subj, IRI pred, Value obj, Resource... contexts) Gets all statements that have a specific subject, predicate and/or object.CloseableIteration
<? extends Statement> getStatements
(Resource subj, IRI pred, Value obj, Resource... contexts) Gets all statements that have a specific subject, predicate and/or object.getSupportedOrders
(Resource subj, IRI pred, Value obj, Resource... contexts) The underlying store may support some, but not all, statement orders based on the statement pattern.Gets a ValueFactory object that can be used to create IRI-, blank node- and literal objects.toString()
-
Constructor Details
-
SailDatasetTripleSource
-
-
Method Details
-
toString
-
getStatements
public CloseableIteration<? extends Statement> getStatements(Resource subj, IRI pred, Value obj, Resource... contexts) throws QueryEvaluationException Description copied from interface:TripleSource
Gets all statements that have a specific subject, predicate and/or object. All three parameters may be null to indicate wildcards. Optionally a (set of) context(s) may be specified in which case the result will be restricted to statements matching one or more of the specified contexts.- Specified by:
getStatements
in interfaceTripleSource
- Parameters:
subj
- A Resource specifying the subject, or null for a wildcard.pred
- A IRI specifying the predicate, or null for a wildcard.obj
- A Value specifying the object, or null for a wildcard.contexts
- The context(s) to get the statements from. Note that this parameter is a vararg and as such is optional. If no contexts are supplied the method operates on the entire repository.- Returns:
- An iterator over the relevant statements.
- Throws:
QueryEvaluationException
- If the triple source failed to get the statements.
-
getStatements
public CloseableIteration<? extends Statement> getStatements(StatementOrder order, Resource subj, IRI pred, Value obj, Resource... contexts) throws QueryEvaluationException Description copied from interface:TripleSource
Gets all statements that have a specific subject, predicate and/or object. All three parameters may be null to indicate wildcards. Optionally a (set of) context(s) may be specified in which case the result will be restricted to statements matching one or more of the specified contexts.Statements are returned in the order specified by the statementOrder parameter. Use
TripleSource.getSupportedOrders(Resource, IRI, Value, Resource...)
to first retrieve the statement orders supported by this store for this statement pattern.Note that this method is experimental and may be changed or removed without notice.
- Specified by:
getStatements
in interfaceTripleSource
- Parameters:
order
- The order in which the statements should be returned.subj
- A Resource specifying the subject, or null for a wildcard.pred
- A IRI specifying the predicate, or null for a wildcard.obj
- A Value specifying the object, or null for a wildcard.contexts
- The context(s) to get the statements from. Note that this parameter is a vararg and as such is optional. If no contexts are supplied the method operates on the entire repository.- Returns:
- An ordered iterator over the relevant statements.
- Throws:
QueryEvaluationException
- If the triple source failed to get the statements.
-
getSupportedOrders
public Set<StatementOrder> getSupportedOrders(Resource subj, IRI pred, Value obj, Resource... contexts) Description copied from interface:TripleSource
The underlying store may support some, but not all, statement orders based on the statement pattern. This method can be used to determine which orders are supported for a given statement pattern. The supported orders can be used to retrieve statements in a specific order usingTripleSource.getStatements(StatementOrder, Resource, IRI, Value, Resource...)
.Note that this method is experimental and may be changed or removed without notice.
- Specified by:
getSupportedOrders
in interfaceAvailableStatementOrder
- Specified by:
getSupportedOrders
in interfaceTripleSource
- Parameters:
subj
- A Resource specifying the subject, or null for a wildcard.pred
- A IRI specifying the predicate, or null for a wildcard.obj
- A Value specifying the object, or null for a wildcard.contexts
- The context(s) to get the data from. Note that this parameter is a vararg and as such is optional. If no contexts are specified the method operates on the entire repository. A null value can be used to match context-less statements.- Returns:
- a set of supported statement orders
-
getComparator
Description copied from interface:TripleSource
Different underlying datastructures may have different ways of ordering statements. On-disk stores typically use a long to represent a value and only stores the actual value in a dictionary, in this case the order would be the order that values where inserted into the dictionary. Stores that instead store values in SPARQL-order can return an instance ofValueComparator
which may allow for further optimizations.Note that this method is experimental and may be changed or removed without notice.
- Specified by:
getComparator
in interfaceTripleSource
- Returns:
- a comparator that matches the order of values in the store
-
getValueFactory
Description copied from interface:TripleSource
Gets a ValueFactory object that can be used to create IRI-, blank node- and literal objects.- Specified by:
getValueFactory
in interfaceTripleSource
- Returns:
- a ValueFactory object for this TripleSource.
-
getRdfStarTriples
public CloseableIteration<? extends Triple> getRdfStarTriples(Resource subj, IRI pred, Value obj) throws QueryEvaluationException Description copied from interface:RDFStarTripleSource
Gets all Triple nodes that have a specific subject, predicate and/or object. All three parameters may be null to indicate wildcards.- Specified by:
getRdfStarTriples
in interfaceRDFStarTripleSource
- Parameters:
subj
- A Resource specifying the triple's subject, or null for a wildcard.pred
- A IRI specifying the triple's predicate, or null for a wildcard.obj
- A Value specifying the triple's object, or null for a wildcard.- Returns:
- An iterator over the relevant triples.
- Throws:
QueryEvaluationException
- If the rdf star triple source failed to get the statements.
-