comunica / comunica-feature-solid

📬 Comunica packages for query execution over Solid data pods
Other
3 stars 4 forks source link

INSERT DATA query on solid pod throws UnsupportedMediaTypeHttpError #31

Closed pbonte closed 2 years ago

pbonte commented 2 years ago

Issue type:


Description:

When inserting data using the SPARQL INSERT DATA clause on a solid pod, an UnsupportedMediaTypeHttpError is thrown. Inspecting the payload of the message sent from comunica to the solid server shows that a stream object [object ReadableStream] is transmitted (instead of the content of the stream). The following code fragment was used to insert the data:

await this.comunica.queryVoid("INSERT DATA { <ex:s> <ex:p> <ex:o> }", {
                sources: [this.baseUrl+"todo.ttl"],
                "@comunica/actor-http-inrupt-solid-client-authn:session": getDefaultSession(),
        });

Fixing the destination types did not solve the problem.


Environment:

software version
Comunica Engine 2.0.6
node v16.13.2
npm 8.1.2
yarn 1.22.10
Operating System darwin (Darwin 20.6.0)

Crash log:

https://pastebin.com/EFNFhAR7

github-actions[bot] commented 2 years ago

Thanks for reporting!

rubensworks commented 2 years ago

I just tested this within my pod on solidcommunity.net via Node.js, and everything seems to be working just fine.

Could you provide additional details on what you're doing differently?

rubensworks commented 2 years ago

Ok, so the root cause of this issue is that apparently browsers don't yet support passing ReadableStream as body to fetch, and they just stringify it instead:

So I'll look into a temporary workaround.

rubensworks commented 2 years ago

Fixed in Comunica 2.2.1. (Might require a lockfile+node_modules reset)