Skip to content

Commit 9580710

Browse files
gkelloggdavidlehn
authored andcommitted
Update Changelog.
1 parent d910e69 commit 9580710

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
- Compacting multiple nodes in a graph container places them in `@included`.
99
- Indexing on `@type` requires `@type` to be either `@id` or `@vocab`, and
1010
defaults to `@id`.
11+
- Expanding/compacting type scoped contexts uses context before applying
12+
new versions to look for type scopes.
13+
-
1114

1215
### Changed
1316
- Default processing mode changed to json-ld-1.1. Allows a 1.1 context to be
@@ -20,6 +23,9 @@
2023
- Don't use terms with `"@prefix": false` or expanded term definitions to
2124
construct compact IRIs.
2225
- `@type` may be used as a term definition only if `"@container": "@set"`.
26+
- Improve support for term propagation.
27+
- Context propagation no longer strictly related to use for property-scoped
28+
or term-scoped contexts and can be overridden.
2329

2430
### Removed
2531
- **BREAKING**: Remove callback API support. This includes removing support

lib/compact.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ api.compact = async ({
169169
}
170170

171171
// apply property-scoped context after reverting term-scoped context
172-
const propertyScopedCtx = _getContextValue(inputCtx, activeProperty, '@context');
172+
const propertyScopedCtx =
173+
_getContextValue(inputCtx, activeProperty, '@context');
173174
if(!_isUndefined(propertyScopedCtx)) {
174175
activeCtx = await _processContext({
175176
activeCtx,
@@ -235,7 +236,7 @@ api.compact = async ({
235236
const alias = api.compactIri(
236237
{activeCtx, iri: '@id', relativeTo: {vocab: true}});
237238

238-
rval[alias] = compactedValue;
239+
rval[alias] = compactedValue;
239240
continue;
240241
}
241242

@@ -259,7 +260,7 @@ api.compact = async ({
259260
activeCtx, alias, '@container') || [];
260261

261262
// treat as array for @type if @container includes @set
262-
const typeAsSet =
263+
const typeAsSet =
263264
container.includes('@set') &&
264265
_processingMode(activeCtx, 1.1);
265266
const isArray =

lib/context.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ api.cache = new ActiveContextCache();
4343
* @param localCtx the local context to process.
4444
* @param options the context processing options.
4545
* @param propagate `true` if `false`, retains any previously defined term,
46-
* which can be rolled back when the descending into a new node object changes.
46+
* which can be rolled back when the descending into a new node object.
4747
* @param overrideProtected `false` allows protected terms to be modified.
4848
*
4949
* @return a Promise that resolves to the new active context.
@@ -480,7 +480,9 @@ api.createTermDefinition = ({
480480
const prefix = term.substr(0, colon);
481481
if(localCtx.hasOwnProperty(prefix)) {
482482
// define parent prefix
483-
api.createTermDefinition({activeCtx, localCtx, term: prefix, defined, options});
483+
api.createTermDefinition({
484+
activeCtx, localCtx, term: prefix, defined, options
485+
});
484486
}
485487

486488
if(activeCtx.mappings.has(prefix)) {
@@ -785,7 +787,9 @@ function _expandIri(activeCtx, value, relativeTo, localCtx, defined, options) {
785787
// define term dependency if not defined
786788
if(localCtx && localCtx.hasOwnProperty(value) &&
787789
defined.get(value) !== true) {
788-
api.createTermDefinition({activeCtx, localCtx, term: value, defined, options});
790+
api.createTermDefinition({
791+
activeCtx, localCtx, term: value, defined, options
792+
});
789793
}
790794

791795
relativeTo = relativeTo || {};
@@ -817,7 +821,9 @@ function _expandIri(activeCtx, value, relativeTo, localCtx, defined, options) {
817821

818822
// prefix dependency not defined, define it
819823
if(localCtx && localCtx.hasOwnProperty(prefix)) {
820-
api.createTermDefinition({activeCtx, localCtx, term: prefix, defined, options});
824+
api.createTermDefinition({
825+
activeCtx, localCtx, term: prefix, defined, options
826+
});
821827
}
822828

823829
// use mapping if prefix is defined

lib/expand.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ api.expand = async ({
158158
activeCtx, activeProperty, {vocab: true}, options);
159159

160160
// Get any property-scoped context for activeProperty
161-
const propertyScopedCtx = _getContextValue(activeCtx, activeProperty, '@context');
161+
const propertyScopedCtx =
162+
_getContextValue(activeCtx, activeProperty, '@context');
162163

163164
// second, determine if any type-scoped context should be reverted; it
164165
// should only be reverted when the following are all true:

0 commit comments

Comments
 (0)