-
Notifications
You must be signed in to change notification settings - Fork 153
Open
Description
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:
jsonld-java/core/src/main/java/com/github/jsonldjava/core/Context.java
Lines 324 to 328 in 7a6cd62
| 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:
jsonld-java/core/src/main/java/com/github/jsonldjava/core/Context.java
Lines 470 to 472 in 7a6cd62
| if (JsonLdConsts.TYPE.equals(term)) { | |
| definition.put(JsonLdConsts.ID, "type"); | |
| } |
jsonld-java/core/src/main/java/com/github/jsonldjava/core/Context.java
Lines 1173 to 1178 in 7a6cd62
| 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(); |
jake-goldsmith
Metadata
Metadata
Assignees
Labels
No labels