POST request returns 415

I am using an application we developed to load data in .ttl format into a Stardog DB on localhost. The application ends up building the following POST request:
POST http://usr:pwd@localhost:5820/myDB/update?graph=https%3A%2F%2Fapp.test.io%2Fgraphs%2Fontologies

I get response 415 (unsupported media type).
I have no issue running the same (adjusting the endpoints, of course) on Apache Jena or Anzograph.

Hi Andy,

It's probably not very apparent from our HTTP API docs but there're different endpoints for SPARQL Update queries (/{db}/update) and SPARQL Graph Store Protocol (/{db}). You're using the former and it expects a query, not data. It looks like you need PUT Graph or Post Graph instead. There the payload is data in some RDF serialisation, like Turtle.

Cheers,
Pavel

Hi Pavel,

That helped, thank you!
Just for completeness purposes, if you have authentication enabled, you need to use:
http://usr:pwd@localhost:5820/dbname/

Regards,
Andreas

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.