Class BinarySelectQueryResultWriter
- java.lang.Object
-
- com.stardog.stark.query.io.binary.BinarySelectQueryResultWriter
-
- All Implemented Interfaces:
BinaryQueryResultConstants
,QueryResultWriter<BindingSet>
,SelectQueryResultWriter
,QueryResultHandler<BindingSet>
,SelectQueryResultHandler
public final class BinarySelectQueryResultWriter extends java.lang.Object implements SelectQueryResultWriter, BinaryQueryResultConstants
Writer
forSelectQueryResult
in a binary format- Since:
- 1.0
- Version:
- 1.0
- Author:
- Michael Grove
- See Also:
QueryResultFormats.BINARY
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BinarySelectQueryResultWriter.BinarySelectQueryResultWriterFactory
-
Field Summary
Fields Modifier and Type Field Description protected boolean
tupleVariablesFound
-
Fields inherited from interface com.stardog.stark.query.io.binary.BinaryQueryResultConstants
BNODE_RECORD_MARKER, DATATYPE_LITERAL_RECORD_MARKER, DEFAULT_GRAPH_RECORD_MARKER, EMPTY_ROW_RECORD_MARKER, ERROR_RECORD_MARKER, FORMAT_VERSION, LANG_LITERAL_RECORD_MARKER, MAGIC_NUMBER, MALFORMED_QUERY_ERROR, NAMED_GRAPH_RECORD_MARKER, NAMESPACE_RECORD_MARKER, NULL_RECORD_MARKER, PLAIN_LITERAL_RECORD_MARKER, QNAME_RECORD_MARKER, QUERY_EVALUATION_ERROR, REPEAT_RECORD_MARKER, STATEMENT_RECORD_MARKER, TABLE_END_RECORD_MARKER, URI_RECORD_MARKER
-
-
Constructor Summary
Constructors Constructor Description BinarySelectQueryResultWriter(java.io.OutputStream theWriter, Options theOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
end()
Signal that query processing has completedQueryResultFormat
format()
Theformat
this writer will serialize output invoid
handle(BindingSet theBindings)
Handle a result to a queryvoid
links(java.util.List<java.lang.String> theLinks)
Handle the set of links from the resultvoid
namespace(java.lang.String thePrefix, java.lang.String theIRI)
void
start()
Indicates that writing has begun.void
variables(java.util.List<java.lang.String> theVars)
The variables in the projection of the query
-
-
-
Constructor Detail
-
BinarySelectQueryResultWriter
public BinarySelectQueryResultWriter(java.io.OutputStream theWriter, Options theOptions)
-
-
Method Detail
-
start
public void start() throws ResultWritingFailed
Indicates that writing has begun.- Specified by:
start
in interfaceQueryResultHandler<BindingSet>
- Specified by:
start
in interfaceQueryResultWriter<BindingSet>
- Throws:
ResultWritingFailed
- if writing failed.
-
namespace
public void namespace(@Nonnull java.lang.String thePrefix, @Nonnull java.lang.String theIRI) throws ResultWritingFailed
- Specified by:
namespace
in interfaceQueryResultWriter<BindingSet>
- Throws:
ResultWritingFailed
-
variables
public void variables(@Nonnull java.util.List<java.lang.String> theVars)
The variables in the projection of the query- Specified by:
variables
in interfaceSelectQueryResultHandler
- Parameters:
theVars
- the variables- See Also:
SelectQueryResult.variables()
-
handle
public void handle(@Nonnull BindingSet theBindings) throws ResultWritingFailed
Handle a result to a query- Specified by:
handle
in interfaceQueryResultHandler<BindingSet>
- Specified by:
handle
in interfaceQueryResultWriter<BindingSet>
- Parameters:
theBindings
- the result- Throws:
ResultWritingFailed
-
end
public void end() throws ResultWritingFailed
Signal that query processing has completed- Specified by:
end
in interfaceQueryResultHandler<BindingSet>
- Specified by:
end
in interfaceQueryResultWriter<BindingSet>
- Throws:
ResultWritingFailed
-
links
public void links(@Nonnull java.util.List<java.lang.String> theLinks) throws ResultWritingFailed
Handle the set of links from the result- Specified by:
links
in interfaceQueryResultHandler<BindingSet>
- Specified by:
links
in interfaceQueryResultWriter<BindingSet>
- Parameters:
theLinks
- The links- Throws:
ResultWritingFailed
- See Also:
- "link"
-
format
@Nonnull public QueryResultFormat format()
Theformat
this writer will serialize output in- Specified by:
format
in interfaceQueryResultWriter<BindingSet>
- Returns:
- the format
-
-