From 9b037e95054d1f053e926ca8d7c67db8094c2a18 Mon Sep 17 00:00:00 2001 From: Barry Nouwt Date: Mon, 3 Feb 2025 15:54:20 +0100 Subject: [PATCH] Slightly adapt unit test to test additional scenario. This new unit test would have failed in version 1.2.4, but is fixed in version 1.3.0. The problem is an ASK graph pattern with two variables, while the ANSWER graph pattern has one of these variables filled in with a concrete value. This concrete value would not end up in the result, which is wrong. --- .../knowledge/engine/smartconnector/api/TestAskAnswer.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/smart-connector/src/test/java/eu/knowledge/engine/smartconnector/api/TestAskAnswer.java b/smart-connector/src/test/java/eu/knowledge/engine/smartconnector/api/TestAskAnswer.java index f36a4de27..669ed1c56 100644 --- a/smart-connector/src/test/java/eu/knowledge/engine/smartconnector/api/TestAskAnswer.java +++ b/smart-connector/src/test/java/eu/knowledge/engine/smartconnector/api/TestAskAnswer.java @@ -52,7 +52,7 @@ public void testAskAnswer() throws InterruptedException { LOG.info("Waiting for ready..."); - GraphPattern gp1 = new GraphPattern(prefixes, "?a ?c."); + GraphPattern gp1 = new GraphPattern(prefixes, "?a ."); CommunicativeAct act1 = new CommunicativeAct(new HashSet<>(Arrays.asList(Vocab.INFORM_PURPOSE)), new HashSet<>(Arrays.asList(Vocab.RETRIEVE_KNOWLEDGE_PURPOSE))); @@ -66,7 +66,6 @@ public void testAskAnswer() throws InterruptedException { BindingSet bindingSet = new BindingSet(); Binding binding = new Binding(); binding.put("a", ""); - binding.put("c", ""); bindingSet.add(binding); return bindingSet; @@ -103,8 +102,8 @@ public void testAskAnswer() throws InterruptedException { Binding b = iter.next(); assertTrue(!b.containsKey("a") && !b.containsKey("c"), - "The variable names should follow the graph pattern of the current KB."); - + "The variable names should follow the graph pattern of the requesting KB."); + assertEquals("", b.get("x"), "Binding of 'x' is incorrect."); assertEquals("", b.get("y"), "Binding of 'y' is incorrect.");