Skip to content

[BUG] Framing a document with the traceability context raises an error #188

Closed
@PatStLouis

Description

@PatStLouis

I'm having issues leveraging pyld for a traceability implementation I'm working on. Could someone provide insight to the following errors:

pyld.jsonld.JsonLdError: ('Could not expand input before framing.',)
Type: jsonld.FrameError
Cause: ('Tried to nullify a context with protected terms outside of a term definition.',)
Type: jsonld.SyntaxError
Code: invalid context nullification

Here is a simple snippet of code to reproduce it. Commenting out the traceability url from the context resolves the issue however it should be present:

from pyld import jsonld
document = {
    "@context": [
        "https://www.w3.org/ns/did/v1",
        "https://w3id.org/traceability/v1"
    ],
    "service": [
        {
            "id": "did:web:example.com#traceability-api",
            "type": "TraceabilityAPI",
            "serviceEndpoint": "https://example.com"
          }
    ]
}
frame = {}
framed = jsonld.frame(document, frame)

@dlongley 👀

Any help appreciated!

Metadata

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