diff --git a/CHANGELOG.md b/CHANGELOG.md index 634fa99..370117c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,20 @@ ## Version 1.6 -### New +### New + + - Move the project to Java 11. Initially it was on 11, but after a while it was downgraded to 8, because of internal projects that were still developed on 8. Now we can + proceed with the initial plan. ### Changes + - Updated the version of the ``jackson-databind`` library to the latest. The previous is detected as vulnerable by the security scans. + ### Bug fixes + - Fixed a major bug in the `SparqlBasedRdfExportCommand`. The problem was that the payload for the request (the actual SPARQL query) was not encoded, which in + different cases caused an execution of malformed query. + ## Version 1.5 diff --git a/pom.xml b/pom.xml index 5f65f27..ae5abb3 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.ontotext ontorefine-client - 1.6.0-SNAPSHOT + 1.6.0 ${project.groupId}:${project.artifactId} An OntoRefine Client Library @@ -44,8 +44,8 @@ - 8 - 8 + 11 + 11 UTF-8 UTF-8 6.9 @@ -67,7 +67,7 @@ 4.5.13 3.12.0 2.10.0 - 2.12.4 + 2.13.2.2 3.7.2 5.8.1 diff --git a/src/main/java/com/ontotext/refine/client/command/rdf/SparqlBasedExportRdfCommand.java b/src/main/java/com/ontotext/refine/client/command/rdf/SparqlBasedExportRdfCommand.java index eec08a7..179c7f4 100644 --- a/src/main/java/com/ontotext/refine/client/command/rdf/SparqlBasedExportRdfCommand.java +++ b/src/main/java/com/ontotext/refine/client/command/rdf/SparqlBasedExportRdfCommand.java @@ -13,6 +13,7 @@ import com.ontotext.refine.client.command.RefineCommand; import com.ontotext.refine.client.exceptions.RefineException; import java.io.IOException; +import java.net.URLEncoder; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpEntity; @@ -106,7 +107,8 @@ private HttpEntity buildEntity() throws IOException { */ private String buildRequestContent() { String fixedQuery = query.replaceFirst(projectPlaceholder, project); - return StringUtils.prependIfMissing(fixedQuery, "query="); + String encodedQuery = URLEncoder.encode(fixedQuery, UTF_8); + return StringUtils.prependIfMissing(encodedQuery, "query="); } @Override diff --git a/src/test/java/com/ontotext/refine/client/SecuredExportIntegrationTest.java b/src/test/java/com/ontotext/refine/client/SecuredExportIntegrationTest.java index 55162f6..dedc178 100644 --- a/src/test/java/com/ontotext/refine/client/SecuredExportIntegrationTest.java +++ b/src/test/java/com/ontotext/refine/client/SecuredExportIntegrationTest.java @@ -66,7 +66,7 @@ void exportRdfUsingSparql() throws Exception { new ByteArrayInputStream(exportRdfResponse.getResult().getBytes()), RDFFormat.TURTLE); - assertTrue("The expected result different then the acual one.", areEqual); + assertTrue("The expected result is different then the acual one.", areEqual); DeleteProjectResponse deleteResponse = deleteProject(projectId); assertEquals(ResponseCode.OK, deleteResponse.getCode()); diff --git a/src/test/resources/integration/expected/scenario_1_reduced_netherlands_restaurants_exportRdfUsingSparql.ttl b/src/test/resources/integration/expected/scenario_1_reduced_netherlands_restaurants_exportRdfUsingSparql.ttl index 4b94c50..00cbeb9 100644 --- a/src/test/resources/integration/expected/scenario_1_reduced_netherlands_restaurants_exportRdfUsingSparql.ttl +++ b/src/test/resources/integration/expected/scenario_1_reduced_netherlands_restaurants_exportRdfUsingSparql.ttl @@ -24,7 +24,7 @@ a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.9003230 52.3775440)"^^geo:wktLiteral . _:node1 amsterdam:address "Stationsplein 10" . @@ -42,7 +42,7 @@ _:node2 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.9108380 52.3703240)"^^geo:wktLiteral . _:node3 amsterdam:address "Rapenburgerplein 6 HS" . @@ -60,7 +60,7 @@ _:node4 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8819140 52.3652890)"^^geo:wktLiteral . _:node5 amsterdam:address "Korte Leidsedwarsstraat 15" . @@ -79,7 +79,7 @@ _:node6 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8979420 52.3644210)"^^geo:wktLiteral . _:node7 amsterdam:address "Utrechtsestraat 32" . @@ -98,7 +98,7 @@ _:node8 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8890150 52.3723020)"^^geo:wktLiteral . _:node9 amsterdam:address "Paleisstraat 16" . @@ -117,7 +117,7 @@ _:node10 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.9054970 52.3600380)"^^geo:wktLiteral . _:node11 amsterdam:address "Professor Tulpplein 1" . @@ -135,7 +135,7 @@ _:node12 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8904390 52.3736470)"^^geo:wktLiteral . _:node13 amsterdam:address "Nieuwezijds Voorburgwal 182" . @@ -154,7 +154,7 @@ _:node14 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8925680 52.3736560)"^^geo:wktLiteral . _:node15 amsterdam:address "Nieuwendijk 224" . @@ -173,7 +173,7 @@ _:node16 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8251040 52.3417330)"^^geo:wktLiteral . _:node17 amsterdam:address "John M. Keynesplein 2" . @@ -192,7 +192,7 @@ _:node18 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8816340 52.3782390)"^^geo:wktLiteral . _:node19 amsterdam:address "Westerstraat 186" . @@ -211,7 +211,7 @@ _:node20 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8938650 52.3732480)"^^geo:wktLiteral . _:node21 amsterdam:address "Dam 1" . @@ -230,7 +230,7 @@ _:node22 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8995560 52.3765520)"^^geo:wktLiteral . _:node23 amsterdam:address "Prins Hendrikkade 52-57" . @@ -249,7 +249,7 @@ _:node24 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8964230 52.3656790)"^^geo:wktLiteral . _:node25 amsterdam:address "Rembrandtplein 42" . @@ -268,7 +268,7 @@ _:node26 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8118490 52.4718770)"^^geo:wktLiteral . _:node27 amsterdam:address "Lagedijk 32-34" . @@ -286,7 +286,7 @@ _:node28 amsterdam:city "ZAANDIJK" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8956800 52.3780830)"^^geo:wktLiteral . _:node29 amsterdam:address "Nieuwendijk 40" . @@ -305,7 +305,7 @@ _:node30 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8840520 52.3637490)"^^geo:wktLiteral . _:node31 amsterdam:address "Korte Leidsedwarsstraat 95" . @@ -324,7 +324,7 @@ _:node32 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.9128770 52.3496410)"^^geo:wktLiteral . _:node33 amsterdam:address "Weesperzijde 135" . @@ -343,7 +343,7 @@ _:node34 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8900800 52.3731270)"^^geo:wktLiteral . _:node35 amsterdam:address "Dam 3-7" . @@ -362,7 +362,7 @@ _:node36 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8173360 52.3372140)"^^geo:wktLiteral . _:node37 amsterdam:address "Oude Haagseweg 20" . @@ -381,7 +381,7 @@ _:node38 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.9416950 52.3130940)"^^geo:wktLiteral . _:node39 amsterdam:address "Arena boulevard 61-75" . @@ -400,7 +400,7 @@ _:node40 amsterdam:city "AMSTERDAM ZUIDOOST" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8954940 52.3782540)"^^geo:wktLiteral . _:node41 amsterdam:address "Nieuwendijk 31" . @@ -419,7 +419,7 @@ _:node42 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8888240 52.3633790)"^^geo:wktLiteral . _:node43 amsterdam:address "Kerkstraat 148" . @@ -438,7 +438,7 @@ _:node44 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8971930 52.3657750)"^^geo:wktLiteral . _:node45 amsterdam:address "Rembrandtplein 44" . @@ -457,7 +457,7 @@ _:node46 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.9025420 52.3653120)"^^geo:wktLiteral . _:node47 amsterdam:address "Amstel 51" . @@ -476,7 +476,7 @@ _:node48 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.7927380 52.3420810)"^^geo:wktLiteral . _:node49 amsterdam:address "Akersluis 8" . @@ -495,7 +495,7 @@ _:node50 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8921870 52.3661890)"^^geo:wktLiteral . _:node51 amsterdam:address "Reguliersdwarsstraat 38" . @@ -514,7 +514,7 @@ _:node52 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8986440 52.3632830)"^^geo:wktLiteral . _:node53 amsterdam:address "Utrechtsestraat 75" . @@ -533,7 +533,7 @@ _:node54 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8833480 52.3527450)"^^geo:wktLiteral . _:node55 amsterdam:address "Roelof Hartstraat 1" . @@ -552,7 +552,7 @@ _:node56 amsterdam:city "AMSTERDAM" . a sf:Point; - geo:asWKT " POINT ("^^geo:wktLiteral . + geo:asWKT " POINT (4.8784460 52.3579310)"^^geo:wktLiteral . _:node57 amsterdam:address "Van Baerlestraat 52" .