SolidLabResearch / generic-data-viewer-react-admin

MIT License
0 stars 1 forks source link

cors problem when querying over jsonld file with vc #131

Closed elsdvlee closed 2 months ago

elsdvlee commented 3 months ago

No results for queries over jsonld resources with VC. image

mvanbrab commented 3 months ago

Explanation of the CORS problem:

But...

So... what's happening here? Maybe some extra testcase info will help.

mvanbrab commented 3 months ago

This happens on the https://pod.playground.solidlab.be/, logged in as user1@pod.playground.solidlab.be:

image

(The Accept header in the request is as intended)

mvanbrab commented 2 months ago

Info: same exercise on https://css11.onto-deside.ilabt.imec.be works. Is this an issue of the playground?

bjdmeest commented 2 months ago

This happens on the https://pod.playground.solidlab.be/, logged in as user1@pod.playground.solidlab.be:

image

(The Accept header in the request is as intended)

What's the actual result when you're logged in? nquads or jsonld? Maybe the playground for some reason can't handle graphs?

mvanbrab commented 2 months ago

On the Solid Playground, the returned content type is application/ld+json. On our CSS it is application/n-quads. Same code calling in both cases, same request headers etc...

Many details in illustrations below.

Questions:

When logged in to CSS

Overview

CSS11

Headers on the GET of products

CSS11_GET_products

When logged in to Solid Playground:

Overview

SolidPlayground

Headers on the GET of products

SolidPlayground_GET_products

Viewer configuration and query used

config.json

electronics_products.rq.txt

bjdmeest commented 2 months ago

The only thing I can think of is that the playground for some reason doesn't support quads, and you could try accept: text/turtle before jsonld to see whether that solves it. turtle is a MUST for LDP, so we should at least assume every server can handle that one

mvanbrab commented 2 months ago

More observations:

original (goes wrong, returns application/ld+json)

Accept: application/n-quads,application/trig;q=0.95,application/ld+json;q=0.9,application/n-triples;q=0.8,*/*;q=0.1

original modified: delta between q factors 0.1 (works, returns application/n-quads)

Accept: application/n-quads,application/trig;q=0.9,application/ld+json;q=0.8,application/n-triples;q=0.7,*/*;q=0.1

original modified: delta between q factors 0.1 and replaced application/ld+json with text/turtle (works, returns application/n-quads)

Accept: application/n-quads,application/trig;q=0.9,text/turtle;q=0.8,application/n-triples;q=0.7,*/*;q=0.1

The problem is that in contrast with the CSS's (v7.0.2) on https://....onto-deside.ilabt.imec.be/, the CSS in the Solid Playground https://pod.playground.solidlab.be/ (v7.x.x) does not follow q factor priorities as expected with the q values in the original Accept header we were using. This seems solved by changing the q factors so that they differ at least 0.1, see the second Accept header above. I filed an issue for that in the CSS repo.

Finally, for the viewer I'll use the third Accept header, not mentioning application/ld+json at all.