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:
|
if (JsonLdUtils.isKeyword(term) |
|
&& !(options.getAllowContainerSetOnType() && JsonLdConsts.TYPE.equals(term) |
|
&& !(context.get(term)).toString().contains(JsonLdConsts.ID))) { |
|
throw new JsonLdError(Error.KEYWORD_REDEFINITION, term); |
|
} |
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); |
|
} |
|
final Map<String, Object> rval = activeCtx.serialize(); |
Given a context like:
When using the serialization for framing, the term's definition value for @id is used and added to the context resulting in:
This goes against the de-serialization rules:
jsonld-java/core/src/main/java/com/github/jsonldjava/core/Context.java
Lines 324 to 328 in 7a6cd62
The type's @id definition was added in change: 673dac2 and seems like it was tested with compact serialization.
Serialization references:
jsonld-java/core/src/main/java/com/github/jsonldjava/core/Context.java
Lines 470 to 472 in 7a6cd62
jsonld-java/core/src/main/java/com/github/jsonldjava/core/Context.java
Lines 1173 to 1178 in 7a6cd62
jsonld-java/core/src/main/java/com/github/jsonldjava/core/JsonLdProcessor.java
Line 329 in 7a6cd62