How to query SOLID server using GET requests and the SPARQL protocol?

Hi everyone!!
I read in the Solid HTTPS REST API Spec that by means of GET requests using the SPARQL protocol you can run queries on the server, but I can’t get any results. The GET request I’m sending is: https://christianpelaez98.solid.community/ejemplos/ruta1.ttl?query=SELECT%20*%20WHERE%20{%20%3Fs%20%3Fp%20%3Fo%20.%20}
It should returns me my name but it returns me the complete content of the card.

Does anyone know why this happens?
Thanks in advance!!! :blush::blush:

Could this discussion help you https://github.com/solid/node-solid-server/issues/962 ?

Oww thanks a lot!! I didn’t see that issue :sweat_smile::sweat_smile:

SPARQL querying can be done on Solid pods from the client side. The Comunica engine is 1.1. compliant but you’d need to build something on top of it to use it. rdflib handles a subset of SPARQL 1.1. RDF-easy provides a light layer on top of rdflib and lets you so things like

  // log the urls and sizes of all files in a container                                                  
  //                                                                                                     
  let files = await rdfEasy.query( containerURI,
   `SELECT ?url ?size WHERE {
      <> ldp:contains ?url.
      ?url stat:size ?size.
    }`
  )
  for(var f of files){ console.log(f.url,f.size) }

2 Likes

All right, I’ll try it. Right now I’m using your sparql-fiddle API, its great!!!

2 Likes