From 74b1cb9d073f8aa54ef6db9e614361c41d91b0a4 Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Fri, 13 Oct 2023 22:28:46 +0200 Subject: [PATCH 1/9] Applied changes for SELECT-queries from automatedTestWorkflow-branch --- .../services/ExplanationService.java | 19 ++++++++++--------- .../annotation_of_answer_json/de_list_item | 2 +- .../annotation_of_answer_json/en_list_item | 2 +- .../annotation_of_answer_sparql/de_list_item | 2 +- .../annotation_of_answer_sparql/en_list_item | 2 +- .../annotation_of_instance/de_list_item | 2 +- .../annotation_of_instance/en_list_item | 2 +- .../de_list_item | 2 +- .../en_list_item | 2 +- .../de_list_item | 2 +- .../en_list_item | 2 +- .../annotation_of_relation/de_list_item | 2 +- .../annotation_of_relation/en_list_item | 2 +- .../annotation_of_spot_instance/de_list_item | 2 +- .../annotation_of_spot_instance/en_list_item | 2 +- .../queries/components_sparql_query.rq | 2 +- .../fetch_all_annotation_types.rq | 4 ++-- src/main/resources/queries/question_query.rq | 2 +- .../services/ServiceDataForTests.java | 19 ++++++------------- .../annotationofanswerjson/de_list_item | 2 +- .../annotationofanswerjson/en_list_item | 2 +- .../annotationofquestionlanguage/de_list_item | 2 +- .../annotationofquestionlanguage/en_list_item | 2 +- .../de_list_item | 2 +- .../en_list_item | 2 +- 25 files changed, 40 insertions(+), 46 deletions(-) diff --git a/src/main/java/com/wse/qanaryexplanationservice/services/ExplanationService.java b/src/main/java/com/wse/qanaryexplanationservice/services/ExplanationService.java index 37ed627..21b7c93 100644 --- a/src/main/java/com/wse/qanaryexplanationservice/services/ExplanationService.java +++ b/src/main/java/com/wse/qanaryexplanationservice/services/ExplanationService.java @@ -47,13 +47,13 @@ public class ExplanationService { // Holds request query for declared annotations types private static final Map annotationsTypeAndQuery = new HashMap<>() {{ // AnnotationOfInstance - put("annotationofspotinstance", "/queries/queries_for_annotation_types/annotations_of_spot_intance_query.rq"); - put("annotationofinstance", "/queries/queries_for_annotation_types/annotations_of_instance_query.rq"); - put("annotationofanswersparql", "/queries/queries_for_annotation_types/annotations_of_answer_sparql.rq"); - put("annotationofrelation", "/queries/queries_for_annotation_types/annotations_of_relation_query.rq"); - put("annotationofanswerjson", "/queries/queries_for_annotation_types/annotations_of_answer_json_query.rq"); - put("annotationofquestiontranslation", "/queries/queries_for_annotation_types/annotations_of_question_translation_query.rq"); - put("annotationofquestionlanguage", "/queries/queries_for_annotation_types/annotations_of_question_language_query.rq"); + put("annotationofspotinstance", "/queries/select_all_AnnotationOfSpotInstance.rq"); + put("annotationofinstance", "/queries/select_all_AnnotationOfInstance.rq"); + put("annotationofanswersparql", "/queries/select_all_AnnotationOfAnswerSPARQL.rq"); + put("annotationofrelation", "/queries/select_all_AnnotationOfRelation.rq"); + put("annotationofanswerjson", "/queries/select_all_AnnotationOfAnswerJson.rq"); + put("annotationofquestiontranslation", "/queries/select_all_AnnotationOfQuestionTranslation.rq"); + put("annotationofquestionlanguage", "/queries/select_all_AnnotationOfQuestionLanguage.rq"); }}; // Holds explanation templates for the declared annotation types private static final Map annotationTypeExplanationTemplate = new HashMap<>() {{ @@ -72,6 +72,7 @@ public class ExplanationService { private ExplanationSparqlRepository explanationSparqlRepository; @Autowired private AnnotationsService annotationsService; + public ExplanationService() { } @@ -185,9 +186,9 @@ public String convertToDesiredFormat(String header, Model model) { */ public String buildSparqlQuery(String graphURI, String componentUri, String rawQuery) throws IOException { QuerySolutionMap bindingsForSparqlQuery = new QuerySolutionMap(); - bindingsForSparqlQuery.add("graphURI", ResourceFactory.createResource(graphURI)); + bindingsForSparqlQuery.add("graph", ResourceFactory.createResource(graphURI)); if (componentUri != null) // Extension for compatibility w/ explanation for specific component - bindingsForSparqlQuery.add("componentURI", ResourceFactory.createResource(componentUri)); + bindingsForSparqlQuery.add("annotatedBy", ResourceFactory.createResource(componentUri)); return QanaryTripleStoreConnector.readFileFromResourcesWithMap(rawQuery, bindingsForSparqlQuery); diff --git a/src/main/resources/explanations/annotation_of_answer_json/de_list_item b/src/main/resources/explanations/annotation_of_answer_json/de_list_item index 84644a7..3c24d95 100644 --- a/src/main/resources/explanations/annotation_of_answer_json/de_list_item +++ b/src/main/resources/explanations/annotation_of_answer_json/de_list_item @@ -1 +1 @@ -am ${createdAt} eine SPARQL-query ausgeführt und folgende JSON zurückgegeben ' ${answerJson} ' &{mit einer Konfidenz von ${score}}& \ No newline at end of file +am ${annotatedAt} eine SPARQL-query ausgeführt und folgende JSON zurückgegeben ' ${hasBody} ' &{mit einer Konfidenz von ${score}}& \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_answer_json/en_list_item b/src/main/resources/explanations/annotation_of_answer_json/en_list_item index b1da98a..2dd1697 100644 --- a/src/main/resources/explanations/annotation_of_answer_json/en_list_item +++ b/src/main/resources/explanations/annotation_of_answer_json/en_list_item @@ -1 +1 @@ -on ${createdAt} a SPARQL-query was executed and returned the following JSON ' ${answerJson} ' &{with a confidence of ${score}}& \ No newline at end of file +on ${annotatedAt} a SPARQL-query was executed and returned the following JSON ' ${hasBody} ' &{with a confidence of ${score}}& \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_answer_sparql/de_list_item b/src/main/resources/explanations/annotation_of_answer_sparql/de_list_item index ce01b72..1255d70 100644 --- a/src/main/resources/explanations/annotation_of_answer_sparql/de_list_item +++ b/src/main/resources/explanations/annotation_of_answer_sparql/de_list_item @@ -1 +1 @@ -am ${createdAt} mit einer Konfidenz von ${score} die SPARQL-query ' ${body} ' \ No newline at end of file +am ${annotatedAt} mit einer Konfidenz von ${score} die SPARQL-query ' ${hasBody} ' \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_answer_sparql/en_list_item b/src/main/resources/explanations/annotation_of_answer_sparql/en_list_item index d3c08ef..266d499 100644 --- a/src/main/resources/explanations/annotation_of_answer_sparql/en_list_item +++ b/src/main/resources/explanations/annotation_of_answer_sparql/en_list_item @@ -1 +1 @@ -on ${createdAt} with a confidence of ${score} the SPARQL-query ' ${body} ' \ No newline at end of file +on ${annotatedAt} with a confidence of ${score} the SPARQL-query ' ${hasBody} ' \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_instance/de_list_item b/src/main/resources/explanations/annotation_of_instance/de_list_item index 54831a4..fc4ccbe 100644 --- a/src/main/resources/explanations/annotation_of_instance/de_list_item +++ b/src/main/resources/explanations/annotation_of_instance/de_list_item @@ -1 +1 @@ -am ${createdAt} &{mit einer Konfidenz von ${score}}& die Resource ${body} \ No newline at end of file +am ${annotatedAt} &{mit einer Konfidenz von ${score}}& die Resource ${hasBody} \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_instance/en_list_item b/src/main/resources/explanations/annotation_of_instance/en_list_item index 6ad5d5b..6817282 100644 --- a/src/main/resources/explanations/annotation_of_instance/en_list_item +++ b/src/main/resources/explanations/annotation_of_instance/en_list_item @@ -1 +1 @@ -on ${createdAt} &{with a confidence of ${score}}& and the resource ${body} \ No newline at end of file +on ${annotatedAt} &{with a confidence of ${score}}& and the resource ${hasBody} \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_question_language/de_list_item b/src/main/resources/explanations/annotation_of_question_language/de_list_item index e11c9c9..accf744 100644 --- a/src/main/resources/explanations/annotation_of_question_language/de_list_item +++ b/src/main/resources/explanations/annotation_of_question_language/de_list_item @@ -1 +1 @@ -am ${createdAt} für die Frage mit der URI '${hasTarget}' die Sprache '${body}' \ No newline at end of file +am ${annotatedAt} für die Frage mit der URI '${hasTarget}' die Sprache '${hasBody}' \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_question_language/en_list_item b/src/main/resources/explanations/annotation_of_question_language/en_list_item index 821d88d..662ad8f 100644 --- a/src/main/resources/explanations/annotation_of_question_language/en_list_item +++ b/src/main/resources/explanations/annotation_of_question_language/en_list_item @@ -1 +1 @@ -at ${createdAt} for the question with the URI '${hasTarget}' the language '${body}' \ No newline at end of file +at ${annotatedAt} for the question with the URI '${hasTarget}' the language '${hasBody}' \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_question_translation/de_list_item b/src/main/resources/explanations/annotation_of_question_translation/de_list_item index f73421a..3f1cbda 100644 --- a/src/main/resources/explanations/annotation_of_question_translation/de_list_item +++ b/src/main/resources/explanations/annotation_of_question_translation/de_list_item @@ -1 +1 @@ -am ${createdAt} die Frage mit der ID '${question}' in "${translation}" \ No newline at end of file +am ${annotatedAt} die Frage mit der ID '${hasTarget}' in "${hasBody}" \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_question_translation/en_list_item b/src/main/resources/explanations/annotation_of_question_translation/en_list_item index db23757..1037032 100644 --- a/src/main/resources/explanations/annotation_of_question_translation/en_list_item +++ b/src/main/resources/explanations/annotation_of_question_translation/en_list_item @@ -1 +1 @@ -at ${createdAt} the question with the ID '${question}' into "${translation}" \ No newline at end of file +at ${annotatedAt} the question with the ID '${hasTarget}' into "${hasBody}" \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_relation/de_list_item b/src/main/resources/explanations/annotation_of_relation/de_list_item index 815f56d..badd0b7 100644 --- a/src/main/resources/explanations/annotation_of_relation/de_list_item +++ b/src/main/resources/explanations/annotation_of_relation/de_list_item @@ -1 +1 @@ -' ${body} ' am ${createdAt} &{beginnend bei ${start} und endend bei ${end}}& &{mit einer Konfidenz von ${score}}& \ No newline at end of file +' ${hasBody} ' am ${annotatedAt} &{beginnend bei ${start} und endend bei ${end}}& &{mit einer Konfidenz von ${score}}& \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_relation/en_list_item b/src/main/resources/explanations/annotation_of_relation/en_list_item index 4679ec9..166838f 100644 --- a/src/main/resources/explanations/annotation_of_relation/en_list_item +++ b/src/main/resources/explanations/annotation_of_relation/en_list_item @@ -1 +1 @@ -' ${body} ' at ${createdAt} &{starting at ${start} and ending at ${end}}& &{with a confidence of ${score}}& \ No newline at end of file +' ${hasBody} ' at ${annotatedAt} &{starting at ${start} and ending at ${end}}& &{with a confidence of ${score}}& \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_spot_instance/de_list_item b/src/main/resources/explanations/annotation_of_spot_instance/de_list_item index fdbd42e..19be572 100644 --- a/src/main/resources/explanations/annotation_of_spot_instance/de_list_item +++ b/src/main/resources/explanations/annotation_of_spot_instance/de_list_item @@ -1 +1 @@ -am ${createdAt} beginnend bei ${start} und endend an Position ${end} \ No newline at end of file +am ${annotatedAt} beginnend bei ${start} und endend an Position ${end} \ No newline at end of file diff --git a/src/main/resources/explanations/annotation_of_spot_instance/en_list_item b/src/main/resources/explanations/annotation_of_spot_instance/en_list_item index 7466501..a66efb9 100644 --- a/src/main/resources/explanations/annotation_of_spot_instance/en_list_item +++ b/src/main/resources/explanations/annotation_of_spot_instance/en_list_item @@ -1 +1 @@ -at ${createdAt} starting from position ${start} and ending at position ${end} \ No newline at end of file +at ${annotatedAt} starting from position ${start} and ending at position ${end} \ No newline at end of file diff --git a/src/main/resources/queries/components_sparql_query.rq b/src/main/resources/queries/components_sparql_query.rq index acb9839..eea6453 100644 --- a/src/main/resources/queries/components_sparql_query.rq +++ b/src/main/resources/queries/components_sparql_query.rq @@ -3,7 +3,7 @@ PREFIX oa: PREFIX qa: SELECT DISTINCT ?component -FROM ?graphURI +FROM ?graph WHERE { ?s oa:annotatedBy ?component . } \ No newline at end of file diff --git a/src/main/resources/queries/queries_for_annotation_types/fetch_all_annotation_types.rq b/src/main/resources/queries/queries_for_annotation_types/fetch_all_annotation_types.rq index 9f58f66..afdbf38 100644 --- a/src/main/resources/queries/queries_for_annotation_types/fetch_all_annotation_types.rq +++ b/src/main/resources/queries/queries_for_annotation_types/fetch_all_annotation_types.rq @@ -3,8 +3,8 @@ PREFIX oa: PREFIX qa: SELECT DISTINCT ?annotationType -FROM ?graphURI +FROM ?graph WHERE { ?annotationId rdf:type ?annotationType . - ?annotationId oa:annotatedBy ?componentURI . + ?annotationId oa:annotatedBy ?annotatedBy . } \ No newline at end of file diff --git a/src/main/resources/queries/question_query.rq b/src/main/resources/queries/question_query.rq index b1a4b36..5df23a9 100644 --- a/src/main/resources/queries/question_query.rq +++ b/src/main/resources/queries/question_query.rq @@ -3,7 +3,7 @@ PREFIX oa: PREFIX qa: SELECT DISTINCT ?source -FROM ?graphURI +FROM ?graph WHERE { ?source ?p . } \ No newline at end of file diff --git a/src/test/java/com/wse/qanaryexplanationservice/services/ServiceDataForTests.java b/src/test/java/com/wse/qanaryexplanationservice/services/ServiceDataForTests.java index 9c1d232..561e51c 100644 --- a/src/test/java/com/wse/qanaryexplanationservice/services/ServiceDataForTests.java +++ b/src/test/java/com/wse/qanaryexplanationservice/services/ServiceDataForTests.java @@ -21,31 +21,24 @@ public class ServiceDataForTests { private final String jsonExplanationObjects = "{\"bindings\":[{\"annotationId\":{\"type\":\"uri\",\"value\":\"tag:stardog:api:0.7885976199321202\"},\"type\":{\"type\":\"uri\",\"value\":\"http://www.wdaqua.eu/qa#AnnotationOfInstance\"},\"body\":{\"type\":\"uri\",\"value\":\"http://dbpedia.org/resource/String_theory\"},\"source\":{\"type\":\"uri\",\"value\":\"http://demos.swe.htwk-leipzig.de:40111/question/stored-question__text_0d5a7c26-ec6a-4702-8d7f-999849938d0e\"},\"start\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#integer\",\"type\":\"typed-literal\",\"value\":\"0\"},\"end\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#integer\",\"type\":\"typed-literal\",\"value\":\"4\"},\"createdBy\":{\"type\":\"uri\",\"value\":\"urn:qanary:NED-DBpediaSpotlight\"},\"createdAt\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#dateTime\",\"type\":\"typed-literal\",\"value\":\"2023-08-09T06:39:32.615Z\"},\"score\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#decimal\",\"type\":\"typed-literal\",\"value\":\"0.9347568085631697\"}},{\"annotationId\":{\"type\":\"uri\",\"value\":\"tag:stardog:api:0.12726840785317994\"},\"type\":{\"type\":\"uri\",\"value\":\"http://www.wdaqua.eu/qa#AnnotationOfInstance\"},\"body\":{\"type\":\"uri\",\"value\":\"http://dbpedia.org/resource/Real_number\"},\"source\":{\"type\":\"uri\",\"value\":\"http://demos.swe.htwk-leipzig.de:40111/question/stored-question__text_0d5a7c26-ec6a-4702-8d7f-999849938d0e\"},\"start\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#integer\",\"type\":\"typed-literal\",\"value\":\"12\"},\"end\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#integer\",\"type\":\"typed-literal\",\"value\":\"16\"},\"createdBy\":{\"type\":\"uri\",\"value\":\"urn:qanary:NED-DBpediaSpotlight\"},\"createdAt\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#dateTime\",\"type\":\"typed-literal\",\"value\":\"2023-08-09T06:39:32.826Z\"},\"score\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#decimal\",\"type\":\"typed-literal\",\"value\":\"0.977747974809564\"}},{\"annotationId\":{\"type\":\"uri\",\"value\":\"tag:stardog:api:0.0010094414975868604\"},\"type\":{\"type\":\"uri\",\"value\":\"http://www.wdaqua.eu/qa#AnnotationOfInstance\"},\"body\":{\"type\":\"uri\",\"value\":\"http://dbpedia.org/resource/Batman\"},\"source\":{\"type\":\"uri\",\"value\":\"http://demos.swe.htwk-leipzig.de:40111/question/stored-question__text_0d5a7c26-ec6a-4702-8d7f-999849938d0e\"},\"start\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#integer\",\"type\":\"typed-literal\",\"value\":\"25\"},\"end\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#integer\",\"type\":\"typed-literal\",\"value\":\"31\"},\"createdBy\":{\"type\":\"uri\",\"value\":\"urn:qanary:NED-DBpediaSpotlight\"},\"createdAt\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#dateTime\",\"type\":\"typed-literal\",\"value\":\"2023-08-09T06:39:33.034Z\"},\"score\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#decimal\",\"type\":\"typed-literal\",\"value\":\"0.9999536254316278\"}}]}"; private final String jsonResultObjects = "{\"bindings\":[{\"annotationId\":{\"type\":\"uri\",\"value\":\"tag:stardog:api:0.7885976199321202\"},\"type\":{\"type\":\"uri\",\"value\":\"http://www.wdaqua.eu/qa#AnnotationOfInstance\"},\"body\":{\"type\":\"uri\",\"value\":\"http://dbpedia.org/resource/String_theory\"},\"target\":{\"type\":\"bnode\",\"value\":\"b0\"},\"createdBy\":{\"type\":\"uri\",\"value\":\"urn:qanary:NED-DBpediaSpotlight\"},\"createdAt\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#dateTime\",\"type\":\"typed-literal\",\"value\":\"2023-08-09T06:39:32.615Z\"}},{\"annotationId\":{\"type\":\"uri\",\"value\":\"tag:stardog:api:0.12726840785317994\"},\"type\":{\"type\":\"uri\",\"value\":\"http://www.wdaqua.eu/qa#AnnotationOfInstance\"},\"body\":{\"type\":\"uri\",\"value\":\"http://dbpedia.org/resource/Real_number\"},\"target\":{\"type\":\"bnode\",\"value\":\"b1\"},\"createdBy\":{\"type\":\"uri\",\"value\":\"urn:qanary:NED-DBpediaSpotlight\"},\"createdAt\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#dateTime\",\"type\":\"typed-literal\",\"value\":\"2023-08-09T06:39:32.826Z\"}},{\"annotationId\":{\"type\":\"uri\",\"value\":\"tag:stardog:api:0.0010094414975868604\"},\"type\":{\"type\":\"uri\",\"value\":\"http://www.wdaqua.eu/qa#AnnotationOfInstance\"},\"body\":{\"type\":\"uri\",\"value\":\"http://dbpedia.org/resource/Batman\"},\"target\":{\"type\":\"bnode\",\"value\":\"b2\"},\"createdBy\":{\"type\":\"uri\",\"value\":\"urn:qanary:NED-DBpediaSpotlight\"},\"createdAt\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#dateTime\",\"type\":\"typed-literal\",\"value\":\"2023-08-09T06:39:33.034Z\"}},{\"annotationId\":{\"type\":\"uri\",\"value\":\"tag:stardog:api:0.9600168603465082\"},\"type\":{\"type\":\"uri\",\"value\":\"http://www.wdaqua.eu/qa#AnnotationOfAnswerSPARQL\"},\"body\":{\"type\":\"literal\",\"value\":\"PREFIX rdfs: \\nPREFIX dct: \\nPREFIX dbr: \\nPREFIX rdf: \\nPREFIX foaf: \\n\\nSELECT *\\nWHERE\\n { ?resource foaf:name ?answer ;\\n rdfs:label ?label\\n FILTER ( lang(?label) = \\\"en_list_item\\\" )\\n ?resource dct:subject dbr:Category:Superheroes_with_alter_egos\\n FILTER ( ! strstarts(lcase(?label), lcase(?answer)) )\\n VALUES ?resource { dbr:Batman }\\n }\\nORDER BY ?resource\\n\"},\"target\":{\"type\":\"uri\",\"value\":\"http://demos.swe.htwk-leipzig.de:40111/question/stored-question__text_0d5a7c26-ec6a-4702-8d7f-999849938d0e\"},\"createdBy\":{\"type\":\"uri\",\"value\":\"urn:qanary:QB-SimpleRealNameOfSuperHero\"},\"createdAt\":{\"datatype\":\"http://www.w3.org/2001/XMLSchema#dateTime\",\"type\":\"typed-literal\",\"value\":\"2023-08-09T06:39:33.888Z\"}}]}"; private final Map mapWithRdfNodeValues = new HashMap<>() {{ - put("body", ResourceFactory.createResource("http://dbpedia.org/resource/example")); + put("hasBody", ResourceFactory.createResource("http://dbpedia.org/resource/example")); put("value2", ResourceFactory.createResource("resource2")); put("value3", ResourceFactory.createTypedLiteral("3.0", XSDDatatype.XSDdouble)); - put("createdAt", ResourceFactory.createTypedLiteral("2023-09-13T06:38:13.114944Z", XSDDatatype.XSDdateTime)); + put("annotatedAt", ResourceFactory.createTypedLiteral("2023-09-13T06:38:13.114944Z", XSDDatatype.XSDdateTime)); put("score", ResourceFactory.createTypedLiteral("0.33", XSDDatatype.XSDfloat)); put("start", ResourceFactory.createTypedLiteral("1", XSDDatatype.XSDinteger)); put("end", ResourceFactory.createTypedLiteral("3", XSDDatatype.XSDinteger)); - put("answerJson", ResourceFactory.createTypedLiteral("{example: {data:json, type:json}}")); - put("question", ResourceFactory.createResource("questionID:123f3rt3jrskdf324f")); - put("translation", ResourceFactory.createTypedLiteral("What is the real name of Batman?")); - put("hasTarget", ResourceFactory.createResource("questionID:981554csdf314kl2")); + put("hasTarget", ResourceFactory.createResource("questionID:123f3rt3jrskdf324f")); }}; private final Map convertedMapWithStringValues = new HashMap<>() {{ - put("body", "http://dbpedia.org/resource/example"); + put("hasBody", "http://dbpedia.org/resource/example"); put("value2", "resource2"); put("value3", "3.0"); - put("createdAt", "2023-09-13T06:38:13.114944Z"); + put("annotatedAt", "2023-09-13T06:38:13.114944Z"); put("score", "0.33"); put("start", "1"); put("end", "3"); - put("answerJson","{example: {data:json, type:json}}"); - put("question","questionID:123f3rt3jrskdf324f"); - put("translation", "What is the real name of Batman?"); - put("answerJson", "{example: {data:json, type:json}}"); - put("hasTarget", "questionID:981554csdf314kl2"); + put("hasTarget", "questionID:123f3rt3jrskdf324f"); }}; private Logger logger = LoggerFactory.getLogger(ServiceDataForTests.class); private List querySolutionMapList; diff --git a/src/test/resources/expected_list_explanations/annotationofanswerjson/de_list_item b/src/test/resources/expected_list_explanations/annotationofanswerjson/de_list_item index bfe24a7..9d5a7da 100644 --- a/src/test/resources/expected_list_explanations/annotationofanswerjson/de_list_item +++ b/src/test/resources/expected_list_explanations/annotationofanswerjson/de_list_item @@ -1 +1 @@ -am 2023-09-13T06:38:13.114944Z eine SPARQL-query ausgeführt und folgende JSON zurückgegeben ' {example: {data:json, type:json}} ' mit einer Konfidenz von 0.33 \ No newline at end of file +am 2023-09-13T06:38:13.114944Z eine SPARQL-query ausgeführt und folgende JSON zurückgegeben ' http://dbpedia.org/resource/example ' mit einer Konfidenz von 0.33 \ No newline at end of file diff --git a/src/test/resources/expected_list_explanations/annotationofanswerjson/en_list_item b/src/test/resources/expected_list_explanations/annotationofanswerjson/en_list_item index a887bbf..f471274 100644 --- a/src/test/resources/expected_list_explanations/annotationofanswerjson/en_list_item +++ b/src/test/resources/expected_list_explanations/annotationofanswerjson/en_list_item @@ -1 +1 @@ -on 2023-09-13T06:38:13.114944Z a SPARQL-query was executed and returned the following JSON ' {example: {data:json, type:json}} ' with a confidence of 0.33 \ No newline at end of file +on 2023-09-13T06:38:13.114944Z a SPARQL-query was executed and returned the following JSON ' http://dbpedia.org/resource/example ' with a confidence of 0.33 \ No newline at end of file diff --git a/src/test/resources/expected_list_explanations/annotationofquestionlanguage/de_list_item b/src/test/resources/expected_list_explanations/annotationofquestionlanguage/de_list_item index 758c35e..a3d25fe 100644 --- a/src/test/resources/expected_list_explanations/annotationofquestionlanguage/de_list_item +++ b/src/test/resources/expected_list_explanations/annotationofquestionlanguage/de_list_item @@ -1 +1 @@ -am 2023-09-13T06:38:13.114944Z für die Frage mit der URI 'questionID:981554csdf314kl2' die Sprache 'http://dbpedia.org/resource/example' \ No newline at end of file +am 2023-09-13T06:38:13.114944Z für die Frage mit der URI 'questionID:123f3rt3jrskdf324f' die Sprache 'http://dbpedia.org/resource/example' \ No newline at end of file diff --git a/src/test/resources/expected_list_explanations/annotationofquestionlanguage/en_list_item b/src/test/resources/expected_list_explanations/annotationofquestionlanguage/en_list_item index 46aac09..61955e0 100644 --- a/src/test/resources/expected_list_explanations/annotationofquestionlanguage/en_list_item +++ b/src/test/resources/expected_list_explanations/annotationofquestionlanguage/en_list_item @@ -1 +1 @@ -at 2023-09-13T06:38:13.114944Z for the question with the URI 'questionID:981554csdf314kl2' the language 'http://dbpedia.org/resource/example' \ No newline at end of file +at 2023-09-13T06:38:13.114944Z for the question with the URI 'questionID:123f3rt3jrskdf324f' the language 'http://dbpedia.org/resource/example' \ No newline at end of file diff --git a/src/test/resources/expected_list_explanations/annotationofquestiontranslation/de_list_item b/src/test/resources/expected_list_explanations/annotationofquestiontranslation/de_list_item index deef6fb..bc1b1d7 100644 --- a/src/test/resources/expected_list_explanations/annotationofquestiontranslation/de_list_item +++ b/src/test/resources/expected_list_explanations/annotationofquestiontranslation/de_list_item @@ -1 +1 @@ -am 2023-09-13T06:38:13.114944Z die Frage mit der ID 'questionID:123f3rt3jrskdf324f' in "What is the real name of Batman?" \ No newline at end of file +am 2023-09-13T06:38:13.114944Z die Frage mit der ID 'questionID:123f3rt3jrskdf324f' in "http://dbpedia.org/resource/example" \ No newline at end of file diff --git a/src/test/resources/expected_list_explanations/annotationofquestiontranslation/en_list_item b/src/test/resources/expected_list_explanations/annotationofquestiontranslation/en_list_item index a06f3be..0e64777 100644 --- a/src/test/resources/expected_list_explanations/annotationofquestiontranslation/en_list_item +++ b/src/test/resources/expected_list_explanations/annotationofquestiontranslation/en_list_item @@ -1 +1 @@ -at 2023-09-13T06:38:13.114944Z the question with the ID 'questionID:123f3rt3jrskdf324f' into "What is the real name of Batman?" \ No newline at end of file +at 2023-09-13T06:38:13.114944Z the question with the ID 'questionID:123f3rt3jrskdf324f' into "http://dbpedia.org/resource/example" \ No newline at end of file From 1605d71765357fdc18637331cd235be733bfa7e8 Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Fri, 13 Oct 2023 23:31:47 +0200 Subject: [PATCH 2/9] Adjusted Dockerfile --- Dockerfile | 25 +++++++++++++++++++------ extract_version.sh | 2 ++ pom.xml | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 extract_version.sh diff --git a/Dockerfile b/Dockerfile index 57abf32..24ff0a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,22 +3,35 @@ FROM ubuntu:20.04 AS qanary_commons ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install -y maven wget #git #openjdk-17-jre +RUN apt-get install -y git WORKDIR /app -RUN wget https://github.com/WDAqua/Qanary/archive/refs/tags/v3.5.2.tar.gz -RUN tar -xzvf v3.5.2.tar.gz -WORKDIR /app/Qanary-3.5.2/qanary_commons + +ENV JAR_VERSION="" + +RUN git clone https://github.com/WDAqua/Qanary.git +WORKDIR /app/Qanary/qanary_commons RUN mvn clean install -DskipTests +COPY extract_version.sh /extract_version.sh +RUN chmod +x /extract_version.sh +RUN /extract_version.sh WORKDIR /app -RUN cp Qanary-3.5.2/qanary_commons/target/qa.commons-3.5.4.jar . +RUN cp Qanary/qanary_commons/target/qa.commons-"$JAR_VERSION".jar . + +#RUN wget https://github.com/WDAqua/Qanary/archive/refs/tags/v3.5.2.tar.gz +#RUN tar -xzvf v3.5.2.tar.gz +#WORKDIR /app/Qanary-3.5.2/qanary_commons +#RUN mvn clean install -DskipTests +#WORKDIR /app +#RUN cp Qanary-3.5.2/qanary_commons/target/qa.commons-3.5.4.jar . #Build Stage FROM maven:latest AS build WORKDIR /app COPY ./src ./src COPY ./pom.xml ./pom.xml -COPY --from=qanary_commons /app/qa.commons-3.5.4.jar . +COPY --from=qanary_commons /app/qa.commons-"$JAR_VERSION".jar . # Installing the qa_commons dependency -RUN mvn install:install-file -Dfile=qa.commons-3.5.4.jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion=3.5.4 -Dpackaging=jar +RUN mvn install:install-file -Dfile=qa.commons-"$JAR_VERSION".jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion="$JAR_VERSION" -Dpackaging=jar # build the app RUN mvn clean install diff --git a/extract_version.sh b/extract_version.sh new file mode 100644 index 0000000..ce1f7f1 --- /dev/null +++ b/extract_version.sh @@ -0,0 +1,2 @@ +JAR_FILE=$(find . -maxdepth 1 -type f -name "*.jar") +export JAR_VERSION=$(echo "$JAR_FILE" | grep -oP 'java-\K[\d.]+') \ No newline at end of file diff --git a/pom.xml b/pom.xml index a8e092c..53cc932 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.wse qanary-explanation-service - 2.0.0 + 2.0.1 Qanary explanation service Webservice for rule-based explanation of QA-Systems as well as specific components From 8630ff933d5367dabac594276bd2967c071c0406 Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Fri, 13 Oct 2023 23:42:48 +0200 Subject: [PATCH 3/9] Adjusted script --- extract_version.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extract_version.sh b/extract_version.sh index ce1f7f1..094dbe1 100644 --- a/extract_version.sh +++ b/extract_version.sh @@ -1,2 +1,5 @@ +cd target JAR_FILE=$(find . -maxdepth 1 -type f -name "*.jar") -export JAR_VERSION=$(echo "$JAR_FILE" | grep -oP 'java-\K[\d.]+') \ No newline at end of file +export JAR_VERSION=$(echo "$JAR_FILE" | grep -oP 'java-\K[\d.]+') + +echo JAR_VERSION \ No newline at end of file From 569b00c600fd695036b11373a937664d7279aedd Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Fri, 13 Oct 2023 23:59:05 +0200 Subject: [PATCH 4/9] Adjusted scripts regex and Dockerfile --- Dockerfile | 6 +++--- extract_version.sh | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 24ff0a0..b314b1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ COPY extract_version.sh /extract_version.sh RUN chmod +x /extract_version.sh RUN /extract_version.sh WORKDIR /app -RUN cp Qanary/qanary_commons/target/qa.commons-"$JAR_VERSION".jar . +RUN cp Qanary/qanary_commons/target/qa.commons-$JAR_VERSION.jar . #RUN wget https://github.com/WDAqua/Qanary/archive/refs/tags/v3.5.2.tar.gz #RUN tar -xzvf v3.5.2.tar.gz @@ -29,9 +29,9 @@ FROM maven:latest AS build WORKDIR /app COPY ./src ./src COPY ./pom.xml ./pom.xml -COPY --from=qanary_commons /app/qa.commons-"$JAR_VERSION".jar . +COPY --from=qanary_commons /app/qa.commons-$JAR_VERSION.jar . # Installing the qa_commons dependency -RUN mvn install:install-file -Dfile=qa.commons-"$JAR_VERSION".jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion="$JAR_VERSION" -Dpackaging=jar +RUN mvn install:install-file -Dfile=qa.commons-$JAR_VERSION.jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion=$JAR_VERSION -Dpackaging=jar # build the app RUN mvn clean install diff --git a/extract_version.sh b/extract_version.sh index 094dbe1..b7d5976 100644 --- a/extract_version.sh +++ b/extract_version.sh @@ -1,5 +1,3 @@ cd target -JAR_FILE=$(find . -maxdepth 1 -type f -name "*.jar") -export JAR_VERSION=$(echo "$JAR_FILE" | grep -oP 'java-\K[\d.]+') - -echo JAR_VERSION \ No newline at end of file +JAR_FILE=$(find . -maxdepth 1 -type f -name "qa.commons-[0-9].[0-9].[0-9].jar") +export JAR_VERSION=$(echo $JAR_FILE | grep -oP 'qa.commons-\K\d+\.\d+\.\d+') \ No newline at end of file From 278db323f7435a6d61586ba7b1674d1926e9d1c5 Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Sat, 14 Oct 2023 20:28:11 +0200 Subject: [PATCH 5/9] Approach for eval Qanary version --- Dockerfile | 8 ++++---- extract_version.sh | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index b314b1b..889d746 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,14 +6,14 @@ RUN apt-get install -y maven wget #git #openjdk-17-jre RUN apt-get install -y git WORKDIR /app -ENV JAR_VERSION="" - RUN git clone https://github.com/WDAqua/Qanary.git WORKDIR /app/Qanary/qanary_commons RUN mvn clean install -DskipTests COPY extract_version.sh /extract_version.sh RUN chmod +x /extract_version.sh RUN /extract_version.sh +# DEFINE ENV FROM FILE +RUN export JAR_VERSION=$(cat /app/qanaryVersion); WORKDIR /app RUN cp Qanary/qanary_commons/target/qa.commons-$JAR_VERSION.jar . @@ -29,9 +29,9 @@ FROM maven:latest AS build WORKDIR /app COPY ./src ./src COPY ./pom.xml ./pom.xml -COPY --from=qanary_commons /app/qa.commons-$JAR_VERSION.jar . +COPY --from=qanary_commons /app/qa.commons-"$JAR_VERSION".jar . # Installing the qa_commons dependency -RUN mvn install:install-file -Dfile=qa.commons-$JAR_VERSION.jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion=$JAR_VERSION -Dpackaging=jar +RUN mvn install:install-file -Dfile=qa.commons-"$JAR_VERSION".jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion="$JAR_VERSION" -Dpackaging=jar # build the app RUN mvn clean install diff --git a/extract_version.sh b/extract_version.sh index b7d5976..2a403e8 100644 --- a/extract_version.sh +++ b/extract_version.sh @@ -1,3 +1,4 @@ -cd target +cd target && ls JAR_FILE=$(find . -maxdepth 1 -type f -name "qa.commons-[0-9].[0-9].[0-9].jar") -export JAR_VERSION=$(echo $JAR_FILE | grep -oP 'qa.commons-\K\d+\.\d+\.\d+') \ No newline at end of file +JAR_VERSION=$(echo $JAR_FILE | grep -oP 'qa.commons-\K\d+\.\d+\.\d+') +echo $JAR_VERSION > /app/qanaryVersion \ No newline at end of file From f2e320c455dce36a7942015bbbfd50e4e9251131 Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Sat, 14 Oct 2023 22:38:05 +0200 Subject: [PATCH 6/9] WIP --- Dockerfile | 29 +++++++++++++---------------- extract_commons_version.sh | 8 ++++++++ extract_version.sh | 4 ---- install_commons_dependency.sh | 3 +++ 4 files changed, 24 insertions(+), 20 deletions(-) create mode 100644 extract_commons_version.sh delete mode 100644 extract_version.sh create mode 100644 install_commons_dependency.sh diff --git a/Dockerfile b/Dockerfile index 889d746..e841eb7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,34 +4,31 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install -y maven wget #git #openjdk-17-jre RUN apt-get install -y git -WORKDIR /app +WORKDIR /app RUN git clone https://github.com/WDAqua/Qanary.git + WORKDIR /app/Qanary/qanary_commons RUN mvn clean install -DskipTests -COPY extract_version.sh /extract_version.sh -RUN chmod +x /extract_version.sh -RUN /extract_version.sh -# DEFINE ENV FROM FILE -RUN export JAR_VERSION=$(cat /app/qanaryVersion); -WORKDIR /app -RUN cp Qanary/qanary_commons/target/qa.commons-$JAR_VERSION.jar . +COPY extract_commons_version.sh /app/extract_commons_version.sh +RUN chmod +x /app/extract_commons_version.sh +RUN /app/extract_commons_version.sh -#RUN wget https://github.com/WDAqua/Qanary/archive/refs/tags/v3.5.2.tar.gz -#RUN tar -xzvf v3.5.2.tar.gz -#WORKDIR /app/Qanary-3.5.2/qanary_commons -#RUN mvn clean install -DskipTests -#WORKDIR /app -#RUN cp Qanary-3.5.2/qanary_commons/target/qa.commons-3.5.4.jar . +WORKDIR /app +COPY Qanary/qa.commons/target/qa.commons.jar . #Build Stage FROM maven:latest AS build WORKDIR /app COPY ./src ./src COPY ./pom.xml ./pom.xml -COPY --from=qanary_commons /app/qa.commons-"$JAR_VERSION".jar . +COPY --from=qanary_commons /app/qa.commons.jar . +COPY --from=qanary_commons /app/jar_version . # Installing the qa_commons dependency -RUN mvn install:install-file -Dfile=qa.commons-"$JAR_VERSION".jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion="$JAR_VERSION" -Dpackaging=jar +COPY install_commons_dependency.sh /app/install_commons_dependency.sh +RUN chmod +x /app/install_commons_dependency.sh +RUN /app/install_commons_dependency.sh +RUN mvn install:install-file -Dfile=qa.commons.jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion="$JAR_VERSION" -Dpackaging=jar # build the app RUN mvn clean install diff --git a/extract_commons_version.sh b/extract_commons_version.sh new file mode 100644 index 0000000..c228c2c --- /dev/null +++ b/extract_commons_version.sh @@ -0,0 +1,8 @@ +cd target && ls +#JAR_FILE=$(find . -maxdepth 1 -type f -name "qa.commons-[0-9].[0-9].[0-9].jar") +#JAR_VERSION=$(echo $JAR_FILE | grep -oP 'qa.commons-\K\d+\.\d+\.\d+') +JAR_FILE=$(find . -maxdepth 1 -type f -name "qa.commons-[0-9].[0-9].[0-9].jar") +JAR_VERSION=$(echo $JAR_FILE | grep -oP 'qa.commons-\K\d+\.\d+\.\d+') +mv qa.commons-$JAR_VERSION.jar qa.commons.jar +cd /app +echo $JAR_VERSION > jar_version \ No newline at end of file diff --git a/extract_version.sh b/extract_version.sh deleted file mode 100644 index 2a403e8..0000000 --- a/extract_version.sh +++ /dev/null @@ -1,4 +0,0 @@ -cd target && ls -JAR_FILE=$(find . -maxdepth 1 -type f -name "qa.commons-[0-9].[0-9].[0-9].jar") -JAR_VERSION=$(echo $JAR_FILE | grep -oP 'qa.commons-\K\d+\.\d+\.\d+') -echo $JAR_VERSION > /app/qanaryVersion \ No newline at end of file diff --git a/install_commons_dependency.sh b/install_commons_dependency.sh new file mode 100644 index 0000000..d6026f1 --- /dev/null +++ b/install_commons_dependency.sh @@ -0,0 +1,3 @@ +JAR_VERSION=$(cat jar_version | xargs) + +RUN mvn install:install-file -Dfile=qa.commons.jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion=$JAR_VERSION -Dpackaging=jar From 4783cdbb93baacb4fc7b5d593c0dbb5ce4ac7b6d Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Sat, 14 Oct 2023 22:40:19 +0200 Subject: [PATCH 7/9] Wip --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e841eb7..d3ac14f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN chmod +x /app/extract_commons_version.sh RUN /app/extract_commons_version.sh WORKDIR /app -COPY Qanary/qa.commons/target/qa.commons.jar . +COPY Qanary/qa_commons/target/qa.commons.jar . #Build Stage FROM maven:latest AS build From e13e17776487c2bf6a48bde4e0112959c0ef8da4 Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Sat, 14 Oct 2023 23:10:53 +0200 Subject: [PATCH 8/9] Solved problem fir qanary commons version --- Dockerfile | 8 ++------ .../extract_commons_version.sh | 5 +++-- dockerfile_scripts/install_commons_dependency.sh | 4 ++++ install_commons_dependency.sh | 3 --- 4 files changed, 9 insertions(+), 11 deletions(-) rename extract_commons_version.sh => dockerfile_scripts/extract_commons_version.sh (67%) create mode 100644 dockerfile_scripts/install_commons_dependency.sh delete mode 100644 install_commons_dependency.sh diff --git a/Dockerfile b/Dockerfile index d3ac14f..033d3c2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,13 +10,10 @@ RUN git clone https://github.com/WDAqua/Qanary.git WORKDIR /app/Qanary/qanary_commons RUN mvn clean install -DskipTests -COPY extract_commons_version.sh /app/extract_commons_version.sh +COPY dockerfile_scripts/extract_commons_version.sh /app/extract_commons_version.sh RUN chmod +x /app/extract_commons_version.sh RUN /app/extract_commons_version.sh -WORKDIR /app -COPY Qanary/qa_commons/target/qa.commons.jar . - #Build Stage FROM maven:latest AS build WORKDIR /app @@ -25,10 +22,9 @@ COPY ./pom.xml ./pom.xml COPY --from=qanary_commons /app/qa.commons.jar . COPY --from=qanary_commons /app/jar_version . # Installing the qa_commons dependency -COPY install_commons_dependency.sh /app/install_commons_dependency.sh +COPY dockerfile_scripts/install_commons_dependency.sh /app/install_commons_dependency.sh RUN chmod +x /app/install_commons_dependency.sh RUN /app/install_commons_dependency.sh -RUN mvn install:install-file -Dfile=qa.commons.jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion="$JAR_VERSION" -Dpackaging=jar # build the app RUN mvn clean install diff --git a/extract_commons_version.sh b/dockerfile_scripts/extract_commons_version.sh similarity index 67% rename from extract_commons_version.sh rename to dockerfile_scripts/extract_commons_version.sh index c228c2c..867806a 100644 --- a/extract_commons_version.sh +++ b/dockerfile_scripts/extract_commons_version.sh @@ -3,6 +3,7 @@ cd target && ls #JAR_VERSION=$(echo $JAR_FILE | grep -oP 'qa.commons-\K\d+\.\d+\.\d+') JAR_FILE=$(find . -maxdepth 1 -type f -name "qa.commons-[0-9].[0-9].[0-9].jar") JAR_VERSION=$(echo $JAR_FILE | grep -oP 'qa.commons-\K\d+\.\d+\.\d+') -mv qa.commons-$JAR_VERSION.jar qa.commons.jar +mv qa.commons-$JAR_VERSION.jar qa.commons.jar # Rename commons jar +cp qa.commons.jar /app cd /app -echo $JAR_VERSION > jar_version \ No newline at end of file +echo $JAR_VERSION > jar_version # Create file involving jar-file \ No newline at end of file diff --git a/dockerfile_scripts/install_commons_dependency.sh b/dockerfile_scripts/install_commons_dependency.sh new file mode 100644 index 0000000..13b9bae --- /dev/null +++ b/dockerfile_scripts/install_commons_dependency.sh @@ -0,0 +1,4 @@ +JAR_VERSION=$(cat jar_version | xargs) + +# Install commons-dependency +mvn install:install-file -Dfile=qa.commons.jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion=$JAR_VERSION -Dpackaging=jar diff --git a/install_commons_dependency.sh b/install_commons_dependency.sh deleted file mode 100644 index d6026f1..0000000 --- a/install_commons_dependency.sh +++ /dev/null @@ -1,3 +0,0 @@ -JAR_VERSION=$(cat jar_version | xargs) - -RUN mvn install:install-file -Dfile=qa.commons.jar -DgroupId=eu.wdaqua.qanary -DartifactId=qa.commons -Dversion=$JAR_VERSION -Dpackaging=jar From 12b65a7ab46cc37e1736fbb3348c242690484fe2 Mon Sep 17 00:00:00 2001 From: Dennis Schiese Date: Sat, 14 Oct 2023 23:19:01 +0200 Subject: [PATCH 9/9] Deleted queries --- .../annotations_of_answer_json_query.rq | 22 --------------- .../annotations_of_answer_sparql_query.rq | 18 ------------- .../annotations_of_instance_query.rq | 24 ----------------- .../annotations_of_question_language_query.rq | 13 --------- ...notations_of_question_translation_query.rq | 13 --------- .../annotations_of_relation_query.rq | 27 ------------------- .../annotations_of_spot_intance_query.rq | 21 --------------- 7 files changed, 138 deletions(-) delete mode 100644 src/main/resources/queries/queries_for_annotation_types/annotations_of_answer_json_query.rq delete mode 100644 src/main/resources/queries/queries_for_annotation_types/annotations_of_answer_sparql_query.rq delete mode 100644 src/main/resources/queries/queries_for_annotation_types/annotations_of_instance_query.rq delete mode 100644 src/main/resources/queries/queries_for_annotation_types/annotations_of_question_language_query.rq delete mode 100644 src/main/resources/queries/queries_for_annotation_types/annotations_of_question_translation_query.rq delete mode 100644 src/main/resources/queries/queries_for_annotation_types/annotations_of_relation_query.rq delete mode 100644 src/main/resources/queries/queries_for_annotation_types/annotations_of_spot_intance_query.rq diff --git a/src/main/resources/queries/queries_for_annotation_types/annotations_of_answer_json_query.rq b/src/main/resources/queries/queries_for_annotation_types/annotations_of_answer_json_query.rq deleted file mode 100644 index f4522f7..0000000 --- a/src/main/resources/queries/queries_for_annotation_types/annotations_of_answer_json_query.rq +++ /dev/null @@ -1,22 +0,0 @@ -PREFIX dbr: -PREFIX oa: -PREFIX qa: -PREFIX rdf: -PREFIX xsd: - -SELECT * -FROM ?graphURI -WHERE { - ?annotationId - a qa:AnnotationOfAnswerJson ; - oa:hasTarget ?question ; - oa:hasBody ?answer ; - oa:annotatedBy ?componentURI ; - oa:annotatedAt ?createdAt . - OPTIONAL { - ?annotationId qa:score ?score . - } - ?answer - a qa:AnswerJson ; - rdf:value ?answerJson . -} \ No newline at end of file diff --git a/src/main/resources/queries/queries_for_annotation_types/annotations_of_answer_sparql_query.rq b/src/main/resources/queries/queries_for_annotation_types/annotations_of_answer_sparql_query.rq deleted file mode 100644 index e43bfe2..0000000 --- a/src/main/resources/queries/queries_for_annotation_types/annotations_of_answer_sparql_query.rq +++ /dev/null @@ -1,18 +0,0 @@ -PREFIX dbr: -PREFIX oa: -PREFIX qa: -PREFIX rdf: -PREFIX xsd: - -SELECT * -FROM ?graphURI -WHERE { - ?newAnnotation rdf:type qa:AnnotationOfAnswerSPARQL . - ?newAnnotation oa:hasTarget ?targetQuestion . - ?newAnnotation oa:hasBody ?body . - OPTIONAL { - ?newAnnotation qa:score ?score . - } - ?newAnnotation oa:annotatedAt ?createdAt . - ?newAnnotation oa:annotatedBy ?componentURI . -} \ No newline at end of file diff --git a/src/main/resources/queries/queries_for_annotation_types/annotations_of_instance_query.rq b/src/main/resources/queries/queries_for_annotation_types/annotations_of_instance_query.rq deleted file mode 100644 index ddee557..0000000 --- a/src/main/resources/queries/queries_for_annotation_types/annotations_of_instance_query.rq +++ /dev/null @@ -1,24 +0,0 @@ -PREFIX rdf: -PREFIX oa: -PREFIX qa: - -SELECT * -FROM ?graphURI -WHERE { - ?annotationId rdf:type qa:AnnotationOfInstance . - ?annotationId oa:hasTarget [ - a oa:SpecificResource; - oa:hasSource ?source; - oa:hasSelector [ - a oa:TextPositionSelector; - oa:start ?start; - oa:end ?end; - ] - ]. - ?annotationId oa:hasBody ?body ; - oa:annotatedBy ?componentURI ; - oa:annotatedAt ?createdAt . - OPTIONAL { - ?annotationId qa:score ?score . - } -} \ No newline at end of file diff --git a/src/main/resources/queries/queries_for_annotation_types/annotations_of_question_language_query.rq b/src/main/resources/queries/queries_for_annotation_types/annotations_of_question_language_query.rq deleted file mode 100644 index 3321332..0000000 --- a/src/main/resources/queries/queries_for_annotation_types/annotations_of_question_language_query.rq +++ /dev/null @@ -1,13 +0,0 @@ -PREFIX qa: -PREFIX oa: -PREFIX questionID: - -SELECT * -FROM ?graphURI -WHERE { - ?annotationId a qa:AnnotationOfQuestionLanguage . - ?annotationId oa:hasTarget ?hasTarget ; - oa:hasBody ?body ; - oa:annotatedBy ?createdBy ; - oa:annotatedAt ?createdAt . -} diff --git a/src/main/resources/queries/queries_for_annotation_types/annotations_of_question_translation_query.rq b/src/main/resources/queries/queries_for_annotation_types/annotations_of_question_translation_query.rq deleted file mode 100644 index 3983e2d..0000000 --- a/src/main/resources/queries/queries_for_annotation_types/annotations_of_question_translation_query.rq +++ /dev/null @@ -1,13 +0,0 @@ -PREFIX qa: -PREFIX oa: -PREFIX questionID: - -SELECT * -FROM ?graphURI -WHERE { - ?annotationId a qa:AnnotationOfQuestionTranslation . - ?annotationId oa:hasTarget ?question ; - oa:hasBody ?translation ; - oa:annotatedBy ?createdBy ; - oa:annotatedAt ?createdAt . -} \ No newline at end of file diff --git a/src/main/resources/queries/queries_for_annotation_types/annotations_of_relation_query.rq b/src/main/resources/queries/queries_for_annotation_types/annotations_of_relation_query.rq deleted file mode 100644 index 7b5f5b2..0000000 --- a/src/main/resources/queries/queries_for_annotation_types/annotations_of_relation_query.rq +++ /dev/null @@ -1,27 +0,0 @@ -PREFIX qa: -PREFIX oa: - -SELECT * -FROM ?graphURI -WHERE { -?annotationId a qa:AnnotationOfRelation . -?annotationId oa:hasTarget [ - a oa:SpecificResource; - oa:hasSource ?hasSource - ] . - OPTIONAL { - ?annotationId oa:hasTarget [ - oa:hasSelector [ - a oa:TextPositionSelector ; - oa:start ?start ; - oa:end ?end - ] - ] . -} -OPTIONAL { -?annotationId qa:score ?score . -} -?annotationId oa:hasBody ?body ; - oa:annotatedBy ?createdBy ; - oa:annotatedAt ?createdAt . -} \ No newline at end of file diff --git a/src/main/resources/queries/queries_for_annotation_types/annotations_of_spot_intance_query.rq b/src/main/resources/queries/queries_for_annotation_types/annotations_of_spot_intance_query.rq deleted file mode 100644 index 4c46826..0000000 --- a/src/main/resources/queries/queries_for_annotation_types/annotations_of_spot_intance_query.rq +++ /dev/null @@ -1,21 +0,0 @@ -PREFIX rdf: -PREFIX oa: -PREFIX qa: - -SELECT * -FROM ?graphURI -WHERE { - ?annotationId rdf:type qa:AnnotationOfSpotInstance. - ?annotationId oa:hasTarget [ - a oa:SpecificResource; - oa:hasSource ?source; - oa:hasSelector [ - a oa:TextPositionSelector; - oa:start ?start; - oa:end ?end; - ] - ]. - ?annotationId oa:annotatedAt ?createdAt ; - oa:annotatedBy ?componentURI . -} -