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

Update spdx3.model to SPDX v3.0.1 #829

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Conversation

bact
Copy link

@bact bact commented Oct 9, 2024

Update spdx_tools.spdx3.model to the latest in SPDX v3.0.1:

  • Move Core Profile-related files to their own directories (following current v3 model structure)
    • from spdx_tools.spdx3.model to spdx_tools.spdx3.model.core
    • from spdx_tools.spdx3.writer.console to spdx_tools.spdx3.writer.console.core
  • Type/Enums:
    • Complete/update entries in vocabularies (enums) (e.g. HashAlgorithm, RelationshipType).
      • ADLER32 algorithm is now available
      • New relationship types like HAS_OPTIONAL_COMPONENT
    • Add PresenceType, SupportType, FileKindType
    • Update RelationshipType conversion rules in bump_from_spdx2/relationship.py: using the table from Differences between V3.0 and V2.3: Relationship as a reference
    • ExternalIdentifierType: PURL -> PACKAGE_URL
    • RelationshipType: concludedLicense -> hasConcludedLicense
    • RelationshipType: declaredLicense -> hasDeclaredLicense
  • Rename (see also CHANGELOG.md):
    • AIPackage: sensitivePersonalInformation -> useSensitivePersonalInformation
    • Build: parameters -> parameter
    • Core: ExternalReference -> ExternalRef
    • Core: ExternalReferenceType -> ExternalRefType
    • Core: imports -> import_ (cannot use "import", as it is Python's reserved)
    • Dataset: Dataset -> DatasetPackage
    • DatasetPackage: sensitivePersonalInformation -> hasSensitivePersonalInformation
    • Package: homepage -> homePage (home_page)
    • Software: SBOMType -> SbomType
  • Others:
    • Fix type in class initialization (List cannot be None)
    • Sorting out imports, to avoid circular import issue
    • Update SPDX_OWL.json and context.json with ones generated from the latest v3.0.1 model at https://spdx.org/rdf/3.0.1/spdx-model.ttl (10 Oct 2024) (using instructions in the updated process.md)

Notes:

  • Mapping between spdx2 and spdx3 (that is required for conversion) is not yet in this PR.
  • SpdxOrganization individual is also not in this PR

bact added 16 commits October 8, 2024 20:46
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Match the name in v3.0.1
Signed-off-by: Arthit Suriyawongkul <[email protected]>
declaredLicense -> hasDeclaredLicense

Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Generating from https://spdx.org/rdf/3.0.1/spdx-model.ttl, following steps in src/spdx_tools/spdx3/writer/json_ld/process.md
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
@bact bact marked this pull request as draft October 10, 2024 16:55
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
@bact bact marked this pull request as ready for review October 10, 2024 20:41
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
@goneall
Copy link
Member

goneall commented Oct 15, 2024

@maxhbr - Can you take a quick look and give @bact feedback

Discussed on the 15 Oct 2024 tech call

@bact
Copy link
Author

bact commented Nov 4, 2024

We might abandon this PR if we can generate the Python code from the model ontology file (I have learned from Gary that there's a work under going for that).

I think that's probably a better approach in terms of maintenance (and correctness to the model).

@keithofox
Copy link

keithofox commented Nov 5, 2024 via email

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

Successfully merging this pull request may close these issues.

3 participants