From d5ad0d91719a2d568658ca175117e23bde05d949 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Wed, 6 Dec 2023 00:20:25 -0500 Subject: [PATCH] Fix `@graph` `@container` term `@context` handling. When a term scoped context is nullified, it also nullifies the container information. This fix gets the `@container` value from the active context. In particular, this is needed for proper `@graph` container handling. --- CHANGELOG.md | 5 +++++ lib/expand.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2a84a1d..90921276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # jsonld ChangeLog +## 8.3.2 - 2023-xx-xx + +### Fixed +- Fix handling of a `@graph` `@container` term that has a `null` `@context`. + ## 8.3.1 - 2023-09-06 ### Fixed diff --git a/lib/expand.js b/lib/expand.js index bae49994..dc52fc68 100644 --- a/lib/expand.js +++ b/lib/expand.js @@ -856,7 +856,7 @@ async function _expandObject({ }); } - const container = _getContextValue(termCtx, key, '@container') || []; + const container = _getContextValue(activeCtx, key, '@container') || []; if(container.includes('@language') && _isObject(value)) { const direction = _getContextValue(termCtx, key, '@direction');