angelo-v on tailwind-profile-poc
WIP: PoC tailwind profile pane (compare)
michielbdejong on use-solid-auth-fetcher
Merge remote-tracking branch 'o… storybook build is broken in th… (compare)
solid-client-authn-browser
is going to have the options that you need, because (if I understand correctly), you are designing UX around creating a user account on the Solid Identity Provider and/or the Pod server, which is out of the scope of solid-client-authn-browser
. As a matter of fact (and as surprising as it may be), it's even out of the scope of OIDC :)
<a href="https://trinpod.us/registration">Get a Solid Pod</a>
wouldn't work?
actions: {
async loadDataSet ({state}, uri){
uri = u.getURI(uri)
if (uri){
var ds = state.dataSets[uri]
//add head ping etc here to check if any server changes
// set ds to null if changes happened
if (ds){
return ds
} else {
var currentThing = state.things[uri]
var ds = await client.getSolidDataset( uri, {fetch: window.solid.session.fetch})
var dsUri = client.getSourceUrl(ds)
if (currentThing){
currentThing.dataSet = dsUri
Vue.set(state.things, uri, currentThing)
}
var things = client.getThingAll(ds)
$.map(things,function(thing){
thing.dataSet = dsUri
Vue.set(state.things, client.asUrl(thing), thing)
})
Vue.set(state.dataSets, dsUri, ds)
return ds
}
}
},
async loadThing ({state}, uri){
uri = u.getURI(uri)
if (uri){
var thing = state.things[uri]
if (thing){
return thing
} else {
var ds = await dispatch('loadDataSet',uri)
thing = state.things[uri]
return thing
}
}
},
actions: {
async loadDataSet ({state}, uri){
uri = u.getURI(uri)
if (uri){
var ds = state.dataSets[uri]
//add head ping etc here to check if any server changes
// set ds to null if changes happened
if (ds){
return ds
} else {
var currentThing = state.things[uri]
var ds = await client.getSolidDataset( uri, {fetch: window.solid.session.fetch})
var dsUri = client.getSourceUrl(ds)
var dsNode = $rdf.sym(dsUri)
if (currentThing){
currentThing.dataSet = dsUri
Vue.set(state.things, uri, currentThing)
}
var things = client.getThingAll(ds)
if (things){
$.map(things,function(thing){
thing.dataSet = dsUri
thing.quads.forEach(function(quad){
var newObject
var qObject = quad.object
if (qObject.constructor.name === "Literal"){
newObject = new $rdf.Literal(qObject.value,qObject.language,qObject.datatypeString)
} else {
newObject = $rdf.sym(u.getURI(qObject))
}
rdfStore.add($rdf.sym(u.getURI(quad.subject)),
$rdf.sym(u.getURI(quad.predicate)),
newObject,
dsNode)
})
Vue.set(state.things, client.asUrl(thing), thing)
})
}
Vue.set(state.dataSets, dsUri, ds)
return ds
}
}
},
A quick solid-client question. How would one go about getting all quads where a given uri is the object of the quads?
@gibsonf1 (Fred Gibson) Sorry, I missed this in between your code samples :) What exactly are you trying to do? In solid-client you don't tend to work on individual quads, but on Things (i.e. sets of quads with the same subject). So for example, if you wanted all Things of a given type, you'd do something like this:
const bookmarks = getThingAll(resource).filter(thing => getUrl(thing, rdf.type) === bookmark.Bookmark);
So here you get sets of quads with the same subject, for each of which at least one has the URL of bookmark.Bookmark
as the object and the URL of rdf.type
as the predicate.
@gibsonf1 (Fred Gibson) How about this?
const thingsLinkingToTargetThing = allThings.filter(thing => getUrl(thing, "https://your.vocab/predicate", targetThing)
?
allThings
to refer to the cache of Things you are building in your Vuex store.