API documentation
- enum webid.FOAFKind(value)
The kind of FOAF document, for an agent or person.
Valid values are as follows:
- Person = <FOAFKind.Person: 1>
- Agent = <FOAFKind.Agent: 2>
- exception webid.ParseError(*args: object)
- class webid.WebID(url: str, kind: webid.FOAFKind = FOAFKind.Person, oidcissuer: str = '')
Initiates a WebID class. The URL is the primary ID URL.
- Parameters
kind (
webid.FOAFKind
, optional) – The kind of document owner, a person or an agent.oidcissuer (str, optional) – URL of the OIDC provider. Default empty string.
- add_oidc_issuer_registration_token(token: str)
Adds the given registration token to the card.
- Parameters
token (str) – registration token given by the IDP.
- static parse(data: str, publicid: str = '', solid: bool = False) webid.WebID
Parses the given data and creates a WebID.
- Parameters
data (str) – The existing WebID document
publicid (str, optional) – The primary ID URL, this is optional, default empty string.
solid (bool, optional) – If this is a Solid WebID, requires oidcIssuer value in data, default False.
- Raises
ParseError – Means any required WebID tripples is missing.
- Returns
Returns a WebID object
- Return type
- remove_oidc_issuer_registration_token()
Removes registration token from the card (if any)
- serialize() str
Returns a Turtle representation of the WebID document.
- Returns
Returns a Turtle representation along with prefixes (if any).
- Return type
str