Class RdfSerializationExample

java.lang.Object
org.wikidata.wdtk.examples.RdfSerializationExample

public class RdfSerializationExample extends Object
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 Details

    • RdfSerializationExample

      public RdfSerializationExample()
  • Method Details

    • main

      public static void main(String[] args) throws IOException
      Throws:
      IOException
    • asynchronousOutputStream

      public static OutputStream asynchronousOutputStream(OutputStream outputStream) throws IOException
      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