I have a question about what would be the best way/tool to store user’s defaults for my application?
By user’s defaults I mean, for example: default folder to store the data for current user or the default theme that the user chose (light/dark).
Thank you in advance!
If your app is operating on a user’s pod, authenticated as that user, then these kind of defaults should be stored in the document pointed to in the profile with the pim:prefrencesFile predicate, e.g. something like.
<?WebID> pim:preferencesFile </settings/prefs.ttl>.
In the prefs file, you can store your defaults and no one but other apps authenticated as the user will be able to see them.
If your defaults apply to an app that operates as the public or as a specific user other than the user, you should put your defaults in a file using the rdfs:seeAlso predicate, So the profile document would have , something like
<?WebID> rdfs:seeAlso <?someFile>.
Where ?someFile had the appropriate access permissions.
A special case is when you want to store data of a particular kind, e.g. a Bookmark. In that case you should put the location in either the publicTypeIndex or privateTypeIndex files.
We are working on a webid-profile specification to spell all of this out, for the time being you can refer to solid-spec/solid-webid-profiles.md at master · solid/solid-spec · GitHub which will be pretty similar in most respects to the upcoming specification
Might be interesting to see from userland what sort of APIs and ways for interacting with these common datasets/predicates are used (I don’t think we’re against higher level API s in the Inrupt SDK for these, but we just haven’t built such yet).
Is this something that your working group might explore at all Jeff?