From cdf74ed4798d93187f599c6a42451a3ae084cd1f Mon Sep 17 00:00:00 2001 From: Filip Date: Wed, 2 Jun 2021 02:14:40 +0200 Subject: [PATCH] Fix frame expansion flag propagation (#172) --- .../com/apicatalog/jsonld/expansion/Expansion.java | 1 + .../jsonld/expansion/ObjectExpansion1314.java | 2 +- .../com/apicatalog/jsonld/test/manifest.json | 12 +++++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/apicatalog/jsonld/expansion/Expansion.java b/src/main/java/com/apicatalog/jsonld/expansion/Expansion.java index 140617d6..749fb5e0 100644 --- a/src/main/java/com/apicatalog/jsonld/expansion/Expansion.java +++ b/src/main/java/com/apicatalog/jsonld/expansion/Expansion.java @@ -89,6 +89,7 @@ public JsonValue compute() throws JsonLdError { return ArrayExpansion .with(activeContext, element.asJsonArray(), activeProperty, baseUrl) + .frameExpansion(frameExpansion) .expand(); } diff --git a/src/main/java/com/apicatalog/jsonld/expansion/ObjectExpansion1314.java b/src/main/java/com/apicatalog/jsonld/expansion/ObjectExpansion1314.java index ff7f3dbc..fcf7afb7 100644 --- a/src/main/java/com/apicatalog/jsonld/expansion/ObjectExpansion1314.java +++ b/src/main/java/com/apicatalog/jsonld/expansion/ObjectExpansion1314.java @@ -198,7 +198,7 @@ public void expand() throws JsonLdError { || value.asJsonArray().stream().anyMatch(JsonUtils::isNotString) ) ) { - throw new JsonLdError(JsonLdErrorCode.INVALID_KEYWORD_ID_VALUE); + throw new JsonLdError(JsonLdErrorCode.INVALID_KEYWORD_ID_VALUE, "An @id entry was encountered whose value [" + value + "] was not a string."); // 13.4.3.2 } else if (JsonUtils.isString(value)) { diff --git a/src/test/resources/com/apicatalog/jsonld/test/manifest.json b/src/test/resources/com/apicatalog/jsonld/test/manifest.json index 7c974cc1..77c3211c 100644 --- a/src/test/resources/com/apicatalog/jsonld/test/manifest.json +++ b/src/test/resources/com/apicatalog/jsonld/test/manifest.json @@ -96,8 +96,14 @@ "name": "ToRDF: document relative subject", "input": "issue145-in.json", "expect": "issue145-out.nq" - } - - + }, + { + "@id": "#t0012", + "@type": ["jld:PositiveEvaluationTest", "jld:FrameTest"], + "name": "Frame: @container: @id", + "input": "issue172-in.json", + "expect": "issue172-out.json", + "frame": "issue172-frame.json" + } ] }