@inrupt/solid-client / profile/webid

Module: profile/webid#

Type Aliases#

ProfileAll#

Ƭ ProfileAll<T>: Object

Type parameters#

Name

Type

T

extends SolidDataset & WithServerResourceInfo

Type declaration#

Name

Type

altProfileAll

SolidDataset & WithServerResourceInfo[]

webIdProfile

T

Defined in#

src/profile/webid.ts:36

Functions#

getAltProfileUrlAllFrom#

getAltProfileUrlAllFrom(webId, webIdProfile): UrlString[]

List all the alternative profiles IRI found in a given WebID profile.

Note that some of these profiles may be private, and you may not have access to the resulting resource.

Parameters#

Name

Type

Description

webId

string

The WebID of the user’s whose alternative profiles you are discovering.

webIdProfile

Readonly<{}>

The WebID profile obtained dereferencing the provided WebID.

Returns#

UrlString[]

A list of URLs of the user’s alternative profiles.

Since

1.20.0

Defined in#

src/profile/webid.ts:52


getPodUrlAll#

getPodUrlAll(webId, options?): Promise<UrlString[]>

Discover the Pods an agent advertises for in their profile resources. Both the agent’s WebID and alternative profiles are fetched. Note that this function will only return URLs of Pods linked to using the pim:storage, i.e. a triple looking like <myWebid, pim:storage, myPodUrl> should appear in the profile resources.

Parameters#

Name

Type

Default value

Description

webId

string

undefined

The WebID of the agent whose Pods should be discovered

options

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> }>

internal_defaultFetchOptions

Optional parameter - options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns#

Promise<UrlString[]>

a Promise resolving to an array containing the URLs of all the Pods linked from the agent’s profile resource using the pim:storage predicate.

Since

1.18.0

Defined in#

src/profile/webid.ts:160


getPodUrlAllFrom#

getPodUrlAllFrom(profiles, webId): UrlString[]

Discover the Pods advertised for in the provided profile resources. Note that this function will only return URLs of Pods linked to using the pim:storage predicate, i.e. a triple looking like <myWebid, pim:storage, myPodUrl> should appear in the profile resources.

Parameters#

Name

Type

Description

profiles

ProfileAll<Readonly<{}> & WithResourceInfo & { }>

The profile resources in which the Pods should be discovered

webId

string

The WebID of the agent whose Pods should be discovered

Returns#

UrlString[]

An array containing the URLs of all the Pods linked from the agent’s profile resource using the pim:storage predicate.

Since

1.18.0

Defined in#

src/profile/webid.ts:182


getProfileAll#

getProfileAll<T>(webId, options?): Promise<ProfileAll<T>>

Get all the Profile Resources discoverable from a WebID Profile.

A WebID Profile may be any RDF resource on the Web, it doesn’t have to be a Solid resource. That is why, in order to expose a Solid-enabled part of their profile, some WebID profiles link to one or more Extended Profile Resources, which may are Solid resources. A WebID resource should be public, so getProfileAll will issue an unauthenticated request to the WebID, and only use the provided authenticated fetch (if any) to access extended profile documents.

Type parameters#

Name

Type

T

extends Readonly<{}> & WithResourceInfo & { }

Parameters#

Name

Type

Description

webId

string

WebID of the agent you want the profile of.

options?

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> } & { webIdProfile: T }>

Optional parameter - options.webIdProfile: The data retrieved when looking up the WebID. This will be fetched if not provided. - options.fetch: An alternative fetch function to make the HTTP request, compatible with the browser-native fetch API.

Returns#

Promise<ProfileAll<T>>

Promise resolving to an array of [[SolidDataset]], each corresponding to a personal profile document discoverable from the WebID Profile Document. If none are found, the WebID profile document itself is returned.

Since

1.16.0

Defined in#

src/profile/webid.ts:90

getProfileAll(webId, options?): Promise<ProfileAll<SolidDataset & WithServerResourceInfo>>

Parameters#

Name

Type

webId

string

options?

Partial<{ fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response> } & { webIdProfile: undefined }>

Returns#

Promise<ProfileAll<SolidDataset & WithServerResourceInfo>>

Defined in#

src/profile/webid.ts:100


getWebIdDataset#

getWebIdDataset(webId): Promise<ReturnType<typeof getSolidDataset>>

Get the WebID Profile document dataset.

Parameters#

Name

Type

Description

webId

string

The WebID of the agent whose WebID Profile dataset is to be fetched.

Returns#

Promise<ReturnType<typeof getSolidDataset>>

a SolidDataset for the WebID Profile document.

Example

const webId = "https://example.org/people/me";
const profile = await getWebIdDataset(webId);
const podRoot = getPodUrlAllFrom({ webIdProfile: profile, altProfileAll: [] }, webId);
const profileThing = getThing(profile, webId);
const name = getStringNoLocale(profileThing, FOAF.name);

Since

1.24.0

Defined in#

src/profile/webid.ts:216