Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate SPDXv3 RDF license definitions #183

Open
zvr opened this issue Jun 20, 2024 · 3 comments
Open

Generate SPDXv3 RDF license definitions #183

zvr opened this issue Jun 20, 2024 · 3 comments

Comments

@zvr
Copy link
Member

zvr commented Jun 20, 2024

Now that we're working with validated RDF data, we need to have all the licenses as valid RDF elements.

For example, if we have a declaration of a concluded license like:

{
  "spdxId": "https://example.org/rel-1",
  "type": "Relationship",
  "relationshipType": "hasConcludedLicense",
  "from": "https://example.org/my-artifact",
  "to": ["https://spdx.org/licenses/MIT"],
  "creationInfo": "_:creationinfo"
}

Validation of this data will fail, since https://spdx.org/licenses/MIT is not known to be a ListedLicense (in SPDXv3 RDF ontology).
An example of the exact validation error is shown in spdx/spdx-examples#80 (comment)

The solution is that the License List Publisher should generate RDF data for each of the listed licenses and exceptions. Similar to what is currently being generated for SPDXv2 RDF in https://github.com/spdx/license-list-data/tree/main/jsonld.

I don't know how releases are handled in the https://github.com/spdx/license-list-data/ repo; I only see a package of "all source files". Should all RDF data be collected and published in something like spdx.org/rdf/license-list-3.24.0.jsonld ? Because depending on the licenseListVersion property value, different set of licenses should be available.
Anyway, this is a subsequent topic, about deployment. I open this ticket only for the creation of the SPDXv3 data.

@goneall
Copy link
Member

goneall commented Oct 30, 2024

Proposal is to:

  • Add another subdirectory to the license-list-data repo "v3jsonld"
  • Add one file for each listed license in the subdirectory with a file name [licenseId].json and the contents being a valid SPDX V3 serialization of a single SPDX element
  • Add one file for each listed license exception in the subdirectory with a file name [exceptionId].json and the contents being a valid SPDX V3 serialization of a single SPDX element
  • Add a file named "spdx-listed-licenses-exceptions.json" which contains a single SPDX collection with external references to all of the license and exception files
  • Add a subdirectory in the published website named "v3jsonld" with the same content as the license-list-data repo "v3jsonld" subdirectory

@swinslow @zvr - let me know if you agree with the above proposal or have any suggested improvements.

@zvr
Copy link
Member Author

zvr commented Oct 30, 2024

@goneall starting from the top of your bullet list:

  • why a single directory v3jsonld ? I assume that the information will be available in the various formats that we publish our ontology in (e.g. JSON-LD, TTL, etc.). It would make more sense to have a top-level directory SPDXv3 and then subdirectories per format, similar to the current setup. They are all RDF, after all.
  • In each directory, a file per license and exception in the serialization format, as per your bullets 2 and 3
  • Yes to have a (SPDXv3) Collection of all the listed licenses and exceptions. Please, the filename to include exceptions (plural)
  • Similar to the above, in the website maybe the whole SPDXv3 should appear, with multi[le serialization formats

@goneall
Copy link
Member

goneall commented Nov 12, 2024

@goneall starting from the top of your bullet list:

  • why a single directory v3jsonld ? I assume that the information will be available in the various formats that we publish our ontology in (e.g. JSON-LD, TTL, etc.). It would make more sense to have a top-level directory SPDXv3 and then subdirectories per format, similar to the current setup. They are all RDF, after all.

Agree

  • In each directory, a file per license and exception in the serialization format, as per your bullets 2 and 3
  • Yes to have a (SPDXv3) Collection of all the listed licenses and exceptions. Please, the filename to include exceptions (plural)

Good catch - updated

  • Similar to the above, in the website maybe the whole SPDXv3 should appear, with multi[le serialization formats

So - the website structure would be:

spdx.org/licenses
    SPDXv3
         v3jsonld

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants