Skip to content

Commit f0d80f1

Browse files
committed
- Always pass typeScopedContext to _expandObject.
- Allow a keyword to exist when expanding in _expandObject when the key is `@included` or `@type`.
1 parent 080e374 commit f0d80f1

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
### Fixed
44
- More support for `"@type": "@none"`.
55
- JSON literal value handling issues (`null` and `[]`).
6+
- Always pass typeScopedContext to _expandObject.
7+
- Allow a keyword to exist when expanding in _expandObject when the key is `@included` or `@type`.
68

79
## 2.0.1 - 2019-12-10
810

lib/expand.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,9 @@ async function _expandObject({
458458
'property.', 'jsonld.SyntaxError',
459459
{code: 'invalid reverse property map', value});
460460
}
461-
if(expandedProperty in expandedParent) {
461+
if(expandedProperty in expandedParent &&
462+
expandedProperty !== '@included' &&
463+
expandedProperty !== '@type') {
462464
throw new JsonLdError(
463465
'Invalid JSON-LD syntax; colliding keywords detected.',
464466
'jsonld.SyntaxError',
@@ -821,6 +823,7 @@ async function _expandObject({
821823
expandedParent,
822824
options,
823825
insideList,
826+
typeScopedContext,
824827
typeKey,
825828
expansionMap});
826829
}

tests/test-common.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ const TEST_TYPES = {
127127
/expand-manifest.jsonld#tin07$/,
128128
/expand-manifest.jsonld#tin08$/,
129129
/expand-manifest.jsonld#tin09$/,
130-
// @nest
131-
/expand-manifest.jsonld#tn008$/,
132130
// keywords
133131
/expand-manifest.jsonld#tpr30$/,
134132
/expand-manifest.jsonld#tpr31$/,
@@ -387,8 +385,6 @@ const TEST_TYPES = {
387385
/toRdf-manifest.jsonld#tin04$/,
388386
/toRdf-manifest.jsonld#tin05$/,
389387
/toRdf-manifest.jsonld#tin06$/,
390-
// @next
391-
/toRdf-manifest.jsonld#tn008$/,
392388
// keywords
393389
/toRdf-manifest.jsonld#tpr30$/,
394390
/toRdf-manifest.jsonld#tpr31$/,

0 commit comments

Comments
 (0)