Software Development Kit for Data Reuse
This specification describes an SDK to facilitate development of software applications concerned with data reuse, in particular the with the legal aspect of consent. It consists of two parts.
First, a set of interfaces that model the different parts and actors in the process, and which are used by the multiple components provided as another deliverable of this project. These models are designed with broad use cases in mind, and therefore contain a number of optional fields that may or may not be useful depending on the use case. Furthermore, all of these models are compatible with other Digita products and research projects.
Second, the SDK bundles an interface modeling the interaction between client applications, identity providers and Solid pod servers. This interface is inspired by the popular Inrupt SDK, and we provide a version of this package, repackaged for browser use, as an initial implementation of the interface.
Create the following interfaces.
LDNode, containing any
uri, and an optional
LDTriple, containing a string
predicateand two LDNodes
Session, containing a string
Profile, containing two strings,
Holder, containing three strings,
shape(optional), and an optional array
Purpose, containing three mandatory strings,
uri, three optional strings
exchange, a mandatory array of strings named
predicatesand an optional array
Source, containing four mandatory strings,
uri, two optional strings
exchange, an unknown mandatory
configuration, an optional
not prepared, and an optional array `triplesof LDTriples.
Invite, containing five mandatory strings,
uri, four optional strings
exchange, a mandatory state being either
linked, and an optional array
Create an interface with the following asynchronous functions.
getIssuer, returning a string from a webId string;
getProfile, returning a Profile from a webId string;
getSession, returning a Session;
login, taking a webId string;
Create a class importing the Inrupt SDK and implementing the Solid service interface as follows.
getIssuer: if the webId is a valid URL, retrieve the profile with Inrupt’s
getThing, lookup the issuer with Inrupt’s
getUrl, check the issuer’s OpenID Configuration, and return the issuer if valid.
getProfile: if the webId is a valid URL, retrieve the profile with Inrupt’s
getThing, lookup the profile’s FOAF name with Inrupt’s
getStringNoLocale, and return a Profile with the webId and the name.
getSession: call Inrupt’s
handleIncomingRedirect, then check if the returned session is logged in; if so, return the session, else reject.
login: call the
getIssuerfunction, and then Inrupt’s login function with the returned value as
oidcIssuer`and the current browser url as `redirectUrl.
logout: simply call the Inrupt logout function.