Class LicenseRdfFormatWriter
java.lang.Object
org.spdx.licenselistpublisher.licensegenerator.LicenseRdfFormatWriter
- All Implemented Interfaces:
ILicenseFormatWriter
public class LicenseRdfFormatWriter extends Object implements ILicenseFormatWriter
Write RDF formats for the licenses
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors Constructor Description LicenseRdfFormatWriter(File rdfXml, File rdfTurtle, File rdfNt, File rdfJsonLd) -
Method Summary
Modifier and Type Method Description FilegetRdfNt()FilegetRdfTurtle()FilegetRdfXml()voidsetRdfNt(File rdfNt)voidsetRdfTurtle(File rdfTurtle)voidsetRdfXml(File rdfXml)voidwriteException(org.spdx.library.model.license.ListedLicenseException exception)voidwriteLicense(org.spdx.library.model.license.SpdxListedLicense license, boolean deprecated, String deprecatedVersion)Formats and writes a specific licensestatic voidwriteRdf(org.spdx.spdxRdfStore.RdfStore rdfStore, String documentUri, String fileName, org.spdx.spdxRdfStore.OutputFormat format)Write an RDF file for for all elements in the containervoidwriteToC()Write the Table of Contents file for the format if applicable
-
Constructor Details
-
LicenseRdfFormatWriter
- Parameters:
rdfXml- File to store RDF XML formatted license listrdfTurtle- File to store RDF Turtle formatted license listrdfNt- File to store RDF Nt formatted license listrdfJsonLd- File to store JSON-LD formatted license list
-
-
Method Details
-
getRdfXml
- Returns:
- the rdfXml
-
setRdfXml
- Parameters:
rdfXml- the rdfXml to set
-
getRdfTurtle
- Returns:
- the rdfTurtle
-
setRdfTurtle
- Parameters:
rdfTurtle- the rdfTurtle to set
-
getRdfNt
- Returns:
- the rdfNt
-
setRdfNt
- Parameters:
rdfNt- the rdfNt to set
-
writeLicense
public void writeLicense(org.spdx.library.model.license.SpdxListedLicense license, boolean deprecated, String deprecatedVersion) throws IOException, LicenseGeneratorException, org.spdx.library.InvalidSPDXAnalysisExceptionDescription copied from interface:ILicenseFormatWriterFormats and writes a specific license- Specified by:
writeLicensein interfaceILicenseFormatWriter- Parameters:
license- License to be addeddeprecated- True if deprecateddeprecatedVersion- License list version when the license was deprecated, null otherwise- Throws:
IOExceptionLicenseGeneratorExceptionorg.spdx.library.InvalidSPDXAnalysisException
-
writeRdf
public static void writeRdf(org.spdx.spdxRdfStore.RdfStore rdfStore, String documentUri, String fileName, org.spdx.spdxRdfStore.OutputFormat format) throws LicenseGeneratorExceptionWrite an RDF file for for all elements in the container- Parameters:
rdfStore- Store for the RDF elementsdocumentUri- Document URI containing the elements to be writtenfileName- File name to write the elements toformat- Jena RDF format- Throws:
LicenseGeneratorException
-
writeToC
Description copied from interface:ILicenseFormatWriterWrite the Table of Contents file for the format if applicable- Specified by:
writeToCin interfaceILicenseFormatWriter- Throws:
IOExceptionLicenseGeneratorException
-
writeException
public void writeException(org.spdx.library.model.license.ListedLicenseException exception) throws IOException, LicenseGeneratorException, org.spdx.library.InvalidSPDXAnalysisException- Specified by:
writeExceptionin interfaceILicenseFormatWriter- Parameters:
exception- Exception to be formatted and written- Throws:
IOExceptionLicenseGeneratorExceptionorg.spdx.library.InvalidSPDXAnalysisException
-