Class CSVWWriter

java.lang.Object
org.incenp.obofoundry.sssom.SSSOMWriter
org.incenp.obofoundry.sssom.util.CSVWWriter

public class CSVWWriter extends SSSOMWriter
A writer to serialise a SSSOM mapping set into the “CSV on the Web” (CSVW) format.

This should be considered experimental for the time being, and continued support for this format is uncertain.

See Also:
  • Constructor Details

    • CSVWWriter

      public CSVWWriter(File csvFile, File metaFile) throws IOException
      Creates a new instance that will write data to the specified files.
      Parameters:
      csvFile - The file to write the CSV data to.
      metaFile - The file to write the CSV metadata to. If null, the metadata will be written to a file with the same name as the CSV file plus a -metadata.json suffix.
      Throws:
      IOException - If any of the files cannot be opened for any reason.
    • CSVWWriter

      public CSVWWriter(String csvFile, String metaFile) throws IOException
      Creates a new instance that will write data to files with the specified filenames.
      Parameters:
      csvFile - The name of the file to write the CSV data to.
      metaFile - The name of the file to write the CSV metadata to. If null, the metadata will be written to a file with the same name as the CSV file plus a -metadata.json suffix.
      Throws:
      IOException - If any of the files cannot be opened for any reason.
    • CSVWWriter

      public CSVWWriter(OutputStream csvStream, OutputStream metaStream)
      Creates a new instance that will write data to the specified streams.
      Parameters:
      csvStream - The stream to write the CSV data to.
      metaStream - The stream to write the CSV metadata to.
  • Method Details

    • setCSVUrl

      public void setCSVUrl(String url)
      Forces the URL of the CSV file.

      This is the URL written in the metadata file. This should point to wherever the CSV file is located. By default, this is simply the name of the CSV file, if known.

      Parameters:
      url - The URL pointing to the CSV file.
    • doWrite

      protected void doWrite(MappingSet mappingSet) throws IOException
      Description copied from class: SSSOMWriter
      Actually serialises a mapping set. This method should be overridden by derived classes to implement the serialisation in a specific format.
      Specified by:
      doWrite in class SSSOMWriter
      Parameters:
      mappingSet - The mapping set to serialise.
      Throws:
      IOException - If an I/O error occurs.