From 385d1015a642d453f082e4243c1ed1e1a58f60e4 Mon Sep 17 00:00:00 2001 From: "David I. Lehn" Date: Tue, 5 Dec 2023 22:44:35 -0500 Subject: [PATCH 1/3] Add graph container null context protection test. --- tests/expand-manifest.jsonld | 8 ++++++++ tests/expand/pr43-in.jsonld | 23 +++++++++++++++++++++++ tests/expand/pr43-out.jsonld | 19 +++++++++++++++++++ tests/toRdf-manifest.jsonld | 8 ++++++++ tests/toRdf/pr43-in.jsonld | 23 +++++++++++++++++++++++ tests/toRdf/pr43-out.nq | 2 ++ 6 files changed, 83 insertions(+) create mode 100644 tests/expand/pr43-in.jsonld create mode 100644 tests/expand/pr43-out.jsonld create mode 100644 tests/toRdf/pr43-in.jsonld create mode 100644 tests/toRdf/pr43-out.nq diff --git a/tests/expand-manifest.jsonld b/tests/expand-manifest.jsonld index 04bc779d..12cb3993 100644 --- a/tests/expand-manifest.jsonld +++ b/tests/expand-manifest.jsonld @@ -2858,6 +2858,14 @@ "option": {"specVersion": "json-ld-1.1"}, "input": "expand/pr42-in.jsonld", "expectErrorCode": "protected term redefinition" + }, { + "@id": "#tpr43", + "@type": ["jld:PositiveEvaluationTest", "jld:ExpandTest"], + "name": "Clear protection in @graph @container with null context.", + "purpose": "Clear protection in @graph @container with null context.", + "option": {"specVersion": "json-ld-1.1"}, + "input": "expand/pr43-in.jsonld", + "expect": "expand/pr43-out.jsonld" }, { "@id": "#tso01", "@type": ["jld:NegativeEvaluationTest", "jld:ExpandTest"], diff --git a/tests/expand/pr43-in.jsonld b/tests/expand/pr43-in.jsonld new file mode 100644 index 00000000..aafbb4d7 --- /dev/null +++ b/tests/expand/pr43-in.jsonld @@ -0,0 +1,23 @@ +{ + "@context": { + "@protected": true, + "protected": { + "@id": "ex:protected1", + "@type": "@id" + }, + "unprotected": { + "@id": "ex:unprotected", + "@type": "@id", + "@container": "@graph", + "@context": null + } + }, + "@id": "ex:outer", + "unprotected": { + "@context": { + "protected": "ex:protected2" + }, + "@id": "ex:inner", + "protected": "p === ex:protected2" + } +} diff --git a/tests/expand/pr43-out.jsonld b/tests/expand/pr43-out.jsonld new file mode 100644 index 00000000..a11925d4 --- /dev/null +++ b/tests/expand/pr43-out.jsonld @@ -0,0 +1,19 @@ +[ + { + "@id": "ex:outer", + "ex:unprotected": [ + { + "@graph": [ + { + "@id": "ex:inner", + "ex:protected2": [ + { + "@value": "p === ex:protected2" + } + ] + } + ] + } + ] + } +] diff --git a/tests/toRdf-manifest.jsonld b/tests/toRdf-manifest.jsonld index 75639689..1d2c9267 100644 --- a/tests/toRdf-manifest.jsonld +++ b/tests/toRdf-manifest.jsonld @@ -3387,6 +3387,14 @@ "option": {"specVersion": "json-ld-1.1"}, "input": "toRdf/pr42-in.jsonld", "expectErrorCode": "protected term redefinition" + }, { + "@id": "#tpr43", + "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], + "name": "Clear protection in @graph @container with null context.", + "purpose": "Clear protection in @graph @container with null context.", + "option": {"specVersion": "json-ld-1.1"}, + "input": "toRdf/pr43-in.jsonld", + "expect": "toRdf/pr43-out.nq" }, { "@id": "#trt01", "@type": ["jld:PositiveEvaluationTest", "jld:ToRDFTest"], diff --git a/tests/toRdf/pr43-in.jsonld b/tests/toRdf/pr43-in.jsonld new file mode 100644 index 00000000..aafbb4d7 --- /dev/null +++ b/tests/toRdf/pr43-in.jsonld @@ -0,0 +1,23 @@ +{ + "@context": { + "@protected": true, + "protected": { + "@id": "ex:protected1", + "@type": "@id" + }, + "unprotected": { + "@id": "ex:unprotected", + "@type": "@id", + "@container": "@graph", + "@context": null + } + }, + "@id": "ex:outer", + "unprotected": { + "@context": { + "protected": "ex:protected2" + }, + "@id": "ex:inner", + "protected": "p === ex:protected2" + } +} diff --git a/tests/toRdf/pr43-out.nq b/tests/toRdf/pr43-out.nq new file mode 100644 index 00000000..d4788bca --- /dev/null +++ b/tests/toRdf/pr43-out.nq @@ -0,0 +1,2 @@ + _:b0 . + "p === ex:protected2" _:b0 . From 1bd3e2322156b220ebcf35bf5bdc5bdc5255f725 Mon Sep 17 00:00:00 2001 From: davidlehn Date: Fri, 8 Mar 2024 04:44:31 +0000 Subject: [PATCH 2/3] Automated report generation --- tests/expand-manifest.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/expand-manifest.html b/tests/expand-manifest.html index 58c5ac2b..85a273e9 100644 --- a/tests/expand-manifest.html +++ b/tests/expand-manifest.html @@ -9643,6 +9643,34 @@

+
+ Test tpr43 Clear protection in @graph @container with null context. +
+
+
+
id
+
#tpr43
+
Type
+
jld:PositiveEvaluationTest, jld:ExpandTest
+
Purpose
+
Clear protection in @graph @container with null context.
+
input
+
+ expand/pr43-in.jsonld +
+
expect
+
+ expand/pr43-out.jsonld +
+
Options
+
+
+
specVersion
+
json-ld-1.1
+
+
+
+
Test tso01 @import is invalid in 1.0.
From 95b3199b3634552ec9eccb45db516e2cfb4764a8 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Fri, 29 Mar 2024 12:03:14 -0700 Subject: [PATCH 3/3] Build toRdf-manifest.html manually. --- tests/toRdf-manifest.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/toRdf-manifest.html b/tests/toRdf-manifest.html index 7dd09f0a..717096ab 100644 --- a/tests/toRdf-manifest.html +++ b/tests/toRdf-manifest.html @@ -11342,6 +11342,34 @@

+
+ Test tpr43 Clear protection in @graph @container with null context. +
+
+
+
id
+
#tpr43
+
Type
+
jld:PositiveEvaluationTest, jld:ToRDFTest
+
Purpose
+
Clear protection in @graph @container with null context.
+
input
+
+ toRdf/pr43-in.jsonld +
+
expect
+
+ toRdf/pr43-out.nq +
+
Options
+
+
+
specVersion
+
json-ld-1.1
+
+
+
+
Test trt01 Representing numbers >= 1e21