Skip to content

rdf-parser fails on SPDXRdfExample-v2.2 #323

Closed

Description

@meretp

The rdf parser throws an IndexError (IndexError: list index out of range), when trying to parse the RdfExample file for spec version 2.2 from the spdx-spec repo (here).

Activity

  1. abhi-kr-2100 commented on Nov 28, 2022

    @abhi-kr-2100

    I've successfully reproduced this error, and currently working to diagnose and fix it.

  2. abhi-kr-2100 commented on Nov 29, 2022

    @abhi-kr-2100

    After some analysis, I've found that the body of the for loop at https://github.com/spdx/tools-python/blob/main/spdx/parsers/rdf.py#L1450 doesn't execute. As a result, set_ext_doc_id — the function that populates doc.ext_document_references — is not run.

    The for loop at https://github.com/spdx/tools-python/blob/main/spdx/parsers/rdf.py#L1459 does run, but since doc.ext_document_references is empty, it causes an IndexError.

    I've fixed this particular problem but the sample file still causes exceptions due to other bugs. I'm making a pull request to get feedback on whether my way of solving these problems is correct since I'm new to SPDX.

  3. armintaenzertng commented on Mar 31, 2023

    @armintaenzertng
    Collaborator

    The example document SPDXRdfExample-v2.2.spdx.rdf.xml can be successfully parsed using the refactored version now found on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions