Skip to content

Commit a09e492

Browse files
gkelloggdavidlehn
authored andcommitted
Terms that beging with a ':' are not considered absolute or compact IRIs.
1 parent 43f2992 commit a09e492

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- `@vocab` can be relative in 1.0, resolved against either a previous `@vocab`,
1414
`@base` or document base.
1515
- Better checking of absolute IRIs.
16+
- Terms that beging with a ':' are not considered absolute or compact IRIs.
1617

1718
### Removed
1819
- **BREAKING**: Remove callback API support. This includes removing support

lib/context.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ api.createTermDefinition = (
393393
// always compute whether term has a colon as an optimization for
394394
// _compactIri
395395
const colon = term.indexOf(':');
396-
mapping._termHasColon = (colon !== -1);
396+
mapping._termHasColon = (colon > 0);
397397

398398
if('@reverse' in value) {
399399
if('@id' in value) {
@@ -757,7 +757,7 @@ function _expandIri(activeCtx, value, relativeTo, localCtx, defined, options) {
757757

758758
// split value into prefix:suffix
759759
const colon = value.indexOf(':');
760-
if(colon !== -1) {
760+
if(colon > 0) {
761761
const prefix = value.substr(0, colon);
762762
const suffix = value.substr(colon + 1);
763763

tests/test-common.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,6 @@ const TEST_TYPES = {
111111
/expand-manifest.jsonld#t0102$/,
112112
// multiple graphs
113113
/expand-manifest.jsonld#t0103$/,
114-
// terms beginning with ':'
115-
/expand-manifest.jsonld#t0117$/,
116-
/expand-manifest.jsonld#t0118$/,
117114
// terms having form of keyword
118115
/expand-manifest.jsonld#t0119$/,
119116
/expand-manifest.jsonld#t0120$/,
@@ -402,9 +399,6 @@ const TEST_TYPES = {
402399
idRegex: [
403400
// blank node properties
404401
/toRdf-manifest.jsonld#t0118$/,
405-
// terms beginning with ':'
406-
/toRdf-manifest.jsonld#te117$/,
407-
/toRdf-manifest.jsonld#te118$/,
408402
// terms having form of keyword
409403
/toRdf-manifest.jsonld#te119$/,
410404
/toRdf-manifest.jsonld#te120$/,

0 commit comments

Comments
 (0)