Aller au contenu principal

WebID

This service allows you to create and view WebID-conform profiles.

Features#

  • CRUD operations in WebID
  • Storage in triple store

Dependencies#

Install#

$ npm install @semapps/webid --save

Usage#

const { WebIdService } = require('@semapps/webid');
module.exports = {
mixins: [WebIdService],
settings: {
usersContainer: 'http://localhost:3000/users/'
}
};

Settings#

PropertyTypeDefaultDescription
usersContainerStringrequiredURI of the container where WebIDs will be stored

Actions#

The following service actions are available:

create#

Parameters#
PropertyTypeDefaultDescription
emailstringrequiredEmail address
nickstringFirst part of the email addressNickname
namestringnameName
familyNamestringnullFamily name
homepagestringnullUser's website
Return#

Object - Created profile

view#

Parameters#
PropertyTypeDefaultDescription
userIdstringThe webId of the logged userUser's slug
Return#

Object - User's profile

edit#

Parameters#
PropertyTypeDefaultDescription
userIdstringThe webId of the logged userUser's slug
emailstringnullEmail address
nickstringnullNickname
namestringnameName
familyNamestringnullFamily name
homepagestringnullUser's website
Return#

Object - Modified profile

list#

Return#

String - LDP container with all registered users

Events#

The following events are emitted.

webid.created#

Sent after a new profile is created.

Parameters#

Object - Created profile