spdx / spdx/spdx-java-v3jsonld-store

Prefixes from @context are ignored

Open
#28 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
2
Forks
5
Avg merge
1d 11h
Merged PRs (30d)
9

Description

https://github.com/spdx/spdx-java-v3jsonld-store/blob/f3b461971a7d5ea59569e3b1db5672ac57cd7cc2/src/main/java/org/spdx/v3jsonldstore/JsonLDDeserializer.java#L107

Prefixes from @context seem to be ignored, e.g.:

{
    "@context": {
        "xsd": "http://www.w3.org/2001/XMLSchema#",
        "spdx": "https://spdx.org/rdf/3.0.1/terms/Core/",
        # ...
    },
    # ...
    "spdx:spdxId": {
      "@type": "xsd:anyURI",
      "@value": "urn:uuid:01973600-280e-7e13-b035-87a63695cf3d"
    },
    # ...
}

does not work. spdxId only works with:

{
    "@context": {
        "xsd": "http://www.w3.org/2001/XMLSchema#",
        "@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/",
        # ...
    },
    # ...
    "spdxId": {
      "@type": "xsd:anyURI",
      "@value": "urn:uuid:01973600-280e-7e13-b035-87a63695cf3d"
    },
    # ...
}

Here, it seems not specifying "@vocab": "https://spdx.org/rdf/3.0.1/terms/Core/", is also fine.

This leaves me also with the following questions:

Is this really a general purpose SPDX v3 JSON-LD store, or is it rather built to digest files from exactly one source that always structures them the same way? In RDF, I would expect an application to accept my files if the graph matches the necessary structure independent of the exact serialization i use. This seems not to be the case with this store.

Contributor guide

Open the contributing guide

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 with src/main/java/org/spdx/v3jsonldstore/JsonLDDeserializer.java at line 107 and trace how the @context entries are read when resolving prefixed properties. Reproduce the issue using the JSON-LD example in the report, then verify that prefixes such as spdx: and xsd: are handled as expected without relying on @vocab. Done means the reported prefixed form is accepted and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.