From fb6d5945cbb7af7d323d1e4ce7a78155642ad017 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 29 Jul 2024 15:05:56 -0700 Subject: [PATCH 1/2] Add compaction to @type map when the compacted item is not already a map. From ruby-rdf/json-ld#62. --- tests/compact-manifest.jsonld | 9 +++++++++ tests/compact/m023-context.jsonld | 9 +++++++++ tests/compact/m023-in.jsonld | 9 +++++++++ tests/compact/m023-out.jsonld | 13 +++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 tests/compact/m023-context.jsonld create mode 100644 tests/compact/m023-in.jsonld create mode 100644 tests/compact/m023-out.jsonld diff --git a/tests/compact-manifest.jsonld b/tests/compact-manifest.jsonld index 0743df70..394a7ee2 100644 --- a/tests/compact-manifest.jsonld +++ b/tests/compact-manifest.jsonld @@ -1800,6 +1800,15 @@ "context": "compact/m022-context.jsonld", "expect": "compact/m022-out.jsonld", "option": {"specVersion": "json-ld-1.1"} + }, { + "@id": "#tm023", + "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], + "name": "compact IRI with container: @type", + "purpose": "Uses @none when compacted item is an IRI string", + "input": "compact/m023-in.jsonld", + "context": "compact/m023-context.jsonld", + "expect": "compact/m023-out.jsonld", + "option": {"specVersion": "json-ld-1.1"} }, { "@id": "#tn001", "@type": ["jld:PositiveEvaluationTest", "jld:CompactTest"], diff --git a/tests/compact/m023-context.jsonld b/tests/compact/m023-context.jsonld new file mode 100644 index 00000000..ed57cde2 --- /dev/null +++ b/tests/compact/m023-context.jsonld @@ -0,0 +1,9 @@ +{ + "@context": { + "@vocab": "http://schema.org/", + "location": { + "@type": "@id", + "@container": "@type" + } + } +} diff --git a/tests/compact/m023-in.jsonld b/tests/compact/m023-in.jsonld new file mode 100644 index 00000000..22375132 --- /dev/null +++ b/tests/compact/m023-in.jsonld @@ -0,0 +1,9 @@ +{ + "@context": { + "@vocab": "http://schema.org/" + }, + "@type": "Event", + "location": { + "@id": "http://kg.artsdata.ca/resource/K11-200" + } +} diff --git a/tests/compact/m023-out.jsonld b/tests/compact/m023-out.jsonld new file mode 100644 index 00000000..fdd09514 --- /dev/null +++ b/tests/compact/m023-out.jsonld @@ -0,0 +1,13 @@ +{ + "@context": { + "@vocab": "http://schema.org/", + "location": { + "@type": "@id", + "@container": "@type" + } + }, + "@type": "Event", + "location": { + "@none": "http://kg.artsdata.ca/resource/K11-200" + } +} From 4b66ee3b7750668f2cdf4b8d9119c35477a16b88 Mon Sep 17 00:00:00 2001 From: gkellogg Date: Mon, 29 Jul 2024 22:09:28 +0000 Subject: [PATCH 2/2] Automated report generation --- tests/compact-manifest.html | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/compact-manifest.html b/tests/compact-manifest.html index 6e453394..eeceee46 100644 --- a/tests/compact-manifest.html +++ b/tests/compact-manifest.html @@ -6206,6 +6206,38 @@

+
+ Test tm023 compact IRI with container: @type +
+
+
+
id
+
#tm023
+
Type
+
jld:PositiveEvaluationTest, jld:CompactTest
+
Purpose
+
Uses @none when compacted item is an IRI string
+
input
+
+ compact/m023-in.jsonld +
+
context
+
+ compact/m023-context.jsonld +
+
expect
+
+ compact/m023-out.jsonld +
+
Options
+
+
+
specVersion
+
json-ld-1.1
+
+
+
+
Test tn001 Indexes to @nest for property with @nest