nodeSolidServer / node-solid-server

Solid server on top of the file-system in NodeJS
https://solidproject.org/for-developers/pod-server
Other
1.78k stars 303 forks source link

SPARQL UPDATE queries over jsonld files stored in SOLID? #1220

Open aorumbayev opened 5 years ago

aorumbayev commented 5 years ago

Hello,

I was wondering if it is possible to execute SPARQL UPDATE queries over jsonld files in solid ? From what I have tried so far, I only had success with .ttl files.

Some additional things I've tried: • Comunica sparql works great for search queries over jsonld files in solid but they don't support update queries :/ All I want is a plain simple ability to rename some string properties in the files without removing the whole jsonld and adding it back.

• Using Rdflib, I tried serialising jsonld to turtle, storing it on solid as turtle and every time I fetch it I would then serialise it back to jsonld when I fetch it. However it produces the error and can't parse it back to jsonld (Error translating between RDF formats)

Reference to more detailed issue description on SOLID Community Forum

jaxoncreed commented 5 years ago

Node solid server does not currently support SPARQL. It's best to read the file into your client, perform SPARQL manipulations there, then write it back to the server.

aorumbayev commented 5 years ago

@jaxoncreed thanks for letting me know, ill be waiting for the support to roll out then :)

I wonder if inrupt.net uses the instance of node-solid-server because I was apple to execute a Sparql update via Patch request to a .ttl file stored in a pod provided by inrupt.

jaxoncreed commented 5 years ago

It does not. Were you using communica? I believe communica has built-in client-side SPARQL.

aorumbayev commented 5 years ago

@jaxoncreed hmm, this is strange,

No I just send a direct PATCH request with Postman here is the example

curl -X PATCH \
  https://aorumbayevv2.inrupt.net/wed22/configurations/test.ttl \
  -H 'Content-Type: application/sparql-update' \
  -H 'Postman-Token: add1d4f1-a833-4a13-9915-e69c106fb8de' \
  -H 'cache-control: no-cache' \
  -d '@prefix lpa: <https://w3id.org/def/lpapps#> .

DELETE 
{ ?subject lpa:title ?test . }
INSERT
{ ?subject lpa:title "Copper Davidfield" . }
WHERE
{ ?subject lpa:title ?test }
'
jaxoncreed commented 5 years ago

Well... Looks like it does have a SPARQL parser (https://github.com/solid/node-solid-server/blob/master/lib/handlers/patch.js#L18)

I wouldn't trust this 100% though, it's not something we're actively supporting at the moment. In the future, it will be.

aorumbayev commented 5 years ago

@jaxoncreed do you guys have some kind of a implementation roadmap that other developers using the node-solid-server could track while awaiting for new features ?

Also I think it would have been great to include minor descriptions into Github releases to see what's new in that release.

jaxoncreed commented 5 years ago

At the moment node-solid-server does not have a roadmap. Any new pull requests are welcome and if you want to stress a need for something I encourage you to join our community meetings https://www.w3.org/community/solid/wiki/Meetings