spdx / spdx/spec-parser

Determine actual base URI from the model

Open
#203 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
11
Forks
13
PR merge metrics
No merged PRs in 30d

Description

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/"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the predefined base URI and the code that processes the SPDX 3 model Markdown profile metadata. Compare deriving the URI from command-line or environment input with deriving it from the Markdown source, then confirm the parser uses the selected value consistently. Done means the base URI no longer depends on a fixed version-specific constant.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.