Skip to content

Determine actual base URI from the model #203

@bact

Description

@bact

Because we're managing more than one version of the model, it would be better to set the base URI dynamically instead of using a predefined constant.

There can be at least two ways of doing this:

  1. Get it from command line/environment variable
  2. Get it from model Markdown source file (model Markdown source file will be the single source of truth)

Option (2) is possible because SPDX 3 model Markdown source contains the profile namespace IRIs (in profile metadata section).

We can do it like this:

iri = "https://spdx.org/rdf/3.0/terms/Core/"
if iri.endswith("/Core/"):
    base_uri = iri[: -len("Core/")]
elif iri.endswith("/Core"):
    base_uri = iri[: -len("Core")]

# base_iri = "https://spdx.org/rdf/3.0/terms/"

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