I was able to reproduce the error you’re seeing. It should work and I was able to successfully load other resources. Looks like some issue with the content type and could be because it’s returning text/xml rather than application/rdf+xml for the content type
The error message seems to be a bit misleading.
It sounds like it tried several formats, but if it actually had tried rdf+xml it should have succeeded (I assume rdf+xml is a known format).
What about supporting a parameter that allows to override the format (like with a query parameter as I tried)?
Zach is correct here. Stardog uses the Content-Type of the response to determine the file format, and the only acceptable MIME types for RDF/XML are, according to our parser, application/rdf+xml and application/xml.
I will open up a ticket for us to implement some sort of workaround for this case, but in the meantime I would suggest manually downloading the RDF/XML and adding it to Stardog.
I don’t think that it tries formats until it finds one that succeeds. I believe that it will try the content type first, if it’s not one that is supported it might fall back to guessing from the extension. In this case there is no extension and the file type is returning it as text/xml. With that type it could either be TRIX or RDF/XML. It doesn’t seem as though the specs have much about how it should be handled. Adding a parameter to the url would be problematic. You wouldn’t know if it should be used for dereferencing the file and stripped off or if it was actually part of the url and should be passed along. Unfortunately the endpoint isn’t providing enough information to parse the file and some guessing would be involved.
Is there any other HTTP API to upload such data (besides SPARQL-Update)?
I try to avoid the need to reach out to the command line so I’m able to do it from a remote client application.
Otherwise I’d download it into memory, transform it and upload it using INSERT DATA
That’s great, exactly what I was looking for.
I thought I read somewhere that this HTTP API was removed or is deprecated.
I’m new to Stardog. I might have mixed something up.
did the trick.
I found this quite difficult to decipher from the format used for the URL is shown in the docs.
A concrete example without the {} replacements would have been very useful.
We are currently in the process of updating/redoing the apiary docs, however this is the standard way to denote query params as stated in their Docs.
For a simple load such as this, we also support the SPARQL Graph Store Protocol, so instead of beginning a tx, adding the data, committing the tx, you could simply PUT http://localhost:5820/test1?graph=http://qudt.org/1.1/vocab/dimensionalunit with your Content-Type and data set appropriately.