Context serialization created using JSONLD_FRAME_FLAT setting @set for @type results in an invalid Context · Issue #337 · jsonld-java/jsonld-java · GitHub
Skip to content

Context serialization created using JSONLD_FRAME_FLAT setting @set for @type results in an invalid Context #337

Description

@dnx2710

Given a context like:

"@context": {
    "@vocab": "https://example.org",
    "@type": {
      "@container": "@set"
    }
}

When using the serialization for framing, the term's definition value for @id is used and added to the context resulting in:

"@context": {
    "@vocab": "https://example.org",
    "@type": {
      "@id": "type"
      "@container": "@set"
    }
}

This goes against the de-serialization rules:

The type's @id definition was added in change: 673dac2 and seems like it was tested with compact serialization.

Serialization references:

if (JsonLdConsts.TYPE.equals(term)) {
definition.put(JsonLdConsts.ID, "type");
}

final String cid = this.compactIri((String) definition.get(JsonLdConsts.ID));
final Boolean reverseProperty = Boolean.TRUE
.equals(definition.get(JsonLdConsts.REVERSE));
if (!(term.equals(cid) && !reverseProperty)) {
defn.put(reverseProperty ? JsonLdConsts.REVERSE : JsonLdConsts.ID, cid);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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