Class LicenseRDFAGenerator

java.lang.Object
org.spdx.licenselistpublisher.LicenseRDFAGenerator

public class LicenseRDFAGenerator extends Object
Converts input license text and metadata into various output formats. Supported input formats: - License XML file - File following the SPDX legal team license format - Directory of XML files - Directory of files following the SPDX legal team license format Supported output formats: - Text - license text - Templates - license templates as defined by the SPDX legal team matching guidelines - Json-LD - SPDX Spec version 3 JSON-LD format - JSON - Json format as defined in https://github.com/spdx/license-list-data - RDFa - HTML with RDFa tags as defined in https://github.com/spdx/license-list-data - RDF NT - RDF NT format defined by the SPDX Spec version 2.3 - RDF XML - RDF XML format defined by the SPDX Spec version 2.3 - RDF Turtle - RDF Turtle format defined by the SPDX Spec version 2.3 - Website - the content for the website available at https://spdx.org/licenses - license-list-XML - A copy of the input license XML file(s) Output generated by this tool can be found at https://github.com/spdx/license-list-data and on the spdx.org licenses website To add a new output format, create a class supporting the ILicenseFormatWriter interface and add it to the writers list. If there is testfiles is passed in as a parameter, text from the test files will be used for the verbatim license or exception text. To override this behavior, set an environment variable USE_SYSTEM_TEST to false
Author:
Gary O'Neall
  • Constructor Details

    • LicenseRDFAGenerator

      public LicenseRDFAGenerator()
  • Method Details

    • main

      public static void main(String[] args)
      Parameters:
      args - Arg 0 is either a license XML file or a directory of licenses in XML format, arg 1 is the directory for the output html files
    • generateLicenseData

      public static List<String> generateLicenseData(File licenseXml, File dir, String version, String releaseDateUnformated, File testFileDir, boolean useTestText) throws LicenseGeneratorException
      Generate license data
      Parameters:
      licenseXml - License XML file or directory containing license XML files
      dir - Output directory for the generated results
      version - Version for the license list
      releaseDateUnformated - Release data string for the license
      testFileDir - Directory of license text to test the generated licenses against
      useTestText - use the text file from the testFileDir for the verbatim text rather than the text from the XML document
      Returns:
      warnings
      Throws:
      LicenseGeneratorException