Specify spdx prefix names in model Turtle file ("@prefix ns2" -> "@prefix spdx-sw")
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Open rdf.py and locate gen_rdf_ontology(). Review how the generated Turtle currently assigns prefixes, then define concise names for the SPDX profiles or vocabularies as described in the issue. The work is done when the generated model uses the named prefixes without changing its machine-side behavior.
Written by the indexing model from the issue text.
Description
Prefixes for SPDX Profiles in the generate Turtle are currently look like this:
...
@prefix ns1: <https://spdx.org/rdf/3.0.1/terms/Core/> .
@prefix ns2: <https://spdx.org/rdf/3.0.1/terms/Software/> .
@prefix ns3: <https://spdx.org/rdf/3.0.1/terms/Dataset/> .
...
@prefix omg-ann: <https://www.omg.org/spec/Commons/AnnotationVocabulary/> .
@prefix spdx: <https://spdx.org/rdf/3.0.1/terms/> .
...
Which may make it not very convenient when going through the code.
Proposal
We may specify the name of the prefix for each profile or each vocab (only for the vocab that has a lot of entries).
This will make it more convenient to follow the code, and may shorten the code as well.
Suggesting that the gen_rdf_ontology() function in rdf.py can look like this:
g = Graph()
g.bind("spdx", Namespace(URI_BASE))
g.bind("spdx-ai", Namespace(URI_BASE + "AI/"))
g.bind("spdx-core", Namespace(URI_BASE + "Core/"))
g.bind("spdx-hash", Namespace(URI_BASE + "Core/HashAlgorithm/"))
g.bind("spdx-re", Namespace(URI_BASE + "Core/RelationshipType/"))
...
Appropriated clear & concise prefix names can be proposed.
The change shouldn't change the behaviour of the model on the machine side, but it should help the human developer.
- Dominant language
- Python
- Stars
- 11
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from spdx/spec-parser
-
spdx/spec-parser#214 · 5 comments · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
spdx/spec-parser#207 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
spdx/spec-parser#204 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
spdx/spec-parser#203 ·
-
spdx/spec-parser#198 · 1 comment · 2 assignees ·
All issues in spdx/spec-parser
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100