Package org.eclipse.rdf4j.sail.base
Interface SailDataset
-
- All Superinterfaces:
AutoCloseable,SailClosable
public interface SailDataset extends SailClosable
A state of anSailSourceat a point in time that will remain consistent untilclose()is called. The life cycle follows that of a read operation.- Author:
- James Leigh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()Called when thisSailDatasetis no longer is used, such as when a read operation is complete.default Comparator<org.eclipse.rdf4j.model.Value>getComparator()org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Resource>getContextIDs()Returns the set of all unique context identifiers that are used to store statements.StringgetNamespace(String prefix)Gets the namespace that is associated with the specified prefix, if any.org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Namespace>getNamespaces()Gets the namespaces relevant to the data contained in this object.default org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Statement>getStatements(org.eclipse.rdf4j.common.order.StatementOrder statementOrder, org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource... contexts)Gets all statements that have a specific subject, predicate and/or object.org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Statement>getStatements(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource... contexts)Gets all statements that have a specific subject, predicate and/or object.default Set<org.eclipse.rdf4j.common.order.StatementOrder>getSupportedOrders(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource... contexts)default org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Triple>getTriples(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj)Gets all RDF-star triples that have a specific subject, predicate and/or object.
-
-
-
Method Detail
-
close
void close() throws SailExceptionCalled when thisSailDatasetis no longer is used, such as when a read operation is complete. An isolation level compatible withIsolationLevels.SNAPSHOTwill ensure the state of thisSailDatasetdose not change between the first call to this object untilSailClosable#release()is called.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSailClosable- Throws:
SailException- if this resource cannot be closed
-
getNamespaces
org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Namespace> getNamespaces() throws SailExceptionGets the namespaces relevant to the data contained in this object.- Returns:
- An iterator over the relevant namespaces, should not contain any duplicates.
- Throws:
SailException- If this object encountered an error or unexpected situation internally.
-
getNamespace
String getNamespace(String prefix) throws SailException
Gets the namespace that is associated with the specified prefix, if any.- Parameters:
prefix- A namespace prefix, or an empty string in case of the default namespace.- Returns:
- The namespace name that is associated with the specified prefix, or null if there is no such namespace.
- Throws:
SailException- If this object encountered an error or unexpected situation internally.NullPointerException- In case prefix is null.
-
getContextIDs
org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Resource> getContextIDs() throws SailExceptionReturns the set of all unique context identifiers that are used to store statements.- Returns:
- An iterator over the context identifiers, should not contain any duplicates.
- Throws:
SailException
-
getStatements
org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Statement> getStatements(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource... contexts) throws SailExceptionGets 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.- 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 all contexts.- Returns:
- An iterator over the relevant statements.
- Throws:
SailException- If the triple source failed to get the statements.
-
getStatements
@Experimental default org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Statement> getStatements(org.eclipse.rdf4j.common.order.StatementOrder statementOrder, org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource... contexts) throws SailExceptionGets 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.- Parameters:
statementOrder- The order that the statements should be returned in.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 all contexts.- Returns:
- An iterator over the relevant statements.
- Throws:
SailException- If the triple source failed to get the statements.
-
getTriples
default org.eclipse.rdf4j.common.iteration.CloseableIteration<? extends org.eclipse.rdf4j.model.Triple> getTriples(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj) throws SailExceptionGets all RDF-star triples that have a specific subject, predicate and/or object. All three parameters may be null to indicate wildcards.- 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.- Returns:
- An iterator over the relevant triples.
- Throws:
SailException- If the triple source failed to get the RDF-star triples.
-
getSupportedOrders
@Experimental default Set<org.eclipse.rdf4j.common.order.StatementOrder> getSupportedOrders(org.eclipse.rdf4j.model.Resource subj, org.eclipse.rdf4j.model.IRI pred, org.eclipse.rdf4j.model.Value obj, org.eclipse.rdf4j.model.Resource... contexts)
-
getComparator
@Experimental default Comparator<org.eclipse.rdf4j.model.Value> getComparator()
-
-