Using SPARQL on Solid Data


#1

I would like to access RDF triples that are stored on my Pod. From the documentation I read here: https://github.com/solid/solid-spec/blob/master/api-rest.md, it seems that all the data stored in your pod acts as a SPARQL endpoint.

To implement this I tried storing some rdf test data in a public folder on my Pod. I then attempted to send a url encoded get request to query on my test data.

I first tried it in my browser with: https://myusername.solid.community/public/test.rdf?query=SELECT%20*%20WHERE%20%7B%20%3Fs%20%3Fp%20%3Fo%20.%20%7D
This did not give me the expected results. I simply got my page with the file, with “SELECT * WHERE { ?s ?p ?o . }” next to the toolbar of my Pod.

I also tried to use curl, curl https://myusername.solid.community/public/test.rdf?query=SELECT%20*%20WHERE%20%7B%20%3Fs%20%3Fp%20%3Fo%20.%20%7D
This only returned the actual rdf triple file, which would not have been the result of the query.

If anyone with experience using SPARQL on Solid could provide any help, I would greatly appreciate it!


#2

You might take a look at SPARQL fiddle which has both an online playground for using SPARQL against RDF on Solid and an API for querying Solid RDF via SPARQL in javascript. These work by using rdflib.js to perform the queries client-side. I am not sure about the status of the spec for SPARQL at the server level. Anyone?


#3

Thanks for the reply! I did see this when I initially searched the forum before posting, and will definitely check it out.


#4

Hi @JacobMcConomy. I was also confused by the lack of sparql support for my pod when reading https://github.com/solid/solid-spec/blob/master/api-rest.md#alternative-using-sparql. https://github.com/solid/node-solid-server/issues/962 indicates it hasn’t been implemented yet