Package org.wikidata.wdtk.examples
Class RdfSerializationExample
java.lang.Object
org.wikidata.wdtk.examples.RdfSerializationExample
This class shows how convert data from wikidata.org to RDF in N-Triples format. The
compressed output will be written into an output file.
- Author:
- Michael Günther, Markus Kroetzsch
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic OutputStream
asynchronousOutputStream
(OutputStream outputStream) Creates a separate thread for writing into the given output stream and returns a pipe output stream that can be used to pass data to this thread.static void
-
Constructor Details
-
RdfSerializationExample
public RdfSerializationExample()
-
-
Method Details
-
main
- Throws:
IOException
-
asynchronousOutputStream
Creates a separate thread for writing into the given output stream and returns a pipe output stream that can be used to pass data to this thread.This code is inspired by http://stackoverflow.com/questions/12532073/gzipoutputstream -that-does-its-compression-in-a-separate-thread
- Parameters:
outputStream
- the stream to write to in the thread- Returns:
- a new stream that data should be written to
- Throws:
IOException
- if the pipes could not be created for some reason
-