Package org.spdx.tools
Class TagToRDF
java.lang.Object
org.spdx.tools.TagToRDF
public class TagToRDF extends Object
Translates a tag-value file to an RDF XML format Usage: TagToRDF
spdxfile.spdx rdfxmlfile.rdf where spdxfile.spdx is a valid SPDX tag-value
file and rdfxmlfile.rdf is the output SPDX RDF file.
- Author:
- Rana Rahal, Protecode Inc.
-
Constructor Summary
Constructors Constructor Description TagToRDF() -
Method Summary
Modifier and Type Method Description static voidconvertTagFileToRdf(InputStream spdxTagFile, OutputStream out, String outputFormat, List<String> warnings)Convert a Tag File to an RDF output streamstatic SpdxDocumentContainerconvertTagFileToRdf(InputStream spdxTagFile, String outputFormat, List<String> warnings)Convert an tag/value format input stream into an SPDX Documentstatic voidmain(String[] args)static List<String>onlineFunction(String[] args)
-
Constructor Details
-
TagToRDF
public TagToRDF()
-
-
Method Details
-
main
-
onlineFunction
- Parameters:
args- args[0] is the Tag Value file to be converted, args[1] is the result RDF file name- Returns:
- Warnings of the conversion, displayed to the user
- Throws:
OnlineToolException- Exception caught by JPype and displayed to the user
-
convertTagFileToRdf
public static void convertTagFileToRdf(InputStream spdxTagFile, OutputStream out, String outputFormat, List<String> warnings) throws antlr.RecognitionException, antlr.TokenStreamException, ExceptionConvert a Tag File to an RDF output stream- Parameters:
spdxTagFile- File containing a tag/value formatted SPDX fileout- Stream where the RDF/XML data is writtenoutputFormat- must be one of RDF/XML-ABBREV (default), RDF/XML, N-TRIPLET, or TURTLE- Throws:
Exceptionantlr.TokenStreamExceptionantlr.RecognitionException
-
convertTagFileToRdf
public static SpdxDocumentContainer convertTagFileToRdf(InputStream spdxTagFile, String outputFormat, List<String> warnings) throws antlr.RecognitionException, antlr.TokenStreamException, InvalidSpdxTagFileException, InvalidFileFormatException, ExceptionConvert an tag/value format input stream into an SPDX Document- Parameters:
spdxTagFile- Input stream containing a SPDX tag/value format textoutputFormat- must be one of RDF/XML-ABBREV (default), RDF/XML, N-TRIPLET, or TURTLEwarnings- List of any warnings generated during the tag/value parsing- Returns:
- SpdxDocumentContainer containing the SPDX document represented by the spdxTagVile
- Throws:
Exceptionantlr.RecognitionExceptionantlr.TokenStreamExceptionInvalidSpdxTagFileExceptionInvalidFileFormatException
-