1

Im trying to send a big Sparql-Update String to GraphDB by using RDF4J. It works for small Sparql-Update Strings, but for a big String (ca. 8000 INSERT DATA-Statements) it fails with the HTTP-Exception

org.eclipse.rdf4j.repository.http.HTTPUpdateExecutionException: Unsupported MIME type: application/x-www-form-urlencoded

My RDF4J code looks like this:

HTTPRepository repository = new HTTPRepository("http://localhost:7200", "test");
repository.initialize();
try (RepositoryConnection conn = repository.getConnection()) {
     conn.prepareUpdate(SPARLQString).execute();
}

I already tried to set the Header to "application/sparql-update" but i got the same exception.

Is this behavior intended? How do i work around / fix this issue?

Ive used Fuseki before and never had this Problem.

Only X
  • 37
  • 1
  • 6

1 Answers1

1

You could use the HTTPRepository(String repositoryURL) instead and it should work.

HTTPRepository repository = new HTTPRepository("http://localhost:7200/repositories/test");

For update operations the endpoint is /repositories/test/statements.

Konstantin Petrov
  • 1,058
  • 6
  • 11
  • I changed my code according to your suggestion, but im still getting the same error. I also tried using plain rest to post the string to " /repositories/test/statements" resulting in the same error. Is there a max size configuration somewhere that i have to change? – Only X Sep 01 '21 at 09:39