From ad702d6a90258a573868c9e9990e79a158426d89 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Thu, 28 Feb 2019 21:01:27 -0500 Subject: [PATCH 1/3] Make `@protected` test strict. - Check for errors when `@protected` conditions are violated. --- tests/expand-manifest.jsonld | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/expand-manifest.jsonld b/tests/expand-manifest.jsonld index 6a892f59..a922bb8c 100644 --- a/tests/expand-manifest.jsonld +++ b/tests/expand-manifest.jsonld @@ -1875,12 +1875,12 @@ "expect": "expand/li10-out.jsonld" }, { "@id": "#tpr01", - "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], "name": "Protect a term", "purpose": "Protected Contexts", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr01-in.jsonld", - "expect": "expand/pr01-out.jsonld" + "expect": "protected term redefinition" }, { "@id": "#tpr02", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], @@ -1891,28 +1891,28 @@ "expect": "expand/pr02-out.jsonld" }, { "@id": "#tpr03", - "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], "name": "Protect all terms in context", "purpose": "A protected context protects all term definitions.", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr03-in.jsonld", - "expect": "expand/pr03-out.jsonld" + "expect": "protected term redefinition" }, { "@id": "#tpr04", - "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], "name": "Do not protect term with @protected: false", "purpose": "A protected context does not protect terms with @protected: false.", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr04-in.jsonld", - "expect": "expand/pr04-out.jsonld" + "expect": "protected term redefinition" }, { "@id": "#tpr05", - "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], "name": "Clear active context with protected terms from an embedded context", "purpose": "The Active context be set to null from an embedded context.", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr05-in.jsonld", - "expect": "expand/pr05-out.jsonld" + "expect": "invalid context nullification" }, { "@id": "#tpr06", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], @@ -1923,20 +1923,20 @@ "expect": "expand/pr06-out.jsonld" }, { "@id": "#tpr08", - "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], "name": "Term with protected scoped context.", "purpose": "A scoped context can protect terms.", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr08-in.jsonld", - "expect": "expand/pr08-out.jsonld" + "expect": "protected term redefinition" }, { "@id": "#tpr09", - "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], "name": "Attempt to redefine term in other protected context.", "purpose": "A protected term cannot redefine another protected term.", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr09-in.jsonld", - "expect": "expand/pr09-out.jsonld" + "expect": "protected term redefinition" }, { "@id": "#ttn01", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], From 51736a027e37682d3efe18716c9082b047b613a5 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Thu, 28 Feb 2019 21:04:16 -0500 Subject: [PATCH 2/3] Add more `@protected` tests. --- tests/expand-manifest.jsonld | 56 ++++++++++++++++++++++++++++++++++++ tests/expand/pr10-in.jsonld | 14 +++++++++ tests/expand/pr10-out.jsonld | 18 ++++++++++++ tests/expand/pr11-in.jsonld | 17 +++++++++++ tests/expand/pr11-out.jsonld | 1 + tests/expand/pr12-in.jsonld | 15 ++++++++++ tests/expand/pr12-out.jsonld | 1 + tests/expand/pr13-in.jsonld | 18 ++++++++++++ tests/expand/pr13-out.jsonld | 18 ++++++++++++ tests/expand/pr14-in.jsonld | 18 ++++++++++++ tests/expand/pr14-out.jsonld | 18 ++++++++++++ tests/expand/pr15-in.jsonld | 22 ++++++++++++++ tests/expand/pr15-out.jsonld | 1 + tests/expand/pr16-in.jsonld | 19 ++++++++++++ tests/expand/pr16-out.jsonld | 1 + 15 files changed, 237 insertions(+) create mode 100644 tests/expand/pr10-in.jsonld create mode 100644 tests/expand/pr10-out.jsonld create mode 100644 tests/expand/pr11-in.jsonld create mode 100644 tests/expand/pr11-out.jsonld create mode 100644 tests/expand/pr12-in.jsonld create mode 100644 tests/expand/pr12-out.jsonld create mode 100644 tests/expand/pr13-in.jsonld create mode 100644 tests/expand/pr13-out.jsonld create mode 100644 tests/expand/pr14-in.jsonld create mode 100644 tests/expand/pr14-out.jsonld create mode 100644 tests/expand/pr15-in.jsonld create mode 100644 tests/expand/pr15-out.jsonld create mode 100644 tests/expand/pr16-in.jsonld create mode 100644 tests/expand/pr16-out.jsonld diff --git a/tests/expand-manifest.jsonld b/tests/expand-manifest.jsonld index a922bb8c..6b7a6337 100644 --- a/tests/expand-manifest.jsonld +++ b/tests/expand-manifest.jsonld @@ -1937,6 +1937,62 @@ "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr09-in.jsonld", "expect": "protected term redefinition" + }, { + "@id": "#tpr10", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "", + "purpose": "", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr10-in.jsonld", + "expect": "expand/pr10-out.jsonld" + }, { + "@id": "#tpr11", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "", + "purpose": "", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr11-in.jsonld", + "expect": "protected term redefinition" + }, { + "@id": "#tpr12", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "", + "purpose": "", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr12-in.jsonld", + "expect": "protected term redefinition" + }, { + "@id": "#tpr13", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "", + "purpose": "", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr13-in.jsonld", + "expect": "expand/pr13-out.jsonld" + }, { + "@id": "#tpr14", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "", + "purpose": "", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr14-in.jsonld", + "expect": "expand/pr14-out.jsonld" + }, { + "@id": "#tpr15", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "", + "purpose": "", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr15-in.jsonld", + "expect": "invalid context nullification" + }, { + "@id": "#tpr16", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "", + "purpose": "", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr16-in.jsonld", + "expect": "invalid context nullification" }, { "@id": "#ttn01", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], diff --git a/tests/expand/pr10-in.jsonld b/tests/expand/pr10-in.jsonld new file mode 100644 index 00000000..a8933fe3 --- /dev/null +++ b/tests/expand/pr10-in.jsonld @@ -0,0 +1,14 @@ +{ + "@context": { + "@version": 1.1, + "protected": { + "@id": "ex:protected", + "@protected": true + }, + "unprotected": "ex:unprotected" + }, + "protected": "p === ex:protected", + "unprotected": { + "protected": "p === ex:protected" + } +} diff --git a/tests/expand/pr10-out.jsonld b/tests/expand/pr10-out.jsonld new file mode 100644 index 00000000..3f10151e --- /dev/null +++ b/tests/expand/pr10-out.jsonld @@ -0,0 +1,18 @@ +[ + { + "ex:protected": [ + { + "@value": "p === ex:protected" + } + ], + "ex:unprotected": [ + { + "ex:protected": [ + { + "@value": "p === ex:protected" + } + ] + } + ] + } +] diff --git a/tests/expand/pr11-in.jsonld b/tests/expand/pr11-in.jsonld new file mode 100644 index 00000000..de185630 --- /dev/null +++ b/tests/expand/pr11-in.jsonld @@ -0,0 +1,17 @@ +{ + "@context": { + "@version": 1.1, + "protected": { + "@id": "ex:protected", + "@protected": true + }, + "unprotected": "ex:unprotected" + }, + "protected": "p === ex:protected", + "unprotected": { + "@context": { + "protected": "ex:protected2" + }, + "protected": "p === ex:protected" + } +} diff --git a/tests/expand/pr11-out.jsonld b/tests/expand/pr11-out.jsonld new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/tests/expand/pr11-out.jsonld @@ -0,0 +1 @@ +[] diff --git a/tests/expand/pr12-in.jsonld b/tests/expand/pr12-in.jsonld new file mode 100644 index 00000000..c4af2629 --- /dev/null +++ b/tests/expand/pr12-in.jsonld @@ -0,0 +1,15 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "protected1": "ex:protected1", + "protected2": "ex:protected2" + }, + "protected1": "p1", + "protected2": { + "@context": { + "protected1": "ex:protected1:error" + }, + "protected1": "p1error" + } +} diff --git a/tests/expand/pr12-out.jsonld b/tests/expand/pr12-out.jsonld new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/tests/expand/pr12-out.jsonld @@ -0,0 +1 @@ +[] diff --git a/tests/expand/pr13-in.jsonld b/tests/expand/pr13-in.jsonld new file mode 100644 index 00000000..6f8ff006 --- /dev/null +++ b/tests/expand/pr13-in.jsonld @@ -0,0 +1,18 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "protected": "ex:protected", + "unprotected": { + "@id": "ex:unprotected1", + "@protected": false + } + }, + "protected": { + "@context": { + "unprotected": "ex:unprotected2" + }, + "unprotected": "p === ex:unprotected2" + }, + "unprotected": "p === ex:unprotected1" +} diff --git a/tests/expand/pr13-out.jsonld b/tests/expand/pr13-out.jsonld new file mode 100644 index 00000000..256cc41a --- /dev/null +++ b/tests/expand/pr13-out.jsonld @@ -0,0 +1,18 @@ +[ + { + "ex:protected": [ + { + "ex:unprotected2": [ + { + "@value": "p === ex:unprotected2" + } + ] + } + ], + "ex:unprotected1": [ + { + "@value": "p === ex:unprotected1" + } + ] + } +] diff --git a/tests/expand/pr14-in.jsonld b/tests/expand/pr14-in.jsonld new file mode 100644 index 00000000..a3a1caf3 --- /dev/null +++ b/tests/expand/pr14-in.jsonld @@ -0,0 +1,18 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "protected1": "ex:protected1", + "protected2": { + "@id": "ex:protected2", + "@context": [null] + } + }, + "protected1": "p === ex:protected1", + "protected2": { + "@context": { + "protected": "ex:protected3" + }, + "protected": "p === ex:protected3" + } +} diff --git a/tests/expand/pr14-out.jsonld b/tests/expand/pr14-out.jsonld new file mode 100644 index 00000000..52c399e9 --- /dev/null +++ b/tests/expand/pr14-out.jsonld @@ -0,0 +1,18 @@ +[ + { + "ex:protected1": [ + { + "@value": "p === ex:protected1" + } + ], + "ex:protected2": [ + { + "ex:protected3": [ + { + "@value": "p === ex:protected3" + } + ] + } + ] + } +] diff --git a/tests/expand/pr15-in.jsonld b/tests/expand/pr15-in.jsonld new file mode 100644 index 00000000..196da8bd --- /dev/null +++ b/tests/expand/pr15-in.jsonld @@ -0,0 +1,22 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "protected1": "ex:protected1", + "protected2": "ex:protected2", + "Protected": { + "@id": "ex:Protected", + "@context": [ + null + ] + } + }, + "protected1": "p === protected1", + "protected2": { + "@type": "Protected", + "@context": { + "protected": "ex:protected3" + }, + "protected": "error" + } +} diff --git a/tests/expand/pr15-out.jsonld b/tests/expand/pr15-out.jsonld new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/tests/expand/pr15-out.jsonld @@ -0,0 +1 @@ +[] diff --git a/tests/expand/pr16-in.jsonld b/tests/expand/pr16-in.jsonld new file mode 100644 index 00000000..0f7571ae --- /dev/null +++ b/tests/expand/pr16-in.jsonld @@ -0,0 +1,19 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "protected1": "ex:protected1", + "protected2": "ex:protected2", + "Protected": { + "@id": "ex:Protected", + "@context": [ + null, + { + "protected": "ex:protected3" + } + ] + } + }, + "@type": "Protected", + "protected": "error" +} diff --git a/tests/expand/pr16-out.jsonld b/tests/expand/pr16-out.jsonld new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/tests/expand/pr16-out.jsonld @@ -0,0 +1 @@ +[] From 9cf54687e03a7d69ea89de9023a4647f9f488567 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Fri, 8 Mar 2019 22:18:37 -0500 Subject: [PATCH 3/3] Add more `@protected` tests. - Simplify text in older tests. - Support 'protectedMode' option of 'error' or 'warn'. - Test both 'protectedMode' types where needed. - Using 'e' or 'w' suffix for test id but same input file. - Add more tests of various situations. --- tests/expand-manifest.jsonld | 210 +++++++++++++++++++++++++++++------ tests/expand/pr01-in.jsonld | 10 +- tests/expand/pr01-out.jsonld | 2 +- tests/expand/pr02-in.jsonld | 14 ++- tests/expand/pr02-out.jsonld | 2 +- tests/expand/pr03-in.jsonld | 12 +- tests/expand/pr03-out.jsonld | 4 +- tests/expand/pr04-in.jsonld | 12 +- tests/expand/pr04-out.jsonld | 4 +- tests/expand/pr05-in.jsonld | 9 +- tests/expand/pr05-out.jsonld | 2 +- tests/expand/pr06-in.jsonld | 9 +- tests/expand/pr08-in.jsonld | 28 +++-- tests/expand/pr08-out.jsonld | 4 +- tests/expand/pr09-in.jsonld | 6 +- tests/expand/pr09-out.jsonld | 2 +- tests/expand/pr11-out.jsonld | 19 +++- tests/expand/pr12-in.jsonld | 4 +- tests/expand/pr12-out.jsonld | 19 +++- tests/expand/pr14-in.jsonld | 6 +- tests/expand/pr15-in.jsonld | 12 +- tests/expand/pr15-out.jsonld | 19 +++- tests/expand/pr16-in.jsonld | 23 +++- tests/expand/pr16-out.jsonld | 29 ++++- tests/expand/pr17-in.jsonld | 22 ++++ tests/expand/pr17-out.jsonld | 16 +++ tests/expand/pr18-in.jsonld | 18 +++ tests/expand/pr18-out.jsonld | 12 ++ tests/expand/pr19-in.jsonld | 29 +++++ tests/expand/pr19-out.jsonld | 23 ++++ tests/expand/pr20-in.jsonld | 24 ++++ tests/expand/pr20-out.jsonld | 17 +++ tests/expand/pr21-in.jsonld | 20 ++++ tests/expand/pr21-out.jsonld | 12 ++ 34 files changed, 557 insertions(+), 97 deletions(-) create mode 100644 tests/expand/pr17-in.jsonld create mode 100644 tests/expand/pr17-out.jsonld create mode 100644 tests/expand/pr18-in.jsonld create mode 100644 tests/expand/pr18-out.jsonld create mode 100644 tests/expand/pr19-in.jsonld create mode 100644 tests/expand/pr19-out.jsonld create mode 100644 tests/expand/pr20-in.jsonld create mode 100644 tests/expand/pr20-out.jsonld create mode 100644 tests/expand/pr21-in.jsonld create mode 100644 tests/expand/pr21-out.jsonld diff --git a/tests/expand-manifest.jsonld b/tests/expand-manifest.jsonld index 6b7a6337..3fff29d1 100644 --- a/tests/expand-manifest.jsonld +++ b/tests/expand-manifest.jsonld @@ -1874,13 +1874,21 @@ "input": "expand/li10-in.jsonld", "expect": "expand/li10-out.jsonld" }, { - "@id": "#tpr01", + "@id": "#tpr01e", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], - "name": "Protect a term", - "purpose": "Protected Contexts", + "name": "Protected a term (error mode)", + "purpose": "Check 'error' mode when overriding a protected term. (error mode)", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr01-in.jsonld", "expect": "protected term redefinition" + }, { + "@id": "#tpr01w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Protected a term (warn mode)", + "purpose": "Check 'warn' mode when overriding a protected term. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr01-in.jsonld", + "expect": "expand/pr01-out.jsonld" }, { "@id": "#tpr02", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], @@ -1890,29 +1898,53 @@ "input": "expand/pr02-in.jsonld", "expect": "expand/pr02-out.jsonld" }, { - "@id": "#tpr03", + "@id": "#tpr03e", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], - "name": "Protect all terms in context", - "purpose": "A protected context protects all term definitions.", + "name": "Protect all terms in context (error mode)", + "purpose": "A protected context protects all term definitions. (error mode)", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr03-in.jsonld", "expect": "protected term redefinition" }, { - "@id": "#tpr04", + "@id": "#tpr03w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Protect all terms in context (warn mode)", + "purpose": "A protected context protects all term definitions. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr03-in.jsonld", + "expect": "expand/pr03-out.jsonld" + }, { + "@id": "#tpr04e", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], - "name": "Do not protect term with @protected: false", - "purpose": "A protected context does not protect terms with @protected: false.", + "name": "Do not protect term with @protected: false (error mode)", + "purpose": "A protected context does not protect terms with @protected: false. (error mode)", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr04-in.jsonld", "expect": "protected term redefinition" }, { - "@id": "#tpr05", + "@id": "#tpr04w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Do not protect term with @protected: false (warn mode)", + "purpose": "A protected context does not protect terms with @protected: false. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr04-in.jsonld", + "expect": "expand/pr04-out.jsonld" + }, { + "@id": "#tpr05e", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], - "name": "Clear active context with protected terms from an embedded context", - "purpose": "The Active context be set to null from an embedded context.", + "name": "Clear active context with protected terms from an embedded context (error mode)", + "purpose": "The Active context be set to null from an embedded context. (error mode)", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr05-in.jsonld", "expect": "invalid context nullification" + }, { + "@id": "#tpr05w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Clear active context with protected terms from an embedded context (warn mode)", + "purpose": "The Active context be set to null from an embedded context. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr05-in.jsonld", + "expect": "expand/pr05-out.jsonld" }, { "@id": "#tpr06", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], @@ -1922,77 +1954,181 @@ "input": "expand/pr06-in.jsonld", "expect": "expand/pr06-out.jsonld" }, { - "@id": "#tpr08", + "@id": "#tpr08e", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], - "name": "Term with protected scoped context.", - "purpose": "A scoped context can protect terms.", + "name": "Term with protected scoped context. (error mode)", + "purpose": "A scoped context can protect terms. (error mode)", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr08-in.jsonld", "expect": "protected term redefinition" }, { - "@id": "#tpr09", + "@id": "#tpr08w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Term with protected scoped context. (warn mode)", + "purpose": "A scoped context can protect terms. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr08-in.jsonld", + "expect": "expand/pr08-out.jsonld" + }, { + "@id": "#tpr09e", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], - "name": "Attempt to redefine term in other protected context.", - "purpose": "A protected term cannot redefine another protected term.", + "name": "Attempt to redefine term in other protected context. (error mode)", + "purpose": "A protected term cannot redefine another protected term. (error mode)", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr09-in.jsonld", "expect": "protected term redefinition" + }, { + "@id": "#tpr09w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Attempt to redefine term in other protected context. (warn mode)", + "purpose": "A protected term cannot redefine another protected term. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr09-in.jsonld", + "expect": "expand/pr09-out.jsonld" }, { "@id": "#tpr10", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], - "name": "", - "purpose": "", + "name": "Simple protected and unprotected terms.", + "purpose": "Simple protected and unprotected terms.", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr10-in.jsonld", "expect": "expand/pr10-out.jsonld" }, { - "@id": "#tpr11", + "@id": "#tpr11e", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], - "name": "", - "purpose": "", + "name": "Fail to override protected term. (error mode)", + "purpose": "Fail to override protected term. (error mode)", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr11-in.jsonld", "expect": "protected term redefinition" }, { - "@id": "#tpr12", + "@id": "#tpr11w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Fail to override protected term. (warn mode)", + "purpose": "Fail to override protected term. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr11-in.jsonld", + "expect": "expand/pr11-out.jsonld" + }, { + "@id": "#tpr12e", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], - "name": "", - "purpose": "", + "name": "Scoped context fail to override protected term. (error mode)", + "purpose": "Scoped context fail to override protected term. (error mode)", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr12-in.jsonld", "expect": "protected term redefinition" + }, { + "@id": "#tpr12w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Scoped context fail to override protected term. (warn mode)", + "purpose": "Scoped context fail to override protected term. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr12-in.jsonld", + "expect": "expand/pr12-out.jsonld" }, { "@id": "#tpr13", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], - "name": "", - "purpose": "", + "name": "Override unprotected term.", + "purpose": "Override unprotected term.", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr13-in.jsonld", "expect": "expand/pr13-out.jsonld" }, { "@id": "#tpr14", "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], - "name": "", - "purpose": "", + "name": "Clear protection with null context.", + "purpose": "Clear protection with null context.", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr14-in.jsonld", "expect": "expand/pr14-out.jsonld" }, { "@id": "#tpr15", - "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], - "name": "", - "purpose": "", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Clear protection with array with null context", + "purpose": "Clear protection with array with null context", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr15-in.jsonld", - "expect": "invalid context nullification" + "expect": "expand/pr15-out.jsonld" }, { "@id": "#tpr16", - "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], - "name": "", - "purpose": "", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Override protected terms after null.", + "purpose": "Override protected terms after null.", "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr16-in.jsonld", + "expect": "expand/pr16-out.jsonld" + }, { + "@id": "#tpr17e", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "Fail to override protected terms with type. (error mode)", + "purpose": "Fail to override protected terms with type. (error mode)", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr17-in.jsonld", + "expect": "invalid context nullification" + }, { + "@id": "#tpr17w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Fail to override protected terms with type. (warn mode)", + "purpose": "Fail to override protected terms with type. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr17-in.jsonld", + "expect": "expand/pr17-out.jsonld" + }, { + "@id": "#tpr18e", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "Fail to override protected terms with type+null+ctx. (error mode)", + "purpose": "Fail to override protected terms with type+null+ctx. (error mode)", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr18-in.jsonld", "expect": "invalid context nullification" + }, { + "@id": "#tpr18w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Fail to override protected terms with type+null+ctx. (warn mode)", + "purpose": "Fail to override protected terms with type+null+ctx. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr18-in.jsonld", + "expect": "expand/pr18-out.jsonld" + }, { + "@id": "#tpr19", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Mix of protected and unprotected terms.", + "purpose": "Mix of protected and unprotected terms.", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr19-in.jsonld", + "expect": "expand/pr19-out.jsonld" + }, { + "@id": "#tpr20e", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "Fail with mix of protected and unprotected terms with type+null+ctx. (error mode)", + "purpose": "Fail with mix of protected and unprotected terms with type+null+ctx. (error mode)", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr20-in.jsonld", + "expect": "invalid context nullification" + }, { + "@id": "#tpr20w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Fail with mix of protected and unprotected terms with type+null+ctx. (warn mode)", + "purpose": "Fail with mix of protected and unprotected terms with type+null+ctx. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr20-in.jsonld", + "expect": "expand/pr20-out.jsonld" + }, { + "@id": "#tpr21e", + "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], + "name": "Fail with mix of protected and unprotected terms with type+null. (error mode)", + "purpose": "Fail with mix of protected and unprotected terms with type+null. (error mode)", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr21-in.jsonld", + "expect": "invalid context nullification" + }, { + "@id": "#tpr21w", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Fail with mix of protected and unprotected terms with type+null. (warn mode)", + "purpose": "Fail with mix of protected and unprotected terms with type+null. (warn mode)", + "option": {"specVersion": "json-ld-1.1", "protectedMode": "warn"}, + "input": "expand/pr21-in.jsonld", + "expect": "expand/pr21-out.jsonld" }, { "@id": "#ttn01", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], diff --git a/tests/expand/pr01-in.jsonld b/tests/expand/pr01-in.jsonld index 5f688056..049d4cf6 100644 --- a/tests/expand/pr01-in.jsonld +++ b/tests/expand/pr01-in.jsonld @@ -2,10 +2,14 @@ "@context": { "@vocab": "http://example.com/", "@version": 1.1, - "protected": {"@protected": true} + "protected": { + "@protected": true + } }, "protected": { - "@context": {"protected": "http://example.com/something-else"}, - "protected": "this should have the property http://example.com/protected" + "@context": { + "protected": "http://example.com/something-else" + }, + "protected": "error / property http://example.com/protected" } } diff --git a/tests/expand/pr01-out.jsonld b/tests/expand/pr01-out.jsonld index c25e0875..976b0e69 100644 --- a/tests/expand/pr01-out.jsonld +++ b/tests/expand/pr01-out.jsonld @@ -1,7 +1,7 @@ [ { "http://example.com/protected": [{ - "http://example.com/protected": [{"@value": "this should have the property http://example.com/protected"}] + "http://example.com/protected": [{"@value": "error / property http://example.com/protected"}] }] } ] diff --git a/tests/expand/pr02-in.jsonld b/tests/expand/pr02-in.jsonld index 616db002..22fe4a86 100644 --- a/tests/expand/pr02-in.jsonld +++ b/tests/expand/pr02-in.jsonld @@ -2,13 +2,19 @@ "@context": { "@vocab": "http://example.com/", "@version": 1.1, - "protected": {"@protected": true}, - "unprotected": {"@protected": false} + "protected": { + "@protected": true + }, + "unprotected": { + "@protected": false + } }, "protected": true, "unprotected": true, "scope": { - "@context": {"unprotected": "http://example.com/something-else"}, - "unprotected": "this should have the property http://example.com/something-else" + "@context": { + "unprotected": "http://example.com/something-else" + }, + "unprotected": "property http://example.com/something-else" } } diff --git a/tests/expand/pr02-out.jsonld b/tests/expand/pr02-out.jsonld index c655f783..bb498495 100644 --- a/tests/expand/pr02-out.jsonld +++ b/tests/expand/pr02-out.jsonld @@ -3,7 +3,7 @@ "http://example.com/protected": [{"@value": true}], "http://example.com/unprotected": [{"@value": true}], "http://example.com/scope": [{ - "http://example.com/something-else": [{"@value": "this should have the property http://example.com/something-else"}] + "http://example.com/something-else": [{"@value": "property http://example.com/something-else"}] }] } ] diff --git a/tests/expand/pr03-in.jsonld b/tests/expand/pr03-in.jsonld index 05b2b233..c0a8aa2a 100644 --- a/tests/expand/pr03-in.jsonld +++ b/tests/expand/pr03-in.jsonld @@ -3,15 +3,19 @@ "@vocab": "http://example.com/", "@version": 1.1, "@protected": true, - "protected1": {"@id": "http://example.com/protected1"}, - "protected2": {"@id": "http://example.com/protected2"} + "protected1": { + "@id": "http://example.com/protected1" + }, + "protected2": { + "@id": "http://example.com/protected2" + } }, "protected1": { "@context": { "protected1": "http://example.com/something-else", "protected2": "http://example.com/something-else" }, - "protected1": "this should have the property http://example.com/protected1", - "protected2": "this should have the property http://example.com/protected2" + "protected1": "error / property http://example.com/protected1", + "protected2": "error / property http://example.com/protected2" } } diff --git a/tests/expand/pr03-out.jsonld b/tests/expand/pr03-out.jsonld index 45accb5e..e7bd0479 100644 --- a/tests/expand/pr03-out.jsonld +++ b/tests/expand/pr03-out.jsonld @@ -1,8 +1,8 @@ [ { "http://example.com/protected1": [{ - "http://example.com/protected1": [{"@value": "this should have the property http://example.com/protected1"}], - "http://example.com/protected2": [{"@value": "this should have the property http://example.com/protected2"}] + "http://example.com/protected1": [{"@value": "error / property http://example.com/protected1"}], + "http://example.com/protected2": [{"@value": "error / property http://example.com/protected2"}] }] } ] diff --git a/tests/expand/pr04-in.jsonld b/tests/expand/pr04-in.jsonld index 09c1a62b..5adc5228 100644 --- a/tests/expand/pr04-in.jsonld +++ b/tests/expand/pr04-in.jsonld @@ -3,15 +3,19 @@ "@vocab": "http://example.com/", "@version": 1.1, "@protected": true, - "protected": {"@id": "http://example.com/protected"}, - "unprotected": {"@id": "http://example.com/unprotected", "@protected": false} + "protected": { + "@id": "http://example.com/protected" + }, + "unprotected": { + "@id": "http://example.com/unprotected", "@protected": false + } }, "protected": { "@context": { "protected": "http://example.com/something-else1", "unprotected": "http://example.com/something-else2" }, - "protected": "this should have the property http://example.com/protected", - "unprotected": "this should have the property http://example.com/something-else2" + "protected": "error / property http://example.com/protected", + "unprotected": "property http://example.com/something-else2" } } diff --git a/tests/expand/pr04-out.jsonld b/tests/expand/pr04-out.jsonld index 753c50b5..9d86db31 100644 --- a/tests/expand/pr04-out.jsonld +++ b/tests/expand/pr04-out.jsonld @@ -1,8 +1,8 @@ [ { "http://example.com/protected": [{ - "http://example.com/protected": [{"@value": "this should have the property http://example.com/protected"}], - "http://example.com/something-else2": [{"@value": "this should have the property http://example.com/something-else2"}] + "http://example.com/protected": [{"@value": "error / property http://example.com/protected"}], + "http://example.com/something-else2": [{"@value": "property http://example.com/something-else2"}] }] } ] diff --git a/tests/expand/pr05-in.jsonld b/tests/expand/pr05-in.jsonld index a1cf6c47..a7ccf05d 100644 --- a/tests/expand/pr05-in.jsonld +++ b/tests/expand/pr05-in.jsonld @@ -6,7 +6,12 @@ "protected": {"@language": null} }, "protected": { - "@context": [null, {"@vocab": "http://something-else/"}], - "protected": "this should have the property http://something-else/protected" + "@context": [ + null, + { + "@vocab": "http://something-else/" + } + ], + "protected": "error / property http://example.com/protected" } } diff --git a/tests/expand/pr05-out.jsonld b/tests/expand/pr05-out.jsonld index 97d3fee6..976b0e69 100644 --- a/tests/expand/pr05-out.jsonld +++ b/tests/expand/pr05-out.jsonld @@ -1,7 +1,7 @@ [ { "http://example.com/protected": [{ - "http://something-else/protected": [{"@value": "this should have the property http://something-else/protected"}] + "http://example.com/protected": [{"@value": "error / property http://example.com/protected"}] }] } ] diff --git a/tests/expand/pr06-in.jsonld b/tests/expand/pr06-in.jsonld index 1b525889..df894594 100644 --- a/tests/expand/pr06-in.jsonld +++ b/tests/expand/pr06-in.jsonld @@ -3,8 +3,13 @@ "@vocab": "http://example.com/", "@version": 1.1, "@protected": true, - "protected": {"@type": "@id"}, - "unprotected": {"@protected": false, "@context": null} + "protected": { + "@type": "@id" + }, + "unprotected": { + "@protected": false, + "@context": null + } }, "unprotected": { "protected": "not expanded, as protected is not a defined term" diff --git a/tests/expand/pr08-in.jsonld b/tests/expand/pr08-in.jsonld index c798a435..357c5cee 100644 --- a/tests/expand/pr08-in.jsonld +++ b/tests/expand/pr08-in.jsonld @@ -2,23 +2,37 @@ "@context": { "@vocab": "http://example.com/", "@version": 1.1, - "protected": {"@protected": false}, + "protected": { + "@protected": false + }, "scope1": { "@protected": false, - "@context": {"protected": {"@id": "http://example.com/something-else"}} + "@context": { + "protected": { + "@id": "http://example.com/something-else" + } + } }, "scope2": { "@protected": true, - "@context": {"protected": {"@protected": true}} + "@context": { + "protected": { + "@protected": true + } + } } }, "protected": false, "scope1": { - "@context": {"protected": "http://example.com/another-thing"}, - "protected": "this should have the property http://example.com/another-thing" + "@context": { + "protected": "http://example.com/another-thing" + }, + "protected": "property http://example.com/another-thing" }, "scope2": { - "@context": {"protected": "http://example.com/another-thing"}, - "protected": "this should have the property http://example.com/protected" + "@context": { + "protected": "http://example.com/another-thing" + }, + "protected": "error / property http://example.com/protected" } } diff --git a/tests/expand/pr08-out.jsonld b/tests/expand/pr08-out.jsonld index 8ec78391..073ee72f 100644 --- a/tests/expand/pr08-out.jsonld +++ b/tests/expand/pr08-out.jsonld @@ -2,10 +2,10 @@ { "http://example.com/protected": [{"@value": false}], "http://example.com/scope1": [{ - "http://example.com/another-thing": [{"@value": "this should have the property http://example.com/another-thing"}] + "http://example.com/another-thing": [{"@value": "property http://example.com/another-thing"}] }], "http://example.com/scope2": [{ - "http://example.com/protected": [{"@value": "this should have the property http://example.com/protected"}] + "http://example.com/protected": [{"@value": "error / property http://example.com/protected"}] }] } ] diff --git a/tests/expand/pr09-in.jsonld b/tests/expand/pr09-in.jsonld index d7c5c0b5..29895ff3 100644 --- a/tests/expand/pr09-in.jsonld +++ b/tests/expand/pr09-in.jsonld @@ -6,7 +6,9 @@ "protected2": "http://example.org/protected2" }, "protected2": { - "@context": {"protected1": "http://example.com/something-else"}, - "protected1": "this should have the property http://example.org/protected1" + "@context": { + "protected1": "http://example.org/something-else" + }, + "protected1": "error / property http://example.org/protected1" } } diff --git a/tests/expand/pr09-out.jsonld b/tests/expand/pr09-out.jsonld index 89dc604d..72cda458 100644 --- a/tests/expand/pr09-out.jsonld +++ b/tests/expand/pr09-out.jsonld @@ -1,7 +1,7 @@ [{ "http://example.org/protected2": [{ "http://example.org/protected1": [{ - "@value": "this should have the property http://example.org/protected1" + "@value": "error / property http://example.org/protected1" }] }] }] diff --git a/tests/expand/pr11-out.jsonld b/tests/expand/pr11-out.jsonld index fe51488c..3f10151e 100644 --- a/tests/expand/pr11-out.jsonld +++ b/tests/expand/pr11-out.jsonld @@ -1 +1,18 @@ -[] +[ + { + "ex:protected": [ + { + "@value": "p === ex:protected" + } + ], + "ex:unprotected": [ + { + "ex:protected": [ + { + "@value": "p === ex:protected" + } + ] + } + ] + } +] diff --git a/tests/expand/pr12-in.jsonld b/tests/expand/pr12-in.jsonld index c4af2629..2dc30da6 100644 --- a/tests/expand/pr12-in.jsonld +++ b/tests/expand/pr12-in.jsonld @@ -5,11 +5,11 @@ "protected1": "ex:protected1", "protected2": "ex:protected2" }, - "protected1": "p1", + "protected1": "p === ex:protected1", "protected2": { "@context": { "protected1": "ex:protected1:error" }, - "protected1": "p1error" + "protected1": "error / p === ex:protected1" } } diff --git a/tests/expand/pr12-out.jsonld b/tests/expand/pr12-out.jsonld index fe51488c..97887460 100644 --- a/tests/expand/pr12-out.jsonld +++ b/tests/expand/pr12-out.jsonld @@ -1 +1,18 @@ -[] +[ + { + "ex:protected1": [ + { + "@value": "p === ex:protected1" + } + ], + "ex:protected2": [ + { + "ex:protected1": [ + { + "@value": "error / p === ex:protected1" + } + ] + } + ] + } +] diff --git a/tests/expand/pr14-in.jsonld b/tests/expand/pr14-in.jsonld index a3a1caf3..e88b9ef2 100644 --- a/tests/expand/pr14-in.jsonld +++ b/tests/expand/pr14-in.jsonld @@ -5,14 +5,14 @@ "protected1": "ex:protected1", "protected2": { "@id": "ex:protected2", - "@context": [null] + "@context": null } }, "protected1": "p === ex:protected1", "protected2": { "@context": { - "protected": "ex:protected3" + "protected1": "ex:protected3" }, - "protected": "p === ex:protected3" + "protected1": "p === ex:protected3" } } diff --git a/tests/expand/pr15-in.jsonld b/tests/expand/pr15-in.jsonld index 196da8bd..d0cf99b1 100644 --- a/tests/expand/pr15-in.jsonld +++ b/tests/expand/pr15-in.jsonld @@ -3,20 +3,18 @@ "@version": 1.1, "@protected": true, "protected1": "ex:protected1", - "protected2": "ex:protected2", - "Protected": { - "@id": "ex:Protected", + "protected2": { + "@id": "ex:protected2", "@context": [ null ] } }, - "protected1": "p === protected1", + "protected1": "p === ex:protected1", "protected2": { - "@type": "Protected", "@context": { - "protected": "ex:protected3" + "protected1": "ex:protected3" }, - "protected": "error" + "protected1": "p === ex:protected3" } } diff --git a/tests/expand/pr15-out.jsonld b/tests/expand/pr15-out.jsonld index fe51488c..52c399e9 100644 --- a/tests/expand/pr15-out.jsonld +++ b/tests/expand/pr15-out.jsonld @@ -1 +1,18 @@ -[] +[ + { + "ex:protected1": [ + { + "@value": "p === ex:protected1" + } + ], + "ex:protected2": [ + { + "ex:protected3": [ + { + "@value": "p === ex:protected3" + } + ] + } + ] + } +] diff --git a/tests/expand/pr16-in.jsonld b/tests/expand/pr16-in.jsonld index 0f7571ae..61946e01 100644 --- a/tests/expand/pr16-in.jsonld +++ b/tests/expand/pr16-in.jsonld @@ -3,17 +3,28 @@ "@version": 1.1, "@protected": true, "protected1": "ex:protected1", - "protected2": "ex:protected2", - "Protected": { - "@id": "ex:Protected", + "protected2": { + "@id": "ex:protected2", "@context": [ null, { - "protected": "ex:protected3" + "protected1": "ex:protected3", + "unprotected": "ex:unprotected2" } ] + }, + "unprotected": { + "@protected": false, + "@id": "ex:unprotected1" } }, - "@type": "Protected", - "protected": "error" + "protected1": "p === ex:protected1", + "protected2": { + "@context": { + "protected1": "ex:protected3" + }, + "protected1": "p === ex:protected3", + "unprotected": "p === ex:unprotected2" + }, + "unprotected": "p === ex:unprotected1" } diff --git a/tests/expand/pr16-out.jsonld b/tests/expand/pr16-out.jsonld index fe51488c..264b8360 100644 --- a/tests/expand/pr16-out.jsonld +++ b/tests/expand/pr16-out.jsonld @@ -1 +1,28 @@ -[] +[ + { + "ex:protected1": [ + { + "@value": "p === ex:protected1" + } + ], + "ex:protected2": [ + { + "ex:protected3": [ + { + "@value": "p === ex:protected3" + } + ], + "ex:unprotected2": [ + { + "@value": "p === ex:unprotected2" + } + ] + } + ], + "ex:unprotected1": [ + { + "@value": "p === ex:unprotected1" + } + ] + } +] diff --git a/tests/expand/pr17-in.jsonld b/tests/expand/pr17-in.jsonld new file mode 100644 index 00000000..e2300354 --- /dev/null +++ b/tests/expand/pr17-in.jsonld @@ -0,0 +1,22 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "protected1": "ex:protected1", + "protected2": "ex:protected2", + "Protected": { + "@id": "ex:Protected", + "@context": [ + null + ] + } + }, + "protected1": "p === protected1", + "protected2": { + "@context": { + "unprotected": "ex:unprotected" + }, + "@type": "Protected", + "unprotected": "error / omitted" + } +} diff --git a/tests/expand/pr17-out.jsonld b/tests/expand/pr17-out.jsonld new file mode 100644 index 00000000..8e360b73 --- /dev/null +++ b/tests/expand/pr17-out.jsonld @@ -0,0 +1,16 @@ +[ + { + "ex:protected1": [ + { + "@value": "p === protected1" + } + ], + "ex:protected2": [ + { + "@type": [ + "ex:Protected" + ] + } + ] + } +] diff --git a/tests/expand/pr18-in.jsonld b/tests/expand/pr18-in.jsonld new file mode 100644 index 00000000..a6648cd6 --- /dev/null +++ b/tests/expand/pr18-in.jsonld @@ -0,0 +1,18 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "protected": "ex:protected1", + "Protected": { + "@id": "ex:Protected", + "@context": [ + null, + { + "protected": "ex:protected2" + } + ] + } + }, + "@type": "Protected", + "protected": "error / p === ex:protected1" +} diff --git a/tests/expand/pr18-out.jsonld b/tests/expand/pr18-out.jsonld new file mode 100644 index 00000000..b293d4cb --- /dev/null +++ b/tests/expand/pr18-out.jsonld @@ -0,0 +1,12 @@ +[ + { + "@type": [ + "ex:Protected" + ], + "ex:protected1": [ + { + "@value": "error / p === ex:protected1" + } + ] + } +] diff --git a/tests/expand/pr19-in.jsonld b/tests/expand/pr19-in.jsonld new file mode 100644 index 00000000..e418cb12 --- /dev/null +++ b/tests/expand/pr19-in.jsonld @@ -0,0 +1,29 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "protected1": "ex:protected1", + "protected2": { + "@id": "ex:protected2", + "@context": [ + null, + { + "protected1": "ex:protected3" + } + ] + }, + "unprotected": { + "@protected": false, + "@id": "ex:unprotected1" + } + }, + "protected1": "p === ex:protected1", + "protected2": { + "@context": { + "protected1": "ex:protected3" + }, + "protected1": "p === ex:protected3", + "unprotected": "p === ex:unprotected2" + }, + "unprotected": "p === ex:unprotected1" +} diff --git a/tests/expand/pr19-out.jsonld b/tests/expand/pr19-out.jsonld new file mode 100644 index 00000000..0bca9e1b --- /dev/null +++ b/tests/expand/pr19-out.jsonld @@ -0,0 +1,23 @@ +[ + { + "ex:protected1": [ + { + "@value": "p === ex:protected1" + } + ], + "ex:protected2": [ + { + "ex:protected3": [ + { + "@value": "p === ex:protected3" + } + ] + } + ], + "ex:unprotected1": [ + { + "@value": "p === ex:unprotected1" + } + ] + } +] diff --git a/tests/expand/pr20-in.jsonld b/tests/expand/pr20-in.jsonld new file mode 100644 index 00000000..69edf670 --- /dev/null +++ b/tests/expand/pr20-in.jsonld @@ -0,0 +1,24 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "protected1": "ex:protected1", + "Protected": { + "@id": "ex:Protected", + "@context": [ + null, + { + "protected1": "ex:protected2", + "unprotected": "ex:unprotected2" + } + ] + }, + "unprotected": { + "@protected": false, + "@id": "ex:unprotected1" + } + }, + "@type": "Protected", + "protected1": "error / p === ex:protected1", + "unprotected": "p === ex:unprotected2" +} diff --git a/tests/expand/pr20-out.jsonld b/tests/expand/pr20-out.jsonld new file mode 100644 index 00000000..f07108db --- /dev/null +++ b/tests/expand/pr20-out.jsonld @@ -0,0 +1,17 @@ +[ + { + "@type": [ + "ex:Protected" + ], + "ex:protected1": [ + { + "@value": "error / p === ex:protected1" + } + ], + "ex:unprotected2": [ + { + "@value": "p === ex:unprotected2" + } + ] + } +] diff --git a/tests/expand/pr21-in.jsonld b/tests/expand/pr21-in.jsonld new file mode 100644 index 00000000..3be7f54f --- /dev/null +++ b/tests/expand/pr21-in.jsonld @@ -0,0 +1,20 @@ +{ + "@context": { + "@version": 1.1, + "@protected": true, + "protected": "ex:protected", + "Protected": { + "@id": "ex:Protected", + "@context": [ + null + ] + }, + "unprotected": { + "@protected": false, + "@id": "ex:unprotected" + } + }, + "@type": "Protected", + "protected": "error / p === ex:protected", + "unprotected": "missing" +} diff --git a/tests/expand/pr21-out.jsonld b/tests/expand/pr21-out.jsonld new file mode 100644 index 00000000..77f8e6fe --- /dev/null +++ b/tests/expand/pr21-out.jsonld @@ -0,0 +1,12 @@ +[ + { + "@type": [ + "ex:Protected" + ], + "ex:protected": [ + { + "@value": "error / p === ex:protected" + } + ] + } +]