Class TurtleTriGWriter
java.lang.Object
tech.oxfordsemantic.jrdfox.formats.TurtleTriGWriter
public class TurtleTriGWriter
extends java.lang.Object
A class for writing RDF triples and quads in the Turtle and TriG formats.
-
Constructor Summary
Constructors Constructor Description TurtleTriGWriter(Prefixes prefixes, java.io.OutputStream outputStream)
Creates a new TurtleTriGWriter object that writes to the specified output stream. -
Method Summary
Modifier and Type Method Description void
close()
Flushes, then closes the output stream.void
flush()
Flushes the output stream.void
writeQuad(Resource subject, Resource predicate, Resource object, Resource graph)
Writes an RDF quad to the output stream.void
writeTriple(Resource subject, Resource predicate, Resource object)
Writes an RDF triple to the output stream.
-
Constructor Details
-
TurtleTriGWriter
Creates a new TurtleTriGWriter object that writes to the specified output stream.- Parameters:
prefixes
- the prefixes to be used for writing the RDF dataoutputStream
- the output stream to which the RDF data will be written (using UTF8 encoding)
-
-
Method Details
-
writeTriple
Writes an RDF triple to the output stream.- Parameters:
subject
- the subject of the triplepredicate
- the predicate of the tripleobject
- the object of the triple
-
writeQuad
Writes an RDF quad to the output stream.- Parameters:
subject
- the subject of the quadpredicate
- the predicate of the quadobject
- the object of the quadgraph
- the graph of the quad
-
flush
public void flush() throws java.io.IOExceptionFlushes the output stream.- Throws:
java.io.IOException
- if an error occurs while writing to the output stream
-
close
public void close() throws java.io.IOExceptionFlushes, then closes the output stream.- Throws:
java.io.IOException
- if an error occurs
-