From ce7f4bed00590e0554d216ce4d5b7a562a674eb5 Mon Sep 17 00:00:00 2001 From: "domi.vds" Date: Sat, 26 Aug 2023 20:52:56 +0200 Subject: [PATCH] Replace application/x-turtle with text/turtle;charset=utf-8 --- .../zone/cogni/asquare/virtuoso/VirtuosoRdfStoreService.java | 2 +- .../cogni/libs/sparqlservice/impl/VirtuosoSparqlService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/access/src/main/java/zone/cogni/asquare/virtuoso/VirtuosoRdfStoreService.java b/access/src/main/java/zone/cogni/asquare/virtuoso/VirtuosoRdfStoreService.java index 4702412..a9d5617 100644 --- a/access/src/main/java/zone/cogni/asquare/virtuoso/VirtuosoRdfStoreService.java +++ b/access/src/main/java/zone/cogni/asquare/virtuoso/VirtuosoRdfStoreService.java @@ -98,7 +98,7 @@ private void addData(Model model, String graphUri, boolean replace) { log.info("Calling {} with basic auth: {}", url, graphCrudUseBasicAuth); HttpEntityEnclosingRequestBase request = replace ? new HttpPut(url) : new HttpPost(url); request.setEntity(new ByteArrayEntity(data)); - request.setHeader("Content-Type", "application/x-turtle"); + request.setHeader("Content-Type", "text/turtle;charset=utf-8"); if (graphCrudUseBasicAuth) { request.setHeader("Authorization", "Basic " + Base64.encodeBase64String((rdfStoreUser + ":" + rdfStorePassword).getBytes(StandardCharsets.UTF_8))); } diff --git a/cogni-libs/src/main/java/zone/cogni/libs/sparqlservice/impl/VirtuosoSparqlService.java b/cogni-libs/src/main/java/zone/cogni/libs/sparqlservice/impl/VirtuosoSparqlService.java index a2ae81a..5122c04 100644 --- a/cogni-libs/src/main/java/zone/cogni/libs/sparqlservice/impl/VirtuosoSparqlService.java +++ b/cogni-libs/src/main/java/zone/cogni/libs/sparqlservice/impl/VirtuosoSparqlService.java @@ -111,7 +111,7 @@ private void loadIntoGraph_exception(byte[] data, String updateUrl, boolean repl conn.setDoOutput(true); conn.setInstanceFollowRedirects(true); conn.setRequestMethod(replace ? "PUT" : "POST"); - conn.setRequestProperty("Content-Type", "application/x-turtle"); + conn.setRequestProperty("Content-Type", "text/turtle;charset=utf-8"); conn.setRequestProperty("charset", "utf-8"); conn.setRequestProperty("Content-Length", Integer.toString(data.length)); if(sparqlGraphCrudUseBasicAuth) {