Hi,
I am trying to make a query(SPARQL) where given a folder I can list content of all resources in that folder. For example: A query with inbox as an endpoint that shows me the title and summary of all the notifications that are inside that folder.
Hi Christian, unfortunately Solid does not currently support SPARQL queries on Pods, so youāll have to fetch the contents of all those files individually, Iām afraid.
let contents = await rdf.query( containerURI, `
SELECT ?uri ?size WHERE {
<> ldp:contains ?uri.
?uri stat:size ?size.
}
`)
for(var c of contents){
let thisNotifcation = c.uri
// send a second query to c.uri to get data in each notification)
}
I stopped development of rdf-easy because there are already so many rdf handlers and I have too many libraries to maintain. But I always did kind of like it. You should be able to clone or download the github repo. Let me know if you end up using it.
I get the following error. I also tried with solid-auth-client with no luck.
Error: Fetcher: https://jorge.pod.ideniox.com/outbox/cache.ttl Unauthenticated
at Fetcher.failFetch (fetcher.js:1112)
at fetcher.js:1815
at async RDFeasy._load (rdflib-easy.js:82)
at async RDFeasy._runQuery (rdflib-easy.js:32)
at async RDFeasy.query (rdflib-easy.js:24)
at async getNotifications (things.js:331)
at async Notification.load (notification.js:11)
I understand you may not be in the mood to look onto a issue of a code you are not longer maintaining. Would you kindly be able to recommend any rdf handler?
If you want to, you can probably fix that by changing two lines in rdf-easy.js. Find the two lines that define the fetcher.
// CHANGE THIS IN BOTH PLACES IT OCCURS
this.fetcher = $rdf.fetcher(this.store,{fetch:this._auth.fetch})
// TO THIS
this.fetcher = $rdf.fetcher(this.store,{fetch:this._auth.fetch.bind(this._auth)})
If you try that and it works for you, let me know. See this list of alternative linked data libraries. Query-LDflex and Tripledoc are both very robust and well-maintained.
If you have more questions about rdf-easy, Iām glad to try to answer them. @bourgeoa had talked about reviving and adding to the project so itās not impossible it will continue.
I have tried your suggestion but I got the same error. I am just trying to do select query and update query ttl the same way that solid does it for trusted apps for instance.
using solid-auth-client instead of solid-auth-cli I get
query.js:616 Uncaught TypeError: Cannot read property āinitBindingsā of undefined
at query.js:616
You have to use the same auth library as when you login. Solid-auth-client is for browsers and solid-auth-cli is for nodejs so if youāre in a browser, only use solid-auth-client or the newer @inrupt/solid-client-authn-browser.
Are you saying that the output is literally that, i.e. literally the string āNamedNodeā as opposed to a NamedNode object? Because if itās a NamedNode object, that is what Iād expect the return to be. And Iād expect to be able to get the subject NamedNodeās value with what I showed in the example above: results[ā?sā].value.