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 Details

  • Method Details

    • main

      public static void main​(String[] args)
    • onlineFunction

      public static List<String> onlineFunction​(String[] args) throws OnlineToolException
      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, Exception
      Convert a Tag File to an RDF output stream
      Parameters:
      spdxTagFile - File containing a tag/value formatted SPDX file
      out - Stream where the RDF/XML data is written
      outputFormat - must be one of RDF/XML-ABBREV (default), RDF/XML, N-TRIPLET, or TURTLE
      Throws:
      Exception
      antlr.TokenStreamException
      antlr.RecognitionException
    • convertTagFileToRdf

      public static SpdxDocumentContainer convertTagFileToRdf​(InputStream spdxTagFile, String outputFormat, List<String> warnings) throws antlr.RecognitionException, antlr.TokenStreamException, InvalidSpdxTagFileException, InvalidFileFormatException, Exception
      Convert an tag/value format input stream into an SPDX Document
      Parameters:
      spdxTagFile - Input stream containing a SPDX tag/value format text
      outputFormat - must be one of RDF/XML-ABBREV (default), RDF/XML, N-TRIPLET, or TURTLE
      warnings - List of any warnings generated during the tag/value parsing
      Returns:
      SpdxDocumentContainer containing the SPDX document represented by the spdxTagVile
      Throws:
      Exception
      antlr.RecognitionException
      antlr.TokenStreamException
      InvalidSpdxTagFileException
      InvalidFileFormatException