Class CSVWWriter
java.lang.Object
org.incenp.obofoundry.sssom.SSSOMWriter
org.incenp.obofoundry.sssom.util.CSVWWriter
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:
-
Field Summary
Fields inherited from class SSSOMWriter
condensationPolicy, extensionManager, extraPolicy, prefixManager, targetVersion -
Constructor Summary
ConstructorsConstructorDescriptionCSVWWriter(File csvFile, File metaFile) Creates a new instance that will write data to the specified files.CSVWWriter(OutputStream csvStream, OutputStream metaStream) Creates a new instance that will write data to the specified streams.CSVWWriter(String csvFile, String metaFile) Creates a new instance that will write data to files with the specified filenames. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoWrite(MappingSet mappingSet) Actually serialises a mapping set.voidForces the URL of the CSV file.Methods inherited from class SSSOMWriter
condenseSet, getUsedPrefixes, getUsedPrefixes, setCondensationEnabled, setCurieMap, setExtraMetadataPolicy, setSortingEnabled, setTargetVersion, write
-
Constructor Details
-
CSVWWriter
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. Ifnull, the metadata will be written to a file with the same name as the CSV file plus a-metadata.jsonsuffix.- Throws:
IOException- If any of the files cannot be opened for any reason.
-
CSVWWriter
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. Ifnull, the metadata will be written to a file with the same name as the CSV file plus a-metadata.jsonsuffix.- Throws:
IOException- If any of the files cannot be opened for any reason.
-
CSVWWriter
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
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
Description copied from class:SSSOMWriterActually serialises a mapping set. This method should be overridden by derived classes to implement the serialisation in a specific format.- Specified by:
doWritein classSSSOMWriter- Parameters:
mappingSet- The mapping set to serialise.- Throws:
IOException- If an I/O error occurs.
-