Accessing pods linked to my webID

Hello,

I am currently trying to access a pod related to my webID on my local CSS. For that I need to retrieve the URI of that pod through the following code:

import com.inrupt.client.webid.WebIdProfile;

// ...

public Set<URI> getPods(String webID) {
    try (final var profile = client.read(URI.create(webID), WebIdProfile.class)) {
         return profile.getStorages();
    }
}

However when I execute this code, I receive a null object from the getStorages() function. What would be the problem for this or what am I doing wrong? Currently I have 1 pod linked to my webId on my local css.

image
image

I am assuming this is Inrupt’s Java library? I’m not familiar with that, but CSS does not expose the Pod URI on your WebID by default, so I’m guessing that that’s the reason.

(Unfortunately the workaround is a bit of a hassle that isn’t guaranteed to work, and requires a bit too much work to write out for me, so maybe a CSS person can help you with that, or you could try reading my implementation of it.)

1 Like

I’ve read the discussion you provided and it seems to be that way indeed. However this is a discussion form 2 years ago and I guess several things have changed about the solid specification and the CSS itself.

I’ll try asking it on the CSS discussions page on Github because I would really like it to work with the java client library that Inrupt provides.

I guess that it would also be possible to work with the JSON API of the CSS and simply save all pod URLs from a webId in an excel sheet for example.

Thanks anyway for your help!

2 Likes

Aha, I was wondering about this and now there is a definitive example – how did other people deal with the CSS default behaviour : )

Hadn’t seen that previously, so I developed a separate helper library containing a function for this purpose. It used some other library for parsing Link header (which came with its own story… maybe I should have used Inrupt’s solid-client if I knew it initially), which may or may not be better depending on the user.

1 Like