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

compaction with URL context doesn't work #183

Open
JPEWdev opened this issue Oct 21, 2023 · 0 comments
Open

compaction with URL context doesn't work #183

JPEWdev opened this issue Oct 21, 2023 · 0 comments

Comments

@JPEWdev
Copy link

JPEWdev commented Oct 21, 2023

Specifying a URL as the context when compacting doesn't work. The following example program demonstrates:

#! /usr/bin/env python3
from pyld import jsonld
import json
import pprint

doc = {
    "@graph": [
        {
            "@id": "_:build_Build0",
            "@type": "https://spdx.org/rdf/v3/Build/Build",
            "https://spdx.org/rdf/v3/Build/buildType": "http://openembedded.org/bitbake",
            "https://spdx.org/rdf/v3/Core/creationInfo": "_:core_CreationInfo111",
        },
    ]
}

pprint.pprint(jsonld.compact(doc, "https://spdx.github.io/spdx-3-model/context.json"))

No compaction is done, but it does work correctly if I manually download the context from the URL and load as a python dictionary

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