Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify spdx prefix names in model Turtle file ("@prefix ns2" -> "@prefix spdx-sw") #157

Open
bact opened this issue Oct 8, 2024 · 0 comments

Comments

@bact
Copy link
Contributor

bact commented Oct 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant