Skip to content

Commit 55170d4

Browse files
authored
Move common dependencies to qanary_component-parent (#368)
* remove specific springdoc-openapi-data-rest version * get depdencies from qanary_component-parent * remove unneeded qanary.version * add throws declaration for URISyntaxException * add throws declarations for URISyntaxException * reduce detection quality threshold to 80
1 parent 011db0a commit 55170d4

File tree

9 files changed

+20
-74
lines changed

9 files changed

+20
-74
lines changed

qanary-component-KG2KG-TranslateAnnotationsOfInstance/src/main/java/eu/wdaqua/qanary/component/KG2KGTranslateAnnotationsOfInstance.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.HashMap;
2727
import java.util.List;
2828
import java.util.Map;
29+
import java.net.URISyntaxException;
2930

3031
@Component
3132
public class KG2KGTranslateAnnotationsOfInstance extends QanaryComponent {
@@ -89,7 +90,7 @@ public QanaryMessage process(QanaryMessage myQanaryMessage) throws Exception {
8990
/**
9091
* Fetching all annotations of type qa:AnnotationsOfInstance
9192
*/
92-
public ResultSet fetchAnnotations(String graphID, final QanaryUtils qanaryUtils) throws IOException, SparqlQueryFailed {
93+
public ResultSet fetchAnnotations(String graphID, final QanaryUtils qanaryUtils) throws IOException, SparqlQueryFailed, URISyntaxException {
9394
String requestQuery = getRequestQuery(graphID);
9495
return qanaryUtils.getQanaryTripleStoreConnector().select(requestQuery);
9596
}

qanary-component-LD-Shuyo/src/test/java/eu/wdaqua/qanary/component/shuyo/ld/LanguageDetectionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class LanguageDetectionTest {
2525

2626
private static final Logger logger = LoggerFactory.getLogger(LanguageDetectionTest.class);
2727
private static LanguageDetection myLanguageDetection;
28-
private final short expectedQualityAsPercent = 85;
28+
private final short expectedQualityAsPercent = 80;
2929

3030
@BeforeAll
3131
public static void initLanguageDetection() throws IOException, LangDetectException {

qanary-component-NED-Opentapioca/pom.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>eu.wdaqua.qanary.component</groupId>
77
<artifactId>qanary-component-NED-Opentapioca</artifactId>
8-
<version>3.3.3</version>
8+
<version>3.3.4</version>
99

1010
<parent>
1111
<groupId>eu.wdaqua.qanary</groupId>
1212
<artifactId>qa.qanarycomponent-parent</artifactId>
1313
<version>[0.1.0,1.0.0)</version>
1414
</parent>
15+
1516
<properties>
1617
<java.version>17</java.version>
1718
<qanary.version>[3.7.6,4.0.0)</qanary.version>
1819
<docker.image.prefix>qanary</docker.image.prefix>
1920
<docker.image.name>qanary-component-ned-opentapioca</docker.image.name>
2021
<dockerfile-maven-version>1.4.13</dockerfile-maven-version>
21-
<springdoc.version>1.7.0</springdoc.version>
2222
</properties>
2323

2424
<dependencies>
@@ -46,7 +46,6 @@
4646
<dependency>
4747
<groupId>org.springdoc</groupId>
4848
<artifactId>springdoc-openapi-data-rest</artifactId>
49-
<version>${springdoc.version}</version>
5049
</dependency>
5150
<!-- https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-ui -->
5251
<dependency>

qanary-component-QB-SimpleRealNameOfSuperHero/pom.xml

+6-62
Original file line numberDiff line numberDiff line change
@@ -5,81 +5,27 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>eu.wdaqua.qanary.component</groupId>
77
<artifactId>qanary-component-QB-SimpleRealNameOfSuperHero</artifactId>
8-
<version>3.2.0</version>
8+
<version>3.3.0</version>
9+
910
<parent>
10-
<groupId>org.springframework.boot</groupId>
11-
<artifactId>spring-boot-starter-parent</artifactId>
12-
<version>2.6.7</version>
13-
<relativePath /> <!-- lookup parent from repository -->
11+
<groupId>eu.wdaqua.qanary</groupId>
12+
<artifactId>qa.qanarycomponent-parent</artifactId>
13+
<version>[0.1.0,1.0.0)</version>
1414
</parent>
15+
1516
<properties>
1617
<java.version>17</java.version>
17-
<qanary.version>[3.7.6,4.0.0)</qanary.version>
1818
<docker.image.prefix>qanary</docker.image.prefix>
1919
<docker.image.name>qanary-component-qb-simplerealnameofsuperhero</docker.image.name>
2020
<dockerfile-maven-version>1.4.13</dockerfile-maven-version>
21-
<spingdoc.version>1.7.0</spingdoc.version>
2221
</properties>
2322

2423
<dependencies>
25-
<dependency>
26-
<groupId>eu.wdaqua.qanary</groupId>
27-
<artifactId>qa.component</artifactId>
28-
<version>${qanary.version}</version>
29-
<exclusions>
30-
<exclusion>
31-
<groupId>org.apache.logging.log4j</groupId>
32-
<artifactId>log4j-to-slf4j</artifactId>
33-
</exclusion>
34-
</exclusions>
35-
</dependency>
36-
<dependency>
37-
<groupId>eu.wdaqua.qanary</groupId>
38-
<artifactId>qa.commons</artifactId>
39-
<version>[3.5.4,4.0.0]</version>
40-
</dependency>
41-
<dependency>
42-
<groupId>org.apache.logging.log4j</groupId>
43-
<artifactId>log4j-to-slf4j</artifactId>
44-
<version>[2.19.0,3.)</version>
45-
<exclusions>
46-
<exclusion>
47-
<groupId>org.apache.logging.log4j</groupId>
48-
<artifactId>log4j-api</artifactId>
49-
</exclusion>
50-
</exclusions>
51-
</dependency>
52-
<dependency>
53-
<groupId>org.springframework.boot</groupId>
54-
<artifactId>spring-boot-starter-web</artifactId>
55-
</dependency>
56-
<dependency>
57-
<groupId>org.springframework.boot</groupId>
58-
<artifactId>spring-boot-starter-test</artifactId>
59-
<scope>test</scope>
60-
</dependency>
61-
<dependency>
62-
<groupId>org.hamcrest</groupId>
63-
<artifactId>hamcrest-all</artifactId>
64-
<version>1.3</version>
65-
<scope>test</scope>
66-
</dependency>
6724
<dependency>
6825
<groupId>org.junit.jupiter</groupId>
6926
<artifactId>junit-jupiter-engine</artifactId>
7027
<scope>test</scope>
7128
</dependency>
72-
<dependency>
73-
<groupId>junit</groupId>
74-
<artifactId>junit</artifactId>
75-
<scope>test</scope>
76-
<exclusions>
77-
<exclusion>
78-
<artifactId>hamcrest-core</artifactId>
79-
<groupId>org.hamcrest</groupId>
80-
</exclusion>
81-
</exclusions>
82-
</dependency>
8329
<dependency>
8430
<groupId>org.springframework</groupId>
8531
<artifactId>spring-test</artifactId>
@@ -108,12 +54,10 @@
10854
<dependency>
10955
<groupId>org.springdoc</groupId>
11056
<artifactId>springdoc-openapi-ui</artifactId>
111-
<version>${spingdoc.version}</version>
11257
</dependency>
11358
<dependency>
11459
<groupId>org.springdoc</groupId>
11560
<artifactId>springdoc-openapi-webmvc-core</artifactId>
116-
<version>${spingdoc.version}</version>
11761
</dependency>
11862
</dependencies>
11963
<build>

qanary-component-QB-Sina/src/main/java/eu/wdaqua/qanary/component/sina/qb/SINA.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public QanaryMessage process(QanaryMessage myQanaryMessage) throws Exception {
109109
return myQanaryMessage;
110110
}
111111

112-
private StringBuilder fetchEntities(final QanaryQuestion<String> qanaryQuestion, final QanaryUtils qanaryUtils) throws SparqlQueryFailed, IOException {
112+
private StringBuilder fetchEntities(final QanaryQuestion<String> qanaryQuestion, final QanaryUtils qanaryUtils) throws SparqlQueryFailed, IOException, URISyntaxException {
113113
QuerySolutionMap bindingsForGetEntities = new QuerySolutionMap();
114114
bindingsForGetEntities.add("graph", ResourceFactory.createResource(qanaryQuestion.getInGraph().toASCIIString()));
115115

qanary-component-QBE-SimpleQueryBuilderAndExecutor/src/main/java/eu/wdaqua/qanary/component/simplequerybuilderandexecutor/qbe/QueryBuilder.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.ArrayList;
1919
import java.util.List;
2020
import java.util.UUID;
21+
import java.net.URISyntaxException;
2122

2223
@Component
2324
/**
@@ -280,7 +281,7 @@ public QanaryMessage process(QanaryMessage myQanaryMessage) throws Exception {
280281
* @param myQanaryQuestion
281282
* @return
282283
*/
283-
private List<String> getClassesFromQanaryKB(QanaryUtils myQanaryUtils, QanaryQuestion<String> myQanaryQuestion) throws SparqlQueryFailed, IOException {
284+
private List<String> getClassesFromQanaryKB(QanaryUtils myQanaryUtils, QanaryQuestion<String> myQanaryQuestion) throws SparqlQueryFailed, IOException, URISyntaxException {
284285
List<String> classes = new ArrayList<String>();
285286

286287
QuerySolutionMap bindingsForSelect = new QuerySolutionMap();
@@ -308,7 +309,7 @@ private List<String> getClassesFromQanaryKB(QanaryUtils myQanaryUtils, QanaryQue
308309
* @param myQanaryQuestion
309310
* @return
310311
*/
311-
private List<String> getPropertiesFromQanaryKB(QanaryUtils myQanaryUtils, QanaryQuestion<String> myQanaryQuestion) throws SparqlQueryFailed, IOException {
312+
private List<String> getPropertiesFromQanaryKB(QanaryUtils myQanaryUtils, QanaryQuestion<String> myQanaryQuestion) throws SparqlQueryFailed, IOException, URISyntaxException {
312313
List<String> properties = new ArrayList<String>();
313314

314315
QuerySolutionMap bindingsForSelect = new QuerySolutionMap();
@@ -335,7 +336,7 @@ private List<String> getPropertiesFromQanaryKB(QanaryUtils myQanaryUtils, Qanary
335336
* @param myQanaryQuestion
336337
* @return
337338
*/
338-
private List<String> getEntitiesFromQanaryKB(QanaryUtils myQanaryUtils, QanaryQuestion<String> myQanaryQuestion) throws SparqlQueryFailed, IOException {
339+
private List<String> getEntitiesFromQanaryKB(QanaryUtils myQanaryUtils, QanaryQuestion<String> myQanaryQuestion) throws SparqlQueryFailed, IOException, URISyntaxException {
339340
List<String> entities = new ArrayList<String>();
340341

341342
QuerySolutionMap bindingsForSelect = new QuerySolutionMap();

qanary-component-QE-SparqlExecuter/src/main/java/eu/wdaqua/qanary/sparqlexecuter/SparqlExecuter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public String selectKnowledgeGraphEnpdoint(String sparqlQuery){
124124
return endpoint;
125125
}
126126

127-
public String getResultSparqlQuery(QanaryUtils myQanaryUtils, QanaryQuestion myQanaryQuestion) throws SparqlQueryFailed, IOException{
127+
public String getResultSparqlQuery(QanaryUtils myQanaryUtils, QanaryQuestion myQanaryQuestion) throws SparqlQueryFailed, IOException, URISyntaxException{
128128
ResultSet resultset = myQanaryUtils.getQanaryTripleStoreConnector().select(QanaryTripleStoreConnector.getLowestIndexAnnotationOfAnswerInGraph(myQanaryQuestion.getOutGraph()));
129129
String sparqlQuery = "";
130130
while (resultset.hasNext()) {

qanary-component-QE-SparqlExecuter/src/test/java/eu/wdaqua/qanary/sparqlexecuter/SparqlExecuterTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void testGetSparqlInsertQuery() throws IOException, QanaryExceptionNoOrMultipleQ
8484
}
8585

8686
@Test
87-
void testGetResultSparqlQuery() throws SparqlQueryFailed, IOException {
87+
void testGetResultSparqlQuery() throws SparqlQueryFailed, IOException, URISyntaxException {
8888
// This test exists only to ensure that SparqlExecuter.getResultSparqlQuery()
8989
// can handle the return type org.apache.jena.query.ResultSet.
9090
//

qanary-component-RD-DiambiguationProperty-OKBQA/src/main/java/eu/wdaqua/qanary/component/diambiguationproperty/rd/DiambiguationProperty.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.net.HttpURLConnection;
2626
import java.net.URL;
2727
import java.net.URLEncoder;
28+
import java.net.URISyntaxException;
2829
import java.util.HashMap;
2930
import java.util.Iterator;
3031
import java.util.Map;
@@ -130,7 +131,7 @@ public static String runCurlPOSTWithParam(String weburl, String data, String con
130131
* component
131132
*/
132133
@Override
133-
public QanaryMessage process(QanaryMessage myQanaryMessage) throws SparqlQueryFailed, IOException {
134+
public QanaryMessage process(QanaryMessage myQanaryMessage) throws SparqlQueryFailed, IOException, URISyntaxException {
134135
long startTime = System.currentTimeMillis();
135136
//org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.OFF);
136137
logger.info("process: {}", myQanaryMessage);

0 commit comments

Comments
 (0)