Class TriGStarWriter
java.lang.Object
org.eclipse.rdf4j.rio.helpers.AbstractRDFWriter
org.eclipse.rdf4j.rio.turtle.TurtleWriter
org.eclipse.rdf4j.rio.trig.TriGWriter
org.eclipse.rdf4j.rio.trigstar.TriGStarWriter
- All Implemented Interfaces:
CharSink, Sink, RDFHandler, RDFWriter
An extension of
TriGWriter that writes RDF-star documents in the TriG-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 TriGStarWriter that will write to the supplied OutputStream.TriGStarWriter(OutputStream out, ParsedIRI baseIRI) Creates a new TriGStarWriter that will write to the supplied OutputStream using the supplied base IRI.TriGStarWriter(Writer writer) Creates a new TriGStarWriter that will write to the supplied Writer.TriGStarWriter(Writer writer, ParsedIRI baseIRI) Creates a new TriGStarWriter 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 TriGWriter
closeActiveContext, endRDF, startRDF, writeNamespace, writeStatementModifier and TypeMethodDescriptionprotected voidvoidendRDF()Signals the end of the RDF data.voidstartRDF()Signals the start of the RDF data.protected voidwriteNamespace(String prefix, String name) protected voidwriteStatement(Resource subj, IRI pred, Value obj, Resource context, boolean canShortenSubject, boolean canShortenObject) Methods inherited from class TurtleWriter
closePreviousStatement, consumeStatement, getModelFactory, getSupportedSettings, getWriter, handleComment, handleNamespace, handleStatementInternal, setModelFactory, writeBase, writeBNode, writeBNode, writeCommentLine, writeLiteral, writePredicate, writeResource, writeResource, writeTripleRDFStar, writeURI, writeValue, writeValueModifier and TypeMethodDescriptionprotected voidprotected voidConsume a statement.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.protected voidprotected voidwriteBNode(BNode bNode) Deprecated.protected voidwriteBNode(BNode bNode, boolean canShorten) protected voidwriteCommentLine(String line) protected voidwriteLiteral(Literal lit) protected voidwritePredicate(IRI predicate) protected voidwriteResource(Resource res) Deprecated.UseTurtleWriter.writeResource(Resource, boolean)instead.protected voidwriteResource(Resource res, boolean canShorten) 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
-
TriGStarWriter
Creates a new TriGStarWriter that will write to the supplied OutputStream.- Parameters:
out- The OutputStream to write the TriG-star document to.
-
TriGStarWriter
Creates a new TriGStarWriter that will write to the supplied OutputStream using the supplied base IRI.- Parameters:
out- The OutputStream to write the TriG-star document to.baseIRI- The base IRI to use.
-
TriGStarWriter
Creates a new TriGStarWriter that will write to the supplied Writer.- Parameters:
writer- The Writer to write the TriG-star document to.
-
TriGStarWriter
-
-
Method Details
-
getRDFFormat
Description copied from interface:RDFWriterGets the RDF format that this RDFWriter uses.- Specified by:
getRDFFormatin interfaceRDFWriter- Overrides:
getRDFFormatin classTriGWriter
-
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.