Friendships in Solid Pods

Hi! I am developing a social network application using pods as part of my Software engineering degree.

I am now working on the friendships system. I am trying to use the friendships stored in the pods, but I don’t really know how to do it. As far as I was able to understand, I should use the FOAF knows structure, but I don’t fully understand how to have a bidirectional relationship with it, should I just create one in both of the pods?

The other problem I’m having is that I don’t really understand where that information is stored in the pod. Should it be in the profile? Or in an extended profile? If I have to work with extended profiles, is there any convention of which extended profile to use for friendships?

I am now using the @inrupt/solid-client-authn-node and @inrupt/solid-client libraries to manage pods from a server, but I can try different ways if these are not good options.

Thanks in advance! :slight_smile:

That sounds good, especially if you want one person to send friend/contact request and the other to confirm it. So when both say they know each other, your app could treat them as friends.

I don’t think there is a rule. People often seem to store their foaf:knows in their profile document. (example) But sometimes they store them in extended profile (e.g. friends of timbl, which are hiding behind :i rdfs:seeAlso <https://timbl.com/timbl/public/friends.ttl> triple)

One of my first Solid apps was visualizing these relationships (it’s buggy and it doesn’t differentiate bi-directional friendships, but it works and it gives you an idea about Solid social graph…).

If you choose to store friends in primary profile document, i believe you’ll need to keep them public.
((there is solid:oidcIssuer triple, which i believe needs to be public for authentication. With current document-level permissions, your foaf:knows would have to also remain public.))

Otherwise, it’s probably up to you. Put them in primary document if you want to keep it simple. However, large, or private lists may be better stored elsewhere… just make sure they’re discoverable from the main profile.

So, to show friendships, try to fetch them in both profile document and extended profile documents. To store them, that depends on your design and app needs, or your users’ preferences.

The above is just my educated opinion. Maybe wait for other people’s ideas before jumping into implementation. My opinion may be limited or wrong. :wink:

2 Likes

Thanks a lot! That really helped clearing my ideas. I’ll think about how to make use of it for my project and hopefully someone else can give their point of view in the meanwhile :smile:

1 Like

People often seem to store their foaf:knows in their profile document.

Note that the WebID profile document is not necessarily a writable Solid Resource as the Solid Specification does not mandate that it live in your storage(s); so make sure your app does not assume that it will be able to write to that document.