Class TurtleStarWriter
java.lang.Object
org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter
org.eclipse.rdf4j.rio.turtle.TurtleWriter
org.eclipse.rdf4j.rio.turtlestar.TurtleStarWriter
- All Implemented Interfaces:
CharSink, Sink, RDFHandler, RDFWriter
An extension of
TurtleWriter that writes RDF-star documents in the Turtle-star format by including the
RDF-star triples.- Author:
- Pavel Mihaylov
-
Field Summary
Fields inherited from class TurtleWriter
baseIRI, bufferedStatements, lastWrittenPredicate, lastWrittenSubject, statementClosed, writerModifier and TypeFieldDescriptionprotected ParsedIRIprotected Modelprotected IRIprotected Resourceprotected booleanFlag indicating whether the last written statement has been closed.protected IndentingWriterFields inherited from class AbstractRDFWriter
namespaceTable, statementConsumerModifier and TypeFieldDescriptionMapping from namespace prefixes to namespace names. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new TurtleStarWriter that will write to the supplied OutputStream.TurtleStarWriter(OutputStream out, ParsedIRI baseIRI) Creates a new TurtleStarWriter that will write to the supplied OutputStream using the supplied base IRI.TurtleStarWriter(Writer writer) Creates a new TurtleStarWriter that will write to the supplied Writer.TurtleStarWriter(Writer writer, ParsedIRI baseIRI) Creates a new TurtleStarWriter that will write to the supplied Writer using the supplied base IRI. -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptsFileFormat(FileFormat format) Check if this Sink accepts the suppliedFileFormat.Gets the RDF format that this RDFWriter uses.protected voidwriteTriple(Triple triple, boolean canShorten) Methods inherited from class TurtleWriter
closePreviousStatement, consumeStatement, endRDF, getModelFactory, getSupportedSettings, getWriter, handleComment, handleNamespace, handleStatementInternal, setModelFactory, startRDF, writeBase, writeBNode, writeBNode, writeCommentLine, writeLiteral, writeNamespace, writePredicate, writeResource, writeResource, writeStatement, writeTripleRDFStar, writeURI, writeValue, writeValueModifier and TypeMethodDescriptionprotected voidprotected voidConsume a statement.voidendRDF()Signals the end of the RDF data.protected ModelFactoryCollection<RioSetting<?>> voidhandleComment(String comment) Handles a comment.voidhandleNamespace(String prefix, String name) Handles a namespace declaration/definition.protected voidhandleStatementInternal(Statement st, boolean endRDFCalled, boolean canShortenSubjectBNode, boolean canShortenObjectBNode) Internal method that differentiates between the pretty-print and streaming writer cases.voidsetModelFactory(ModelFactory modelFactory) Set aModelFactoryto use for creating internal Models for statement processing/buffering purposes.voidstartRDF()Signals the start of the RDF data.protected voidprotected voidwriteBNode(BNode bNode) Deprecated.protected voidwriteBNode(BNode bNode, boolean canShorten) protected voidwriteCommentLine(String line) protected voidwriteLiteral(Literal lit) protected voidwriteNamespace(String prefix, String name) protected voidwritePredicate(IRI predicate) protected voidwriteResource(Resource res) Deprecated.UseTurtleWriter.writeResource(Resource, boolean)instead.protected voidwriteResource(Resource res, boolean canShorten) protected voidwriteStatement(Resource subj, IRI pred, Value obj, Resource context, boolean canShortenSubjectBNode, boolean canShortenObjectBNode) protected voidwriteTripleRDFStar(Triple triple, boolean canShorten) protected voidprotected voidwriteValue(Value val) Deprecated.UseTurtleWriter.writeValue(Value, boolean)instead.protected voidwriteValue(Value val, boolean canShorten) Methods inherited from class AbstractRDFWriter
checkWritingStarted, getFileFormat, getWriterConfig, handleStatement, isWritingStarted, set, setWriterConfigModifier and TypeMethodDescriptionprotected voidVerify that writing has started.Get theFileFormatthis sink uses.Retrieves the current writer configuration as a single object.voidHandles a statement.protected booleanSee if writing has started<T> RDFWriterset(RioSetting<T> setting, T value) Set a setting on the writer, and return this writer object to allow chaining.setWriterConfig(WriterConfig config) Sets all supplied writer configuration options.
-
Constructor Details
-
TurtleStarWriter
Creates a new TurtleStarWriter that will write to the supplied OutputStream.- Parameters:
out- The OutputStream to write the TurtleStar document to.
-
TurtleStarWriter
Creates a new TurtleStarWriter that will write to the supplied OutputStream using the supplied base IRI.- Parameters:
out- The OutputStream to write the TurtleStar document to.baseIRI- The base IRI to use.
-
TurtleStarWriter
Creates a new TurtleStarWriter that will write to the supplied Writer.- Parameters:
writer- The Writer to write the TurtleStar document to.
-
TurtleStarWriter
-
-
Method Details
-
getRDFFormat
Description copied from interface:RDFWriterGets the RDF format that this RDFWriter uses.- Specified by:
getRDFFormatin interfaceRDFWriter- Overrides:
getRDFFormatin classTurtleWriter
-
acceptsFileFormat
Description copied from interface:SinkCheck if this Sink accepts the suppliedFileFormat.- Parameters:
format- theFileFormatto check.- Returns:
trueif the sink accepts the supplied format,falseotherwise.
-
writeTriple
- Overrides:
writeTriplein classTurtleWriter- Throws:
IOException
-
TurtleWriter.writeBNode(BNode, boolean)instead.