How to store an Object rather than a URL for an activity using LDflex?


#1

I’d like to store Likes of web pages as activities on a user’s Pod. I can use @solid/query-ldflex to store a Like activity with a link as the object as such:

await data.resolve(`[${target}].createActivity("${data.context.as}Like")`);

However, I’d like to also store the name of the page. As I understand it, the Page Object from the ActivityStreams spec should cover that use case, but I’m not quite sure how to go about that with @solid/query-ldflex, or whether that’s even possible in the first place. Do I need to add the Page to the user’s POD as well (and if so, how?) and then set that as the target? Or can I somehow define the object inline?

Just getting my feet wet here, so I’m guessing I’m still not fully grasping some concepts.


Poddit - link sharing app
#2

Having worked on this some more, I think this is not something @solid/query-ldflex can do. Thus, I’ve resorted to using rdflib. Documentation is somewhat sparse, especially when it comes to inserting data, but this other forum post helped somewhat, for those coming across this in the future: RDFLIB documentation