Class BackgroundGraphResult
java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<Statement>
org.eclipse.rdf4j.common.iteration.IterationWrapper<Statement>
org.eclipse.rdf4j.query.impl.BackgroundGraphResult
- All Implemented Interfaces:
AutoCloseable, Iterable<Statement>, Runnable, Iterator<Statement>, CloseableIteration<Statement>, GraphQueryResult, QueryResult<Statement>, RDFHandler
public class BackgroundGraphResult
extends IterationWrapper<Statement>
implements GraphQueryResult, Runnable, RDFHandler
Provides concurrent access to statements as they are being parsed when instances of this class are run as Threads.
- Author:
- James Leigh
-
Field Summary
Fields inherited from class IterationWrapper
wrappedIterModifier and TypeFieldDescriptionprotected final CloseableIteration<? extends Statement> Deprecated.This will be changed to private, possibly with an accessor in future.Fields inherited from interface CloseableIteration
EMPTY_STATEMENT_ITERATION -
Constructor Summary
ConstructorsConstructorDescriptionBackgroundGraphResult(QueueCursor<Statement> queue, RDFParser parser, InputStream in, Charset charset, String baseURI) BackgroundGraphResult(RDFParser parser, InputStream in, Charset charset, String baseURI) -
Method Summary
Modifier and TypeMethodDescriptionvoidendRDF()Signals the end of the RDF data.Retrieves relevant namespaces from the query result.protected voidCloses this Iteration and also closes the wrapped Iteration if it is aCloseableIteration.voidhandleComment(String comment) Handles a comment.voidhandleNamespace(String prefix, String uri) Handles a namespace declaration/definition.voidHandles a statement.voidrun()voidstartRDF()Signals the start of the RDF data.Methods inherited from class IterationWrapper
hasNext, next, removeModifier and TypeMethodDescriptionbooleanhasNext()Deprecated.Checks whether the wrapped Iteration contains more elements, closing this Iteration when this is not the case.next()Deprecated.Returns the next element from the wrapped Iteration.voidremove()Deprecated.Removes the last element that has been returned from the wrapped Iteration.Methods inherited from class AbstractCloseableIteration
close, isClosedModifier and TypeMethodDescriptionfinal voidclose()CallsAbstractCloseableIteration.handleClose()upon first call and makes sure the resource closures are only executed once.final booleanisClosed()Checks whether this CloseableIteration has been closed.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface Iterator
forEachRemainingMethods inherited from interface QueryResult
hasNext, iterator, next, stream
-
Constructor Details
-
BackgroundGraphResult
-
BackgroundGraphResult
public BackgroundGraphResult(QueueCursor<Statement> queue, RDFParser parser, InputStream in, Charset charset, String baseURI)
-
-
Method Details
-
handleClose
Description copied from class:IterationWrapperCloses this Iteration and also closes the wrapped Iteration if it is aCloseableIteration.- Overrides:
handleClosein classIterationWrapper<Statement>- Throws:
QueryEvaluationException
-
run
-
startRDF
Description copied from interface:RDFHandlerSignals the start of the RDF data. This method is called before any data is reported.- Specified by:
startRDFin interfaceRDFHandler- Throws:
RDFHandlerException- If the RDF handler has encountered an unrecoverable error.
-
getNamespaces
Description copied from interface:GraphQueryResultRetrieves relevant namespaces from the query result.
The contents of the Map may be modified after it is returned, as the initial return may be performed when the first RDF Statement is encountered.- Specified by:
getNamespacesin interfaceGraphQueryResult- Returns:
- a Map<String, String> object containing (prefix, namespace) pairs.
-
handleComment
Description copied from interface:RDFHandlerHandles a comment.- Specified by:
handleCommentin interfaceRDFHandler- Parameters:
comment- The comment.- Throws:
RDFHandlerException- If the RDF handler has encountered an unrecoverable error.
-
handleNamespace
Description copied from interface:RDFHandlerHandles a namespace declaration/definition. A namespace declaration associates a (short) prefix string with the namespace's URI. The prefix for default namespaces, which do not have an associated prefix, are represented as empty strings.- Specified by:
handleNamespacein interfaceRDFHandler- Parameters:
prefix- The prefix for the namespace, or an empty string in case of a default namespace.uri- The URI that the prefix maps to.- Throws:
RDFHandlerException- If the RDF handler has encountered an unrecoverable error.
-
handleStatement
Description copied from interface:RDFHandlerHandles a statement.- Specified by:
handleStatementin interfaceRDFHandler- Parameters:
st- The statement.- Throws:
RDFHandlerException- If the RDF handler has encountered an unrecoverable error.
-
endRDF
Description copied from interface:RDFHandlerSignals the end of the RDF data. This method is called when all data has been reported.- Specified by:
endRDFin interfaceRDFHandler- Throws:
RDFHandlerException- If the RDF handler has encountered an unrecoverable error.
-