Skip to content

Error when building from source: 'extension' is already defined for 'build_Build' #12

@benjarobin

Description

@benjarobin

Now when I try to generate the library from source, I have the following error when using the library.

'extension' is already defined for 'build_Build'

In the generated v3_0_1.py the following bloc is duplicated:

        # Specifies an Extension characterization of some aspect of an Element.
        cls._add_property(
            "extension",
            ListProp(ObjectProp(extension_Extension, False)),
            iri="https://spdx.org/rdf/3.0.1/terms/Core/extension",
            compact="extension",
            deprecated=False
        )

To reproduce this issue:

mkdir test
cd test
python3 -m venv .venv
. .venv/bin/activate
pip install shacl2code
shacl2code generate --input https://spdx.org/rdf/3.0.1/spdx-model.ttl  --input https://spdx.org/rdf/3.0.1/spdx-json-serialize-annotations.ttl  --context https://spdx.org/rdf/3.0.1/spdx-context.jsonld --license Apache-2.0 python -o out.py
grep extension_Extension out.py

Do you have any clue why now the generated spdx-python-model library is corrupted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions