Skip to content

compaction with URL context doesn't work #183

Open
@JPEWdev

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions