From 54fb004b21d3f3011b0ea572b5ceab0b8b1d9fee Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Mon, 27 May 2024 15:31:45 +0200 Subject: [PATCH 1/4] Refactored file reading from absolute to relative path --- .../services/GenerativeExplanationsService.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/wse/qanaryexplanationservice/services/GenerativeExplanationsService.java b/src/main/java/com/wse/qanaryexplanationservice/services/GenerativeExplanationsService.java index d379687..b282971 100644 --- a/src/main/java/com/wse/qanaryexplanationservice/services/GenerativeExplanationsService.java +++ b/src/main/java/com/wse/qanaryexplanationservice/services/GenerativeExplanationsService.java @@ -12,17 +12,15 @@ import com.wse.qanaryexplanationservice.helper.pojos.InputQueryExample; import com.wse.qanaryexplanationservice.helper.pojos.QanaryComponent; import com.wse.qanaryexplanationservice.repositories.GenerativeExplanationsRepository; +import eu.wdaqua.qanary.commons.triplestoreconnectors.QanaryTripleStoreConnector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Lazy; -import org.springframework.core.io.ClassPathResource; import org.springframework.stereotype.Service; -import java.io.File; import java.io.IOException; -import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -175,8 +173,9 @@ public String createPrompt(int shots, GenerativeExplanationObject generativeExpl } public String getStringFromFile(String path) throws IOException { - File file = new ClassPathResource(path).getFile(); - return new String(Files.readAllBytes(file.toPath())); + return QanaryTripleStoreConnector.readFileFromResources(path); + // File file = new ClassPathResource(path).getFile(); + // return new String(Files.readAllBytes(file.toPath())); } public String sendPrompt(String prompt, GptModel gptModel) throws Exception { From c4a0a2b6e9b57756946a3b80ac571bc6b8541358 Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Mon, 27 May 2024 15:32:39 +0200 Subject: [PATCH 2/4] v3.3.0 -> v3.3.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0a16484..d1dd382 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.wse qanary-explanation-service - 3.3.0 + 3.3.1 Qanary explanation service Webservice for rule-based explanation of QA-Systems as well as specific components From e21437ee1327fbac2580e10a1d01f13bb3ae5343 Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Mon, 27 May 2024 15:33:18 +0200 Subject: [PATCH 3/4] Removed comments --- .../services/GenerativeExplanationsService.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/wse/qanaryexplanationservice/services/GenerativeExplanationsService.java b/src/main/java/com/wse/qanaryexplanationservice/services/GenerativeExplanationsService.java index b282971..45dbeba 100644 --- a/src/main/java/com/wse/qanaryexplanationservice/services/GenerativeExplanationsService.java +++ b/src/main/java/com/wse/qanaryexplanationservice/services/GenerativeExplanationsService.java @@ -174,8 +174,6 @@ public String createPrompt(int shots, GenerativeExplanationObject generativeExpl public String getStringFromFile(String path) throws IOException { return QanaryTripleStoreConnector.readFileFromResources(path); - // File file = new ClassPathResource(path).getFile(); - // return new String(Files.readAllBytes(file.toPath())); } public String sendPrompt(String prompt, GptModel gptModel) throws Exception { From 9366e286cb2999a87d9cd3dc9d7822cd36947ab1 Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Mon, 27 May 2024 15:35:53 +0200 Subject: [PATCH 4/4] Removed http protocol from QANARY_PIPELINE_HOST env var --- service_config/files/.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service_config/files/.env b/service_config/files/.env index 23fad5f..9a1ff43 100644 --- a/service_config/files/.env +++ b/service_config/files/.env @@ -1,5 +1,5 @@ SPARQL_ENDPOINT=http://demos.swe.htwk-leipzig.de:40111/sparql -QANARY_PIPELINE_HOST=http://demos.swe.htwk-leipzig.de +QANARY_PIPELINE_HOST=demos.swe.htwk-leipzig.de QANARY_PIPELINE_PORT=40111 VIRTUOSO_TRIPLESTORE_ENDPOINT=jdbc:virtuoso://demos.swe.htwk-leipzig.de:40142 VIRTUOSO_TRIPLESTORE_USERNAME=readWrite