Carbon LDP JavaScript SDK API Reference

Exported Elements




Classes

C
CarbonLDP.Auth.BasicCredentials
Wrapper to manage Authentication Credentials in form of Username/Password.




Wrapper to manage Authentication Credentials in form of Username/Password.


Constructor


BasicCredentials( username:string, password:string )

Param Type Default Description
username string
password string

Properties

.password
: string


.username
: string





Classes

C
CarbonLDP.Auth.BasicToken
Wrapper to manage an Authentication Token in form of Username/Password.




Wrapper to manage an Authentication Token in form of Username/Password.


Constructor


BasicToken( username:string, password:string )

Param Type Default Description
username string
password string

Properties

.password
: string


.username
: string





Interfaces

I
CarbonLDP.Auth.CredentialsSet
Interface that describe the document that contains all the credentials of a user.
I

Properties




Interface that describe the document that contains all the credentials of a user.


Properties







Interfaces

I
CarbonLDP.Auth.LDAPCredentials
Interface that represents an in-memory LDAPCredentials of a user.
I
CarbonLDP.Auth.LDAPCredentialsFactory
Interface with the factory for CaronLDP.Auth.LDAPCredentials objects

Properties




Interface that represents an in-memory LDAPCredentials of a user.


Properties

.ldapServer
: string

URI of the LDAP Server document.


.ldapUserDN
: string

User identification in the LDAP Server.





Interface with the factory for CaronLDP.Auth.LDAPCredentials objects


Properties




Interfaces

I
CarbonLDP.Auth.TokenCredentials
Interface that represents an authentication token for every context.
I
CarbonLDP.Auth.TokenCredentialsBase
Interface that represents the base properties for an authentication token credentials.
I
CarbonLDP.Auth.TokenCredentialsBaseFactory
Interface with the factory and utils for CarbonLDP.Auth.TokenCredentialsBase objects.
I
CarbonLDP.Auth.TokenCredentialsFactory
Interface with the factory and utils for CarbonLDP.Auth.TokenCredentials objects.

Properties




Extends:
Carbon.LDP.VolatileResource

Interface that represents an authentication token for every context.


Properties

.expiresOn
: Date

The time when the token will expire.


.token
: string

The value to provide as the authentication token in the headers of a a request.





Interface that represents the base properties for an authentication token credentials.


Properties

.expiresOn
: Date

The time when the token will expire.


.token
: string

The value to provide as the authentication token in the headers of a a request.





Interface with the factory and utils for CarbonLDP.Auth.TokenCredentialsBase objects.


Methods

.is()
: value is CarbonLDP.Auth.TokenCredentialsBase


is( value:any ):value is CarbonLDP.Auth.TokenCredentialsBase

Returns true if the object provided is considered a CarbonLDP.Auth.TokenCredentialsBase object.


Param Type Default Description
value any




Interface with the factory and utils for CarbonLDP.Auth.TokenCredentials objects.


Properties

.SCHEMA
: Carbon.ObjectSchema.Class


.TYPE
: string


Methods

.createFrom()
: T & CarbonLDP.Auth.TokenCredentials


createFrom<T extends CarbonLDP.Auth.TokenCredentialsBase>( object:T ):T & CarbonLDP.Auth.TokenCredentials


Param Type Default Description
object T


.is()
: value is CarbonLDP.Auth.TokenCredentials


is( value:any ):value is CarbonLDP.Auth.TokenCredentials

Returns true if the object provided is considered a CarbonLDP.Auth.TokenCredentials object.


Param Type Default Description
value any




Classes

C
CarbonLDP.AbstractContext
Abstract class for defining contexts.




Abstract class for defining contexts.


Constructor


AbstractContext()


Properties

.parentContext
: CarbonLDP.Context

The parent context provided in the constructor. If no context was provided, this property will be the singleton carbonldp/SDKContext#globalContext of the class CarbonLDP.SDKContext.


Methods

.resolve()
: string


resolve( relativeURI:string ):string

Abstract method that returns an absolute URI in accordance to the context scope from the relative URI provided.


Param Type Default Description
relativeURI string




Interfaces

I
CarbonLDP.AccessPoint
Interface that represents the document of an in-memory access point.
I
CarbonLDP.AccessPointBase
Interface that represents the basic properties to construct a CarbonLDP.AccessPoint.
I
CarbonLDP.AccessPointFactory
Interface with the factory, decorate and utils methods of a CarbonLDP.AccessPointFactory object.

Properties

#AccessPoint
: CarbonLDP.AccessPointFactory

Constant that implements the CarbonLDP.AccessPoint interface.





Interface that represents the document of an in-memory access point.


Properties

.hasMemberRelation
: CarbonLDP.Pointer

Pointer that represents the member relation that the access point will manage.


.insertedContentRelation
: CarbonLDP.Pointer

Pointer that represents the inserted content relation of the access point.


.isMemberOfRelation
: CarbonLDP.Pointer

Pointer that represents the inverted relation that the access point will create.





Interface that represents the basic properties to construct a CarbonLDP.AccessPoint.


Properties

.hasMemberRelation
: string | CarbonLDP.Pointer

The string URI or pointer URI that represents the member relation that the access point will manage.


.insertedContentRelation
: string | CarbonLDP.Pointer

The string URI or pointer URI that represents the inserted content relation of the access point.


.isMemberOfRelation
: string | CarbonLDP.Pointer

The string URI or pointer URI that represents the inverted relation that the access point will create.





Interface with the factory, decorate and utils methods of a CarbonLDP.AccessPointFactory object.


Properties

.TYPE
: string


Methods

.create()
: CarbonLDP.AccessPoint


create( membershipResource:CarbonLDP.Pointer, hasMemberRelation:string | CarbonLDP.Pointer, isMemberOfRelation?:string | CarbonLDP.Pointer ):CarbonLDP.AccessPoint

Creates a CarbonLDP.AccessPoint object with the parameters specified.


Param Type Default Description
membershipResource CarbonLDP.Pointer

A Pointer to the parent of the AccessPoint.

hasMemberRelation string | CarbonLDP.Pointer

A URI or Pointer to the property in the parent resource managed by the AccessPoint.

isMemberOfRelation string | CarbonLDP.Pointer

A URI or Pointer to the property managed in the members added by the AccessPoint.



.createFrom()
: T & CarbonLDP.AccessPoint


createFrom<T extends object>( object:T, membershipResource:CarbonLDP.Pointer, hasMemberRelation:string | CarbonLDP.Pointer, isMemberOfRelation?:string | CarbonLDP.Pointer ):T & CarbonLDP.AccessPoint

Creates a CarbonLDP.AccessPoint object from the object and parameters specified.


Param Type Default Description
object T

Object that will be converted into an AccessPoint.

membershipResource CarbonLDP.Pointer

A Pointer to the parent of the AccessPoint.

hasMemberRelation string | CarbonLDP.Pointer

A URI or Pointer to the property in the parent resource managed by the AccessPoint.

isMemberOfRelation string | CarbonLDP.Pointer

A URI or Pointer to the property managed in the members added by the AccessPoint.



.is()
: object is CarbonLDP.AccessPoint


is( object:object ):object is CarbonLDP.AccessPoint

Returns true if the object provided is considered a CarbonLDP.AccessPoint object


Param Type Default Description
object object







Interfaces

I
CarbonLDP.Auth.PersistedACE
Interface that represents a persisted Access Control Entry (ACE) of a persisted Access Control List (ACL).




Interface that represents a persisted Access Control Entry (ACE) of a persisted Access Control List (ACL).


Properties

.document
: CarbonLDP.Auth.PersistedACL

Reference to the persisted ACL where the current ACE belongs.





Interfaces

I
CarbonLDP.Auth.ACL
Interface that represents an in-memory Access Control List (ACL).
I
CarbonLDP.Auth.ACLFactory
Interface with factory, decorate and utils methods for CarbonLDP.Auth.ACL objects.

Properties

#ACL
: CarbonLDP.Auth.ACLFactory

Constant that implements the CarbonLDP.Auth.ACLFactory interface.





CarbonLDP.Auth.ACL
Interface

Interface that represents an in-memory Access Control List (ACL).


Properties

.accessTo
: CarbonLDP.Pointer

Reference to the document the ACL belongs.


.entries
: CarbonLDP.Auth.ACE[]

Array of ACEs that only grants or denies permissions of the document the ACL belongs.


.inheritableEntries
: CarbonLDP.Auth.ACE[]

Array of ACEs that grants or denies permissions of the document's children the ACL belongs.


Methods

._parsePointer()
: CarbonLDP.Pointer


_parsePointer( element:string | CarbonLDP.Pointer ):CarbonLDP.Pointer

(Internal) Function that parse string URIs to pointers.


Param Type Default Description
element string | CarbonLDP.Pointer

The URI string o pointer to convert into pointer.



.configureChildInheritance()
: void


configureChildInheritance( granting:boolean, subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Configures the permission specified to the subject provided either granting or denying it for the children of the document related to the ACL.


Param Type Default Description
granting boolean

Boolean to indicate if the permission will be granted o denied.

subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the subject specified.



configureChildInheritance( granting:boolean, subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Configure several permissions to the subject provided either granting or denying them for the children of the document related to the ACL.


Param Type Default Description
granting boolean

Boolean to indicate if the permission will be granted o denied.

subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the subject specified.



configureChildInheritance( granting:boolean, subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Configure the permission specified to the every subject provided either granting or denying it for the children of the document related to the ACL.


Param Type Default Description
granting boolean

Boolean to indicate if the permission will be granted o denied.

subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the every subject.



configureChildInheritance( granting:boolean, subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Configure several permissions to the every subject provided either granting or denying them for the children of the document related to the ACL.


Param Type Default Description
granting boolean

Boolean to indicate if the permission will be granted o denied.

subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the every subject.



.denies()
: boolean


denies( subject:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):boolean

Returns true if the subject has a configuration where it denies the permission specified for the document related to de ACL. Returns null if no configuration of the subject and permission exists in the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject to look for its configuration.

permission string | CarbonLDP.Pointer

The permission to check if it has a granting configuration.



.deny()
: void


deny( subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Grant the permission specified to the subject provided for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the subject specified.



deny( subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Grant several permissions to the subject provided for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the subject specified.



deny( subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Grant the permission specified to the every subject provided for the document related to the ACL.


Param Type Default Description
subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the every subject.



deny( subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Grant several permissions to the every subject provided for the document related to the ACL.


Param Type Default Description
subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the every subject.



.getChildInheritance()
: boolean


getChildInheritance( subject:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):boolean

Returns if grants or denies a configuration of the subject and the permission specified for the children of document related to de ACL. Returns null if no configuration of the subject and permission exists in the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject to look for its configuration.

permission string | CarbonLDP.Pointer

The permission to check if it has a granting configuration.



.grant()
: void


grant( subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Grant the permission specified to the subject provided for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the subject specified.



grant( subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Grant several permissions to the subject provided for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the subject specified.



grant( subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Grant the permission specified to the every subject provided for the document related to the ACL.


Param Type Default Description
subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the every subject.



grant( subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Grant several permissions to the every subject provided for the document related to the ACL.


Param Type Default Description
subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the every subject.



.grants()
: boolean


grants( subject:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):boolean

Returns true if the subject has a configuration where it grants the permission specified for the document related to de ACL. Returns null if no configuration of the subject and permission exists in the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject to look for its configuration.

permission string | CarbonLDP.Pointer

The permission to check if it has a granting configuration.



.remove()
: void


remove( subject:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Remove the configuration of a permission from a subject for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject from will be removed the permission.

permission string | CarbonLDP.Pointer

The permission to remove from the subject configuration.



remove( subject:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Remove the configuration of several permissions from a subject for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject from will removed the permission.

permissions (string | CarbonLDP.Pointer)[]

The permissions to remove from the subject configuration.



.removeChildInheritance()
: void


removeChildInheritance( subject:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Remove the configuration of a permission from a subject for the children of the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject from will be removed the permission.

permission string | CarbonLDP.Pointer

The permission to remove from the subject configuration.





Interface with factory, decorate and utils methods for CarbonLDP.Auth.ACL objects.


Properties

Methods

.decorate()
: T & CarbonLDP.Auth.ACl.Class


decorate<T extends object>( object:T ):T & CarbonLDP.Auth.ACl.Class

Decorate the object with the methods o a CarbonLDP.Auth.ACL object.


Param Type Default Description
object T

The object to decorate.



.isDecorated()
: object is CarbonLDP.Auth.ACL


isDecorated( object:object ):object is CarbonLDP.Auth.ACL

Return true if the object provided has the properties and methods of a CarbonLDP.Auth.ACL object.


Param Type Default Description
object object

The object to analise.





.AuthMethod
: enum

Enum with the methods of authentication supported by Carbon LDP.

Enumeration Description
CarbonLDP.Auth.AuthMethod.BASIC

HTTP Basic authentication sending the username and password in every call.

CarbonLDP.Auth.AuthMethod.TOKEN

Authentication with username and password generating a token that will be sent in every call.







Interface that describes the metadata for a user.


Properties

.authenticatedUserMetadata
: CarbonLDP.Auth.AuthenticatedUserMetadata

Fragment for the resource that contains metadata about the authenticated user.











Interface that describes the metadata for a authenticated user.


Properties

.user
: CarbonLDP.Auth.PersistedUser

Reference to the actual authenticated user.








Classes

C
CarbonLDP.Auth.Authenticator
Abstract class that represents the base of an authentication token.




Abstract class that represents the base of an authentication token.


Constructor


Authenticator( context:CarbonLDP.Context ):void

Param Type Default Description
context CarbonLDP.Context

Methods

.addAuthentication()
: CarbonLDP.HTTP.RequestOptions


addAuthentication( requestOptions:CarbonLDP.HTTP.RequestOptions ):CarbonLDP.HTTP.RequestOptions

If the authenticator is authenticated, it adds an authentication header in the request options object provided.


Param Type Default Description
requestOptions CarbonLDP.HTTP.RequestOptions

The request options object where to add the authentication header.



.authenticate()
: W


authenticate( authenticationToken:T ):W

Abstract method that should perform an authentication and store the credentials for future use.


Param Type Default Description
authenticationToken T

The token that will be used to perform the authentication.



.clearAuthentication()
: void


clearAuthentication():void

Removes the stored credentials of any.




.getAuthenticatedUser()
: CarbonLDP.Auth.PersistedUser


getAuthenticatedUser( requestOptions:CarbonLDP.HTTP.GETOptions ):CarbonLDP.Auth.PersistedUser

If the authenticator is authenticated, request the authenticated user using the st credentials.


Param Type Default Description
requestOptions CarbonLDP.HTTP.GETOptions

The request options object where to add the authentication header.



.isAuthenticated()
: boolean


isAuthenticated():boolean

Returns if its authenticated by checking the stored credentials within.






Classes

C
CarbonLDP.Auth.BasicAuthenticator
Authenticates requests using HTTP Basic Authentication.




Authenticates requests using HTTP Basic Authentication.


Constructor


BasicAuthenticator()


Methods

.addAuthentication()
: CarbonLDP.HTTP.RequestOptions


addAuthentication( requestOptions:CarbonLDP.HTTP.RequestOptions ):CarbonLDP.HTTP.RequestOptions

Adds the Basic authentication header to the passed request options object. The CarbonLDP.HTTP.RequestOptions provided is returned without modifications if it already has an authentication header.


Param Type Default Description
requestOptions CarbonLDP.HTTP.RequestOptions

Request options object to add Authentication headers.



.authenticate()
: Promise<CarbonLDP.Auth.BasicCredentials>


authenticate( authenticationToken:CarbonLDP.Auth.BasicToken ):Promise<CarbonLDP.Auth.BasicCredentials>

Stores credentials to authenticate future requests.


Param Type Default Description
authenticationToken CarbonLDP.Auth.BasicToken


.clearAuthentication()
: void


clearAuthentication():void

Clears any saved credentials and restores the Authenticator to its initial state.




.isAuthenticated()
: boolean


isAuthenticated():boolean

Returns true if the instance contains stored credentials.






Interfaces

I
CarbonLDP.Auth.PersistedACL
Interface that represents a persisted Access Control List (ACL).
I
CarbonLDP.Auth.PersistedACLFactory
Interface with factory, decorate and utils methods for CarbonLDP.Auth.PersistedACL objects.

Properties




Interface that represents a persisted Access Control List (ACL).


Properties

.accessTo
: CarbonLDP.Pointer

Reference to the document the ACL belongs.


.entries
: CarbonLDP.Auth.PersistedACE[]

Array of persisted ACEs that only grants or denies permissions of the document the ACL belongs.


.inheritableEntries
: CarbonLDP.Auth.PersistedACE[]

Array of persisted ACEs that grants or denies permissions of the document's children the ACL belongs.


Methods

._parsePointer()
: CarbonLDP.Pointer


_parsePointer( element:string | CarbonLDP.Pointer ):CarbonLDP.Pointer

(Internal) Function that parse string URIs to pointers.


Param Type Default Description
element string | CarbonLDP.Pointer

The URI string o pointer to convert into pointer.



.configureChildInheritance()
: void


configureChildInheritance( granting:boolean, subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Configures the permission specified to the subject provided either granting or denying it for the children of the document related to the ACL.


Param Type Default Description
granting boolean

Boolean to indicate if the permission will be granted o denied.

subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the subject specified.



configureChildInheritance( granting:boolean, subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Configure several permissions to the subject provided either granting or denying them for the children of the document related to the ACL.


Param Type Default Description
granting boolean

Boolean to indicate if the permission will be granted o denied.

subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the subject specified.



configureChildInheritance( granting:boolean, subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Configure the permission specified to the every subject provided either granting or denying it for the children of the document related to the ACL.


Param Type Default Description
granting boolean

Boolean to indicate if the permission will be granted o denied.

subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the every subject.



configureChildInheritance( granting:boolean, subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Configure several permissions to the every subject provided either granting or denying them for the children of the document related to the ACL.


Param Type Default Description
granting boolean

Boolean to indicate if the permission will be granted o denied.

subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the every subject.



.denies()
: boolean


denies( subject:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):boolean

Returns true if the subject has a configuration where it denies the permission specified for the document related to de ACL. Returns null if no configuration of the subject and permission exists in the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject to look for its configuration.

permission string | CarbonLDP.Pointer

The permission to check if it has a granting configuration.



.deny()
: void


deny( subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Grant the permission specified to the subject provided for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the subject specified.



deny( subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Grant several permissions to the subject provided for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the subject specified.



deny( subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Grant the permission specified to the every subject provided for the document related to the ACL.


Param Type Default Description
subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the every subject.



deny( subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Grant several permissions to the every subject provided for the document related to the ACL.


Param Type Default Description
subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the every subject.



.getChildInheritance()
: boolean


getChildInheritance( subject:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):boolean

Returns if grants or denies a configuration of the subject and the permission specified for the children of document related to de ACL. Returns null if no configuration of the subject and permission exists in the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject to look for its configuration.

permission string | CarbonLDP.Pointer

The permission to check if it has a granting configuration.



.grant()
: void


grant( subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Grant the permission specified to the subject provided for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the subject specified.



grant( subject:string | CarbonLDP.Pointer, subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Grant several permissions to the subject provided for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject which will be assigned the permission specified.

subjectClass string | CarbonLDP.Pointer

The type of subject provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the subject specified.



grant( subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Grant the permission specified to the every subject provided for the document related to the ACL.


Param Type Default Description
subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permission string | CarbonLDP.Pointer

The permission that will be granted to the every subject.



grant( subjects:(string | CarbonLDP.Pointer)[], subjectClass:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Grant several permissions to the every subject provided for the document related to the ACL.


Param Type Default Description
subjects (string | CarbonLDP.Pointer)[]

The subjects which will be assigned the every permissions specified.

subjectClass string | CarbonLDP.Pointer

The type of subjects provided.

permissions (string | CarbonLDP.Pointer)[]

The permissions that will be granted to the every subject.



.grants()
: boolean


grants( subject:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):boolean

Returns true if the subject has a configuration where it grants the permission specified for the document related to de ACL. Returns null if no configuration of the subject and permission exists in the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject to look for its configuration.

permission string | CarbonLDP.Pointer

The permission to check if it has a granting configuration.



.remove()
: void


remove( subject:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Remove the configuration of a permission from a subject for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject from will be removed the permission.

permission string | CarbonLDP.Pointer

The permission to remove from the subject configuration.



remove( subject:string | CarbonLDP.Pointer, permissions:(string | CarbonLDP.Pointer)[] ):void

Remove the configuration of several permissions from a subject for the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject from will removed the permission.

permissions (string | CarbonLDP.Pointer)[]

The permissions to remove from the subject configuration.



.removeChildInheritance()
: void


removeChildInheritance( subject:string | CarbonLDP.Pointer, permission:string | CarbonLDP.Pointer ):void

Remove the configuration of a permission from a subject for the children of the document related to the ACL.


Param Type Default Description
subject string | CarbonLDP.Pointer

The subject from will be removed the permission.

permission string | CarbonLDP.Pointer

The permission to remove from the subject configuration.





Interface with factory, decorate and utils methods for CarbonLDP.Auth.PersistedACL objects.


Methods

.decorate()
: T & CarbonLDP.Auth.PersistedACL


decorate<T extends object>( object:T ):T & CarbonLDP.Auth.PersistedACL

Decorate the object with the properties and methods of a CarbonLDP.Auth.PersistedACL object.


Param Type Default Description
object T

The object to decorate.



.isDecorated()
: object is CarbonLDP.Auth.PersistedACL


isDecorated( object:object ):object is CarbonLDP.Auth.PersistedACL

Return true if the object provided has the properties and methods of a CarbonLDP.Auth.PersistedACL object.


Param Type Default Description
object object

The object to analise.





Classes


Interfaces

I
CarbonLDP.PersistedRole.Class
Specific interface that represents a persisted role of an application.




Factory class for CarbonLDP.Auth.PersistedRole.Class objects


Methods

#decorate()
: T & CarbonLDP.Auth.PersistedRole.Class


decorate<T extends object>( object:T, documents:CarbonLDP.Documents ):T & CarbonLDP.Auth.PersistedRole.Class

Decorates the object provided with the methods and properties of a CarbonLDP.Auth.PersistedRole.Class object.


Param Type Default Description
object T
documents CarbonLDP.Documents


#hasClassProperties()
: boolean


hasClassProperties( resource:Object ):boolean

Returns true if the object provided has the properties that defines a CarbonLDP.Auth.PersistedRole.Class object


Param Type Default Description
resource Object


#is()
: boolean


is( object:object ):boolean

Returns true if the object provided is considered a CarbonLDP.Auth.PersistedRole.Class object


Param Type Default Description
object object




Specific interface that represents a persisted role of an application.


Properties

._roles
: CarbonLDP.Auth.Roles.Class

(Internal) Instance of an implementation of the Roles abstract class that manage the current role.


.description
: string

An optional description of the current role.


.name
: string

A name that describes the current role.


.users
: CarbonLDP.Pointer[]

An array of pointers that references to all the users that have the current role.


Methods

.addUser()
: Promise<void>


addUser( user:string | CarbonLDP.Pointer, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Makes a relation in the role towards the users specified.


Param Type Default Description
user string | CarbonLDP.Pointer

The users that wants to add to the role.

requestOptions CarbonLDP.HTTP.RequestOptions


.addUsers()
: Promise<void>


addUsers( users:(string | CarbonLDP.Pointer)[], requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Makes a relation in the role towards the users specified.


Param Type Default Description
users (string | CarbonLDP.Pointer)[]

An array with strings or Pointers that refers to the users that wants to add to the role.

requestOptions CarbonLDP.HTTP.RequestOptions


.createChild()
: Promise<T & CarbonLDP.Auth.PersistedRole.Class>


createChild<T extends CarbonLDP.Auth.Roles.Class>( role:T, slug?:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.Auth.PersistedRole.Class>

Persists a new role with the slug specified as a child of the current role.


Param Type Default Description
role T

The role to be persisted.

slug string

The slug that will be used in the child role URI.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



createChild<T extends CarbonLDP.Auth.Roles.Class>( role:T, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.Auth.PersistedRole.Class>

Persists a new role as a child of the current one.


Param Type Default Description
role T

The role to be persisted.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.getUsers()
: Promise<CarbonLDP.Auth.PersistedRole.Class>


getUsers( requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<CarbonLDP.Auth.PersistedRole.Class>

Retrieves an array of resolved pointers for all the users of the role.


Param Type Default Description
requestOptions CarbonLDP.HTTP.RequestOptions


getUsers( retrievalPreferences?:CarbonLDP.RetrievalPreferences.Class, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<CarbonLDP.Auth.PersistedRole.Class>

Retrieves an array of resolved pointers for the users of the role, in accordance of the retrievalPreferences provided.


Param Type Default Description
retrievalPreferences CarbonLDP.RetrievalPreferences.Class

An object that specify the retrieval preferences for the request.

requestOptions CarbonLDP.HTTP.RequestOptions


.removeUser()
: Promise<void>


removeUser( user:string | CarbonLDP.Pointer, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Removes the relation in the role towards the users specified.


Param Type Default Description
user string | CarbonLDP.Pointer

The users that wants to be removed from the role.

requestOptions CarbonLDP.HTTP.RequestOptions


.removeUsers()
: Promise<void>


removeUsers( users:(string | CarbonLDP.Pointer)[], requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Remove the relation in the role towards the users specified.


Param Type Default Description
users (string | CarbonLDP.Pointer)[]

An array with strings or Pointers that refers to the users that wants to be removed from the role.

requestOptions CarbonLDP.HTTP.RequestOptions




Interfaces

I
CarbonLDP.Auth.PersistedUser
Interface that represents the base of a persisted User in any context.
I
CarbonLDP.Auth.PersistedUserFactory
Interface with the factory, decorate and utils for CarbonLDP.Auth.PersistedUser objects.

Properties




Interface that represents the base of a persisted User in any context.





Interface with the factory, decorate and utils for CarbonLDP.Auth.PersistedUser objects.


Methods

.decorate()
: T & CarbonLDP.Auth.PersistedUser


decorate<T extends object>( object:T, documents:CarbonLDP.Documents ):T & CarbonLDP.Auth.PersistedUser

Decorates the object provided with the properties and methods of a CarbonLDP.Auth.PersistedUser object.


Param Type Default Description
object T

The object to decorate.

documents CarbonLDP.Documents

The documents service the persisted belongs to.



.is()
: value is CarbonLDP.Auth.PersistedUser


is( value:any ):value is CarbonLDP.Auth.PersistedUser

Returns true if the object provided is considered a CarbonLDP.Auth.PersistedUser object.


Param Type Default Description
value any


.isDecorated()
: value is CarbonLDP.Auth.PersistedUser


isDecorated( value:any ):value is CarbonLDP.Auth.PersistedUser

Returns true if the object provided has the properties of a CarbonLDP.Auth.PersistedUser object.


Param Type Default Description
value any




Default Export:

Classes


Interfaces

I
CarbonLDP.Auth.Role.Class
Specific interface that represents the base of an in-memory role for any context.

Properties




Specific interface that represents the base of an in-memory role for any context.


Properties

.name
: string

A descriptive name for the role.





Factory class for CarbonLDP.Auth.Role.Class objects


Methods

#create()
: CarbonLDP.Auth.Role.Class


create( name:string, description?:string ):CarbonLDP.Auth.Role.Class

Create a CarbonLDP.Auth.Role.Class object with the name specified.


Param Type Default Description
name string

The name of the role to create.

description string

The optional description of the role to create.



#createFrom()
: T & CarbonLDP.Auth.Role.Class


createFrom<T extends Object>( object:T, name:string, description?:string ):T & CarbonLDP.Auth.Role.Class

Create a CarbonLDP.Auth.Role.Class object with the object provided.


Param Type Default Description
object T

Object where to create the new role.

name string

The name of the role to create.

description string

The optional description of the role to create.



#hasClassProperties()
: boolean


hasClassProperties( object:object ):boolean

Returns true if the object provided has the properties that defines a CarbonLDP.Auth.Role.Class object


Param Type Default Description
object object


#is()
: boolean


is( object:object ):boolean

Returns true if the object provided is considered a CarbonLDP.Auth.Role.Class object


Param Type Default Description
object object




Default Export:

Classes

C
CarbonLDP.Auth.Roles.Class
Class that manage the roles of a Carbon LDP.




Class that manage the roles of a Carbon LDP.


Constructor


Class( context:CarbonLDP.Context )

Param Type Default Description
context CarbonLDP.Context

Methods

.addUser()
: Promise<void>


addUser( roleURI:string, user:string | CarbonLDP.Pointer, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Makes a relation in the role specified towards the user provided.


Param Type Default Description
roleURI string

The URI of the role where to add the user.

user string | CarbonLDP.Pointer

The user that wants to add to the role.

requestOptions CarbonLDP.HTTP.RequestOptions


.addUsers()
: Promise<void>


addUsers( roleURI:string, users:(string | CarbonLDP.Pointer)[], requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Makes a relation in the role specified towards the users specified.


Param Type Default Description
roleURI string

The URI of the role where to add users.

users (string | CarbonLDP.Pointer)[]

An array with strings or Pointers that refers to the users that wants to add to the role.

requestOptions CarbonLDP.HTTP.RequestOptions


.createChild()
: Promise<T & CarbonLDP.Auth.PersistedRole.Class>


createChild<T extends CarbonLDP.Auth.Roles.Class>( parentRole:string | CarbonLDP.Pointer, role:T, slug?:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.Auth.PersistedRole.Class>

Persists the Role provided with the slug, if specified, as a childRole of the parentRole specified. Returns a Promise with a Pointer for the stored role; and a tuple of two responses, the first one is the response of the creation, and the second one is the response of the creation of the relation parent-child of the roles.


Param Type Default Description
parentRole string | CarbonLDP.Pointer

The role that will be assigned as the parent of the role that wants to persist.

role T

The appRole that wants to persist.

slug string

The slug where the role will be persisted.

requestOptions CarbonLDP.HTTP.RequestOptions

The slug where the role will be persisted.



createChild<T extends CarbonLDP.Auth.Roles.Class>( parentRole:string | CarbonLDP.Pointer, role:T, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.Auth.PersistedRole.Class>

Persists the Role provided as a childRole of the parentRole specified. Returns a Promise with a Pointer for the stored role; and a tuple of two responses, the first one is the response of the creation, and the second one is the response of the creation of the relation parent-child of the roles.


Param Type Default Description
parentRole string | CarbonLDP.Pointer

The role that will be assigned as the parent of the role that wants to persist.

role T

The appRole that wants to persist.

requestOptions CarbonLDP.HTTP.RequestOptions

The slug where the role will be persisted.



.get()
: Promise<T & CarbonLDP.PersistedRole.Class>


get<T>( roleURI:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.PersistedRole.Class>

Retrieves a role from the current context.


Param Type Default Description
roleURI string

The URI of the role to retrieve.

requestOptions CarbonLDP.HTTP.RequestOptions


.getUsers()
: Promise<(T & CarbonLDP.Auth.PersistedUser)[]>


getUsers<T>( roleURI:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<(T & CarbonLDP.Auth.PersistedUser)[]>

Retrieves an array of resolved pointers for all the users of the specified role.


Param Type Default Description
roleURI string

The URI of the role to look for its users.

requestOptions CarbonLDP.HTTP.RequestOptions


.removeUser()
: Promise<void>


removeUser( roleURI:string, user:string | CarbonLDP.Pointer, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Removes the relation in the role specified towards the user provided.


Param Type Default Description
roleURI string

The URI of the role from where to remove the user.

user string | CarbonLDP.Pointer

The user that wants to be removed from the role.

requestOptions CarbonLDP.HTTP.RequestOptions


.removeUsers()
: Promise<void>


removeUsers( roleURI:string, users:(string | CarbonLDP.Pointer)[], requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Remove the relation in the role specified towards the users specified.


Param Type Default Description
roleURI string

The URI of the role from where to remove the users.

users (string | CarbonLDP.Pointer)[]

An array with strings or Pointers that refers to the users to be removed from the role.

requestOptions CarbonLDP.HTTP.RequestOptions




Classes

C
CarbonLDP.AuthService
Abstract class that manages authentications and authorizations.




Abstract class that manages authentications and authorizations.


Constructor


AuthService( context:CarbonLDP.Context ):void

Param Type Default Description
context CarbonLDP.Context

Properties

.authenticatedUser
: CarbonLDP.Auth.PersistedUser

The user of the user that has been authenticated. Returns null if the user it not authenticated.


.roles
: CarbonLDP.Auth.Roles.Class

Instance of CarbonLDP.Auth.Roles.Class that helps managing the roles of your Carbon LDP.


.users
: CarbonLDP.Auth.UsersEndpoint

Instance of CarbonLDP.Auth.UsersEndpoint that helps managing the users of your Carbon LDP.


Methods

.addAuthentication()
: void


addAuthentication( options:CarbonLDP.HTTP.RequestOptions ):void

Adds the authentication header to a CarbonLDP.HTTP.RequestOptions object.


Param Type Default Description
options CarbonLDP.HTTP.RequestOptions


.authenticate()
: Promise<CarbonLDP.Auth.TokenCredentials>


authenticate( username:string, password:string ):Promise<CarbonLDP.Auth.TokenCredentials>

Authenticate the user with a username and password. Uses the CarbonLDP.Auth.AuthMethod.TOKEN method for the authentication.


Param Type Default Description
username string
password string


.authenticateUsing()
: Promise<CarbonLDP.Auth.BasicCredentials>


authenticateUsing( method:CarbonLDP.Auth.AuthMethod.BASIC, username:string, password:string ):Promise<CarbonLDP.Auth.BasicCredentials>

Authenticates the user with Basic HTTP Authentication, which uses an encoded string with username and password in every request.


Param Type Default Description
method CarbonLDP.Auth.AuthMethod.BASIC
username string
password string


authenticateUsing( method:CarbonLDP.Auth.AuthMethod.TOKEN, username:string, password:string ):Promise<CarbonLDP.Auth.TokenCredentials>

Authenticates the user with a username and password, and generates a JSON Web Token (JWT) credential that will be used in every request.


Param Type Default Description
method CarbonLDP.Auth.AuthMethod.TOKEN
username string
password string


authenticateUsing( method:CarbonLDP.Auth.AuthMethod.TOKEN, token:CarbonLDP.Auth.TokenCredentialsBase ):Promise<CarbonLDP.Auth.TokenCredentials>

Authenticates the user with a CarbonLDP.Auth.TokenCredentials, which contains a JSON Web Token (JWT) that will be used in every request.


Param Type Default Description
method CarbonLDP.Auth.AuthMethod.TOKEN
token CarbonLDP.Auth.TokenCredentialsBase


.clearAuthentication()
: void


clearAuthentication():void

Deletes the authentication of the current instance.




.isAuthenticated()
: boolean


isAuthenticated( askParent?:boolean ):boolean

Returns true if the user is authenticated.


Param Type Default Description
askParent boolean true




Classes

C
CarbonLDP.Auth.TokenAuthenticator
Authenticates requests using JSON Web TokenCredentials (JWT) Authentication.




Authenticates requests using JSON Web TokenCredentials (JWT) Authentication.


Methods

.authenticate()
: Promise<CarbonLDP.Auth.TokenCredentials>


authenticate( tokenOrCredentials:CarbonLDP.Auth.BasicToken | CarbonLDP.Auth.TokenCredentialsBase ):Promise<CarbonLDP.Auth.TokenCredentials>

When a token is provided credentials will be requested, in other case the credentials provided will be validated and stored.


Param Type Default Description
tokenOrCredentials CarbonLDP.Auth.BasicToken | CarbonLDP.Auth.TokenCredentialsBase


.isAuthenticated()
: boolean


isAuthenticated():boolean

Returns true if the instance contains stored credentials.






Interfaces

I
CarbonLDP.Auth.User
Interface that represents an in-memory User of any Context.
I
CarbonLDP.Auth.UserBaser
Interface that represents the basic properties for a User.
I
CarbonLDP.Auth.UserFactory
Interface with the factory, decorate and utils for CarbonLDP.Auth.User objects.

Properties




Interface that represents an in-memory User of any Context.


Properties

Methods

.updateCredentials()
: void


updateCredentials( username:string, password:string ):void

Add a credentials fragment with the properties provided. The document needs to be saved for the changes be applied in the platform.


Param Type Default Description
username string
password string




Interface that represents the basic properties for a User.


Properties

.credentials
: CarbonLDP.Auth.UsernameAndPasswordCredentials

A resource with the username and password for the basic credentials.


.name
: string

The optional name of the user.





Interface with the factory, decorate and utils for CarbonLDP.Auth.User objects.


Properties

Methods

.create()
: CarbonLDP.Auth.User


create( data:CarbonLDP.Auth.UserBase ):CarbonLDP.Auth.User

Creates a CarbonLDP.Auth.User object.


Param Type Default Description
data CarbonLDP.Auth.UserBase

The data requited for creating a User document.



.createFrom()
: T & CarbonLDP.Auth.User


createFrom<T extends CarbonLDP.Auth.UserBase>( object:T ):T & CarbonLDP.Auth.User

Creates a CarbonLDP.Auth.User object with the one provided.


Param Type Default Description
object T


.decorate()
: T & CarbonLDP.Auth.User


decorate<T extends object>( object:T ):T & CarbonLDP.Auth.User

Decorates the object provided with the properties and methods of a CarbonLDP.Auth.User object.


Param Type Default Description
object T

The object to decorate.



.is()
: value is CarbonLDP.Auth.User


is( value:any ):value is CarbonLDP.Auth.User

Returns true if the object is a CarbonLDP.Auth.User object.


Param Type Default Description
value any


.isDecorated()
: object is CarbonLDP.Auth.User


isDecorated( object:object ):object is CarbonLDP.Auth.User

Returns true if the object provided has the properties that defines a CarbonLDP.Auth.User object.


Param Type Default Description
object object




Interfaces

I
CarbonLDP.Auth.UsernameAndPasswordCredentials
Interface that represents an in-memory UsernameAndPasswordCredentials of a user.
I
CarbonLDP.Auth.UsernameAndPasswordCredentialsBase
Interface that represents the basic properties of a UsernameAndPasswordCredentials.

Properties




Interface that represents an in-memory UsernameAndPasswordCredentials of a user.


Properties

.password
: string

Password of the user credentials.


.username
: string

Username of the user credentials.





Interface that represents the basic properties of a UsernameAndPasswordCredentials.


Properties

.password
: string

The password of the credentials.


.username
: string

The username of the credentials.





Interface with the factory and utils for CarbonLDP.Auth.UsernameAndPasswordCredentials objects.


Properties

Methods

.create()
: CarbonLDP.Auth.UsernameAndPasswordCredentials


create( data:CarbonLDP.Auth.UsernameAndPasswordCredentialsBase ):CarbonLDP.Auth.UsernameAndPasswordCredentials

Creates a CarbonLDP.Auth.UsernameAndPasswordCredentials object with the username and password specified.


Param Type Default Description
data CarbonLDP.Auth.UsernameAndPasswordCredentialsBase

Object with the username and password for the credentials.



.createFrom()
: T & CarbonLDP.Auth.UsernameAndPasswordCredentials


createFrom<T extends CarbonLDP.Auth.UsernameAndPasswordCredentialsBase>( object:T ):T & CarbonLDP.Auth.UsernameAndPasswordCredentials

Creates a CarbonLDP.Auth.UsernameAndPasswordCredentials object from the object and parameters specified.


Param Type Default Description
object T

Object that will be converted into a credentials resource





Interfaces

I
CarbonLDP.Auth.UsersEndpoint
Endpoint for manage the users of a Carbon LDP instance.
I
CarbonLDP.Auth.UsersEndpointFactory
Interface with the factory, decorate and utils for CarbonLDP.Auth.UsersEndpoint objects.

Properties




Endpoint for manage the users of a Carbon LDP instance.





Interface with the factory, decorate and utils for CarbonLDP.Auth.UsersEndpoint objects.


Methods

.decorate()
: T & CarbonLDP.Auth.UsersEndpoint


decorate<T extends object>( object:T ):T & CarbonLDP.Auth.UsersEndpoint

Decorates the object provided with the properties and methods of a CarbonLDP.Auth.UsersEndpoint object.


Param Type Default Description
object T

The object to decorate.



.is()
: value is CarbonLDP.Auth.UsersEndpoint


is( value:any ):value is CarbonLDP.Auth.UsersEndpoint

Returns true if the object is a CarbonLDP.Auth.UsersEndpoint object.


Param Type Default Description
value any




Interfaces

I
CarbonLDP.BlankNode
Interface that represents the basic data of a blank node.
I
CarbonLDP.BlankNodeFactory
Interface with the factory, decorate and utils methods id a CarbonLDP.BlankNode object.

Properties

#BlankNode
: CarbonLDP.BlankNodeFactory

Constant that implements the CarbonLDP.BlankNodeFactory interface.





Interface that represents the basic data of a blank node.





Interface with the factory, decorate and utils methods id a CarbonLDP.BlankNode object.


Methods

.create()
: T & CarbonLDP.BlankNode


create( document:CarbonLDP.Document, id?:string ):T & CarbonLDP.BlankNode

Creates a CarbonLDP.BlankNode object from the parameters specified.


Param Type Default Description
document CarbonLDP.Document

The CarbonLDP.Document object where the fragment is part of.

id string

The ID of the of the BlankNode to create. If no ID is provided, one will be created.



.createFrom()
: T & CarbonLDP.BlankNode


createFrom<T extends object>( object:T, document:CarbonLDP.Document, id?:string ):T & CarbonLDP.BlankNode

Creates a CarbonLDP.BlankNode object from the object and parameters specified.


Param Type Default Description
object T

Object to be converted into a CarbonLDP.BlankNode.

document CarbonLDP.Document

The CarbonLDP.Document object where the fragment is part of.

id string

The ID of the of the BlankNode to create. If no ID is provided, one will be created.



.is()
: object is CarbonLDP.BlankNode


is( object:object ):object is CarbonLDP.BlankNode

Returns true if the object provided is considered a CarbonLDP.BlankNode.


Param Type Default Description
object object




Classes

C
CarbonLDP
The main class of the SDK, which contains all the references of the modules used in the the SDK.




CarbonLDP
Class

The main class of the SDK, which contains all the references of the modules used in the the SDK.


Reexports

AbstractContext
ContainerType
DigestedObjectSchema
DigestedObjectSchemaProperty
ObjectSchemaDigester
ObjectSchemaUtils
PointerType
Vocabularies

Constructor


CarbonLDP( url:string ):void

Param Type Default Description
url string

The URL where the platform instance is located on.



CarbonLDP( settings:CarbonLDP.SettingsCarbonSettings ):void

Param Type Default Description
settings CarbonLDP.SettingsCarbonSettings

A settings object to fully configure the Carbon instance.


Properties

#version
: string

Returns the version of the SDK.


.baseURI
: string

Returns the URI of your Carbon LDP.


.messaging
: CarbonLDP.Messaging.MessagingService

Service that contains the RAW methods to manage the messaging/real-time features.


.version
: string

Returns the version of the SDK.


Methods

.getPlatformMetadata()
: Promise<CarbonLDP.System.PlatformMetadata>


getPlatformMetadata():Promise<CarbonLDP.System.PlatformMetadata>

Retrieves the Metadata related to the Carbon LDP Platform.




.resolve()
: string


resolve( relativeURI:string ):string

Resolve the URI provided in the scope your Carbon LDP Platform instance.


Param Type Default Description
relativeURI string

Relative URI to be resolved.





Interfaces

I
CarbonLDP.Context
Interface that every context in the SDK implements.




CarbonLDP.Context
Interface

Interface that every context in the SDK implements.


Properties

.auth
: CarbonLDP.Auth.AuthService

The authentication and authorization class of the context.


.documents
: CarbonLDP.Documents

The documents class of the context.


.parentContext
: CarbonLDP.Context

The parent context of the current context. It will be null when the context has no parent.


Methods

._resolvePath()
: string


_resolvePath( path:string ):string

Resolves the path provided into an URL using the path settings of the context.


Param Type Default Description
path string

The dot notation string that refers the path declared in the settings of the context.



.clearObjectSchema()
: void


clearObjectSchema( type?:string ):void

Remove the schema of the type specified, or the general schema if no type is provided.


Param Type Default Description
type string

The URI of the type to remove its schema.



.extendObjectSchema()
: void


extendObjectSchema( type:string, objectSchema:CarbonLDP.DigestedObjectSchema ):void

Extends the schema for a specified type of Resource. If a schema for the type exists in the parent context, this is duplicated for the actual context, but only the first time this schema is extended.


Param Type Default Description
type string

The URI of the type to extends its schema.

objectSchema CarbonLDP.DigestedObjectSchema

The new schema that will extends the previous one.



extendObjectSchema( objectSchema:CarbonLDP.DigestedObjectSchema ):void

Extends the general schema of the current context. If a general schema exists in the parent context, this is duplicated for the current context, but only the first time the schema is extended.


Param Type Default Description
objectSchema CarbonLDP.DigestedObjectSchema

The new schema that will extends the previous one.



.getBaseURI()
: string


getBaseURI():string

Returns the base URI of the current context.




.getObjectSchema()
: CarbonLDP.DigestedObjectSchema


getObjectSchema( type?:string ):CarbonLDP.DigestedObjectSchema

Returns the ObjectSchema for the specified type. If no type is specified, the general object schema of the context should be returned.


Param Type Default Description
type string

The URI of the type to look for its schema.



.hasObjectSchema()
: boolean


hasObjectSchema( type:string ):boolean

Returns true if there is an ObjectSchema for the specified type.


Param Type Default Description
type string

The URI of the type to look for its schema.



.resolve()
: string


resolve( relativeURI:string ):string

Resolves the relative URI provided in accordance to the base URI of the context.


Param Type Default Description
relativeURI string

The relative URI to be resolved.





Interfaces

I
CarbonLDP.Document
Interface that represents an in-memory Carbon LDP Document.
I
CarbonLDP.DocumentFactory
Interface with the factory, decorate and utils for CarbonLDP.Document objects.

Properties

#Document
: CarbonLDP.DocumentFactory

Constant that implements the CarbonLDP.DocumentFactory interface.





CarbonLDP.Document
Interface

Interface that represents an in-memory Carbon LDP Document.


Properties

._fragmentsIndex
: Map<string, CarbonLDP.Fragment>

Map that stores the fragments (named fragments and blank nodes) of the Document.


.defaultInteractionModel
: CarbonLDP.Pointer

A Pointer URI representing the default interaction model of the document when persisted.


.hasMemberRelation
: CarbonLDP.Pointer

A Pointer with the inverted relation the document will have.


.isMemberOfRelation
: CarbonLDP.Pointer

A Pointer with the member of relation of the document.


Methods

._normalize()
: void


_normalize():void

Search over the document for normal objects to convert into fragments, and unused fragments to eliminate.




._removeFragment()
: void


_removeFragment( fragment:CarbonLDP.Fragment ):void

Remove the fragment referenced by the CarbonLDP.Fragment provided from the Document.


Param Type Default Description
fragment CarbonLDP.Fragment


_removeFragment( slug:string ):void

Remove the fragment referenced by the Slug provided from the Document.


Param Type Default Description
slug string


.createFragment()
: T & CarbonLDP.Fragment


createFragment<T>( object:T, slug:string ):T & CarbonLDP.Fragment

Creates a CarbonLDP.NamedFragment from the object provided and the slug specified. If the slug has the form of a BlankNode ID, a CarbonLDP.Fragment is created instead.


Param Type Default Description
object T
slug string


createFragment<T>( object:object ):T & CarbonLDP.Fragment

Creates a CarbonLDP.Fragment from the object provided, since no slug is specified.


Param Type Default Description
object object


createFragment( slug:string ):CarbonLDP.Fragment

Creates an empty CarbonLDP.NamedFragment with the slug specified. If the slug has the form of a BlankNode ID, a CarbonLDP.Fragment is created instead.


Param Type Default Description
slug string


createFragment():CarbonLDP.Fragment

Creates an empty CarbonLDP.Fragment, since no slug is provided.




.createNamedFragment()
: CarbonLDP.NamedFragment


createNamedFragment( slug:string ):CarbonLDP.NamedFragment

Creates a CarbonLDP.NamedFragment with the slug provided. If the slug has the form of a BlankNode ID, an Error is thrown.


Param Type Default Description
slug string


createNamedFragment<T>( object:T, slug:string ):T & CarbonLDP.NamedFragment

Creates a CarbonLDP.NamedFragment from the object provided and the slug specified. If the slug has the form of a BlankNode ID, an Error is thrown.


Param Type Default Description
object T
slug string


.getFragment()
: T & CarbonLDP.Fragment


getFragment<T>( id:string ):T & CarbonLDP.Fragment

Returns the fragment referenced by the ID provided. Returns null if no fragment exists in the Document.


Param Type Default Description
id string


.getFragments()
: CarbonLDP.Fragment[]


getFragments():CarbonLDP.Fragment[]

Returns an array with all the fragments in the Document.




.getNamedFragment()
: T & CarbonLDP.Fragment


getNamedFragment<T>( id:string ):T & CarbonLDP.Fragment

Returns the fragment referenced by the ID provided. Returns null if no fragment exists in the Document.


Param Type Default Description
id string


.getPointer()
: boolean


getPointer( id:string ):boolean

Returns the pointer referenced by the URI provided. If no pointer exists, one is created and then returned. Returns null if the URI is outside the scope of the Document.


Param Type Default Description
id string


.hasFragment()
: boolean


hasFragment( id:string ):boolean

Returns true if the Document has the fragment referenced by the ID provided.


Param Type Default Description
id string


.hasPointer()
: boolean


hasPointer( id:string ):boolean

Returns true if the Document has a pointer referenced by the URI provided.


Param Type Default Description
id string


.inScope()
: boolean


inScope( pointer:CarbonLDP.Pointer ):boolean

Returns true if the pointer provided is inside the scope of the Document.


Param Type Default Description
pointer CarbonLDP.Pointer


inScope( id:string ):boolean

Returns true if the URI provided is inside the scope of the Document.


Param Type Default Description
id string


.removeNamedFragment()
: void


removeNamedFragment( fragment:CarbonLDP.NamedFragment ):void

Remove the maned fragment referenced by the CarbonLDP.NamedFragment provided from the Document.


Param Type Default Description
fragment CarbonLDP.NamedFragment


removeNamedFragment( slug:string ):void

Remove the named fragment referenced by the Slug provided from the Document.


Param Type Default Description
slug string


.toJSON()
: CarbonLDP.RDF.RDFDocument


toJSON( objectSchemaResolver?:CarbonLDP.ObjectSchemaResolver, jsonLDConverter?:CarbonLDP.JSONLDConverter.Class ):CarbonLDP.RDF.RDFDocument

Returns a JSON string from the Document using the ObjectSchema and then JSONLDConverter if provided.


Param Type Default Description
objectSchemaResolver CarbonLDP.ObjectSchemaResolver
jsonLDConverter CarbonLDP.JSONLDConverter.Class




Interface with the factory, decorate and utils for CarbonLDP.Document objects.





Classes

C
CarbonLDP.Documents
Class that contains methods for retrieving, saving and updating documents from the Carbon LDP server.




Class that contains methods for retrieving, saving and updating documents from the Carbon LDP server.


Constructor


Documents( context?:CarbonLDP.Context )

Param Type Default Description
context CarbonLDP.Context

The context where the documents instance will live. If no context is provided, calling its methods with relative URIs will throw an error, since there will be no form to resolve them.


Properties

.documentDecorators
: Map<string, CarbonLDP.DocumentDecorator>

A map that specifies a type and a tuple with a function decorator and its parameters which will be called when a document with the specified type has been resolved or refreshed.

The decorator function must at least accept the object to decorate and optional parameters declared in the tuple.


.jsonldConverter
: CarbonLDP.JSONLD.JSONLDConverter

Instance of CarbonLDP.JSONLD.JSONLDConverter that is used to compact retrieved documents and to expand documents to persist. This property is not writable.


Methods

._parseErrorResponse()


.addMember()
: Promise<void>


addMember( documentURI:string, member:CarbonLDP.Pointer, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Add a member relation to the resource Pointer in the document container specified.


Param Type Default Description
documentURI string

URI of the document container where the member will be added.

member CarbonLDP.Pointer

Pointer object that references the resource to add as a member.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



addMember( documentURI:string, memberURI:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Add a member relation to the resource URI in the document container specified.


Param Type Default Description
documentURI string

URI of the document container where the member will be added.

memberURI string

URI of the resource to add as a member.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.addMembers()
: Promise<void>


addMembers( documentURI:string, members:(CarbonLDP.Pointer | string)[], requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Add a member relation to every resource URI or Pointer provided in the document container specified.


Param Type Default Description
documentURI string

URI of the document container where the members will be added.

members (CarbonLDP.Pointer | string)[]

Array of URIs or Pointers to add as members.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.createAccessPoint()
: Promise<T & CarbonLDP.PersistedAccessPoint>


createAccessPoint<T extends object>( documentURI:string, accessPoint:T & CarbonLDP.AccessPointBase, slug?:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.PersistedAccessPoint>

Persists an AccessPoint in the document specified.


Param Type Default Description
documentURI string

URI of the document where to create a new access point.

accessPoint T & CarbonLDP.AccessPointBase

AccessPoint Document to persist.

slug string

Slug that will be used for the URI of the new access point.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



createAccessPoint<T extends object>( documentURI:string, accessPoint:T & CarbonLDP.AccessPointBase, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.PersistedAccessPoint>

Persists an AccessPoint in the document specified.


Param Type Default Description
documentURI string

URI of the document where to create a new access point.

accessPoint T & CarbonLDP.AccessPointBase

AccessPoint Document to persist.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.createAccessPoints()
: Promise<(T & CarbonLDP.PersistedAccessPoint)[]>


createAccessPoints<T extends object>( documentURI:string, accessPoints:T & CarbonLDP.AccessPointBase, slugs?:string[], requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<(T & CarbonLDP.PersistedAccessPoint)[]>

Persists multiple access points objects for the specified document.


Param Type Default Description
documentURI string

URI of the document where to create the new access points.

accessPoints T & CarbonLDP.AccessPointBase

Array with the access points to persist.

slugs string[]

Array with the slugs that corresponds to each object in accessPoints parameter, in the order in which they were defined. If an element in the array is undefined or null, the slug will be generated by the platform.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



createAccessPoints<T extends object>( documentURI:string, accessPoints:T & CarbonLDP.AccessPointBase, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<(T & CarbonLDP.PersistedAccessPoint)[]>

Persists multiple access points objects for the specified document.


Param Type Default Description
documentURI string

URI of the document where to create the new access points.

accessPoints T & CarbonLDP.AccessPointBase

Array with the access points to persist.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.createChild()
: Promise<T & CarbonLDP.PersistedProtectedDocument>


createChild<T extends object>( parentURI:string, childObject:T, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.PersistedProtectedDocument>

Persists JavaScript object as a child document for the respective parent source.


Param Type Default Description
parentURI string

URI of the document where to create a new child.

childObject T

A normal JavaScript object that will be converted and persisted as a new child document.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



createChild<T extends object>( parentURI:string, childObject:T, slug?:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.PersistedProtectedDocument>

Persists JavaScript object as a child document for the respective parent source.


Param Type Default Description
parentURI string

URI of the document where to create a new child.

childObject T

A normal JavaScript object that will be converted and persisted as a new child document.

slug string

Slug that will be used for the URI of the new child.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.createChildAndRetrieve()
: Promise<T & CarbonLDP.PersistedProtectedDocument>


createChildAndRetrieve<T extends object>( parentURI:string, childObject:T, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.PersistedProtectedDocument>

Persists JavaScript object as a child document for the respective parent source and retrieves the updated data from the server.


Param Type Default Description
parentURI string

URI of the document where to create a new child.

childObject T

A normal JavaScript object that will be converted and persisted as a new child document.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



createChildAndRetrieve<T extends object>( parentURI:string, childObject:T, slug?:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.PersistedProtectedDocument>

Persists JavaScript object as a child document for the respective parent source and retrieves the updated data from the server.


Param Type Default Description
parentURI string

URI of the document where to create a new child.

childObject T

A normal JavaScript object that will be converted and persisted as a new child document.

slug string

Slug that will be used for the URI of the new child.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.createChildren()
: Promise<(T & CarbonLDP.PersistedProtectedDocument)[]>


createChildren<T extends object>( parentURI:string, childrenObjects:T[], requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<(T & CarbonLDP.PersistedProtectedDocument)[]>

Persists multiple JavaScript objects as children of the parent document.


Param Type Default Description
parentURI string

URI of the document where to create a new child.

childrenObjects T[]

An array with the objects to be converted and persisted as new children of the parent document.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for every the request.



createChildren<T extends object>( parentURI:string, childrenObjects:T[], slugs?:string[], requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<(T & CarbonLDP.PersistedProtectedDocument)[]>

Persists multiple JavaScript objects as children of the parent document.


Param Type Default Description
parentURI string

URI of the document where to create a new child.

childrenObjects T[]

An array with the objects to be converted and persisted as new children of the parent document.

slugs string[]

Array with the slugs that corresponds to each object in childrenObjects, in the order in which they were defined. If an element in the array is undefined or null, the slug will be generated by the platform.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for every the request.



.createChildrenAndRetrieve()
: Promise<(T & CarbonLDP.PersistedProtectedDocument)[]>


createChildrenAndRetrieve<T extends object>( parentURI:string, childrenObjects:T[], requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<(T & CarbonLDP.PersistedProtectedDocument)[]>

Persists multiple JavaScript objects as children of the parent document and retrieves the updated data from the server.


Param Type Default Description
parentURI string

URI of the document where to create a new child.

childrenObjects T[]

An array with the objects to be converted and persisted as new children of the parent document.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for every the request.



createChildrenAndRetrieve<T extends object>( parentURI:string, childrenObjects:T[], slugs?:string[], requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<(T & CarbonLDP.PersistedProtectedDocument)[]>

Persists multiple JavaScript objects as children of the parent document and retrieves the updated data from the server.


Param Type Default Description
parentURI string

URI of the document where to create a new child.

childrenObjects T[]

An array with the objects to be converted and persisted as new children of the parent document.

slugs string[]

Array with the slugs that corresponds to each object in childrenObjects, in the order in which they were defined. If an element in the array is undefined or null, the slug will be generated by the platform.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for every the request.



.delete()
: Promise<void>


delete( documentURI:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Delete the resource from the Carbon LDP server referred by the URI provided.


Param Type Default Description
documentURI string

The resource to delete from the Carbon LDP server.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.executeASKQuery()
: Promise<boolean>


executeASKQuery( documentURI:string, askQuery:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<boolean>

Executes an ASK query on a document and returns the response of the query in form of a boolean.


Param Type Default Description
documentURI string

URI of the document that works as a SPARQL endpoint where to execute the SPARQL query.

askQuery string

ASK query to execute in the selected endpoint.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.executeRawASKQuery()
: Promise<CarbonLDP.SPARQL.SPARQLRawResults>


executeRawASKQuery( documentURI:string, askQuery:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<CarbonLDP.SPARQL.SPARQLRawResults>

Executes an ASK query on a document and returns a raw application/sparql-results+json object.


Param Type Default Description
documentURI string

URI of the document that works as a SPARQL endpoint where to execute the SPARQL query.

askQuery string

ASK query to execute in the selected endpoint.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.executeRawCONSTRUCTQuery()
: Promise<string>


executeRawCONSTRUCTQuery( documentURI:string, constructQuery:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<string>

Executes a CONSTRUCT query on a document and returns a string with the resulting model.


Param Type Default Description
documentURI string

URI of the document that works as a SPARQL endpoint where to execute the SPARQL query.

constructQuery string

CONSTRUCT query to execute in the selected endpoint.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.executeRawDESCRIBEQuery()
: Promise<string>


executeRawDESCRIBEQuery( documentURI:string, describeQuery:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<string>

Executes a DESCRIBE query and returns a string with the resulting model.


Param Type Default Description
documentURI string

URI of the document that works as a SPARQL endpoint where to execute the SPARQL query.

describeQuery string

DESCRIBE query to execute in the selected endpoint.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.executeRawSELECTQuery()
: Promise<CarbonLDP.SPARQL.SPARQLRawResults>


executeRawSELECTQuery( documentURI:string, selectQuery:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<CarbonLDP.SPARQL.SPARQLRawResults>

Executes a SELECT query on a document and returns a raw application/sparql-results+json object.


Param Type Default Description
documentURI string

URI of the document that works as a SPARQL endpoint where to execute the SPARQL query.

selectQuery string

SELECT query to execute in the selected endpoint.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.executeSELECTQuery()
: Promise<CarbonLDP.SPARQL.SPARQLSelectResults<T>>


executeSELECTQuery<T extends object>( documentURI:string, selectQuery:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<CarbonLDP.SPARQL.SPARQLSelectResults<T>>

Executes a SELECT query on a document and returns a parsed response object.


Param Type Default Description
documentURI string

URI of the document that works as a SPARQL endpoint where to execute the SPARQL query.

selectQuery string

SELECT query to execute in the selected endpoint.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.executeUPDATE()
: Promise<void>


executeUPDATE( documentURI:string, update:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Executes a DESCRIBE query and returns a string with the resulting model.


Param Type Default Description
documentURI string

URI of the document that works as a SPARQL endpoint where to execute the SPARQL query.

update string

UPDATE query to execute in the selected endpoint.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.exists()
: Promise<boolean>


exists( documentURI:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<boolean>

Retrieves a boolean indicating if the resource exists or not in the Carbon LDP server.


Param Type Default Description
documentURI string

The URI to verify if it exists.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.get()
: Promise<T & CarbonLDP.PersistedDocument>


get<T extends object>( uri:string, requestOptions?:CarbonLDP.HTTP.GETOptions, queryBuilderFn?:( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentBuilder ):Promise<T & CarbonLDP.PersistedDocument>

Retrieves the entire document referred by the URI specified when no query function si provided. If the function builder es provided the query is able to specify the properties of the document to be retrieved and the sub-documents' properties and on and on.


Param Type Default Description
uri string

The URI of the document to retrieve/query.

requestOptions CarbonLDP.HTTP.GETOptions

Customizable options for the request.

queryBuilderFn ( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentBuilder

Function that receives a the builder that helps you to construct the retrieval query. The same builder must be returned.



get<T extends object>( uri:string, queryBuilderFn?:( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentBuilder ):Promise<T & CarbonLDP.PersistedDocument>

Retrieves the entire document referred by the URI specified when no query function si provided. If the function builder es provided the query is able to specify the properties of the document to be retrieved and the sub-documents' properties and on and on.


Param Type Default Description
uri string

The URI of the document to retrieve.

queryBuilderFn ( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentBuilder

Function that receives a the builder that helps you to construct the retrieval query. The same builder must be returned.



.getChildren()
: Promise<(T & CarbonLDP.PersistedDocument)[]>


getChildren<T extends object>( parentURI:string, requestOptions?:CarbonLDP.HTTP.RequestOptions, queryBuilderFn?:( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ):Promise<(T & CarbonLDP.PersistedDocument)[]>

Retrieves the children of a document, building a query on which one is able to specify the properties to be retrieve and sub-documents' properties and on and on.


Param Type Default Description
parentURI string

URI of the document from where to look for its children.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.

queryBuilderFn ( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder

Function that receives a the builder that helps you to construct the children retrieval query. The same builder must be returned.



getChildren<T extends object>( parentURI:string, queryBuilderFn?:( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ):Promise<(T & CarbonLDP.PersistedDocument)[]>

Retrieves the children of a document, building a query on which one is able to specify the properties to be retrieve and sub-documents' properties and on and on.


Param Type Default Description
parentURI string

URI of the document from where to look for its children.

queryBuilderFn ( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder

Function that receives a the builder that helps you to construct the children retrieval query. The same builder must be returned.



.getMembers()
: Promise<(T & CarbonLDP.PersistedDocument)[]>


getMembers<T extends object>( uri:string, requestOptions?:CarbonLDP.HTTP.RequestOptions, queryBuilderFn?:( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ):Promise<(T & CarbonLDP.PersistedDocument)[]>

Retrieves the members of a document, building a query on which one is able to specify the properties to be retrieve and sub-documents' properties and on and on.


Param Type Default Description
uri string

URI of the document from where to look for its members.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.

queryBuilderFn ( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder

Function that receives a the builder that helps you to construct the member retrieval query. The same builder must be returned.



getMembers<T extends object>( uri:string, queryBuilderFn?:( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ):Promise<(T & CarbonLDP.PersistedDocument)[]>

Retrieves the members of a document, building a query on which one is able to specify the properties to be retrieve and sub-documents' properties and on and on.


Param Type Default Description
uri string

URI of the document from where to look for its members.

queryBuilderFn ( queryBuilder:CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder ) => CarbonLDP.SPARQL.QueryDocument.QueryDocumentsBuilder

Function that receives a the builder that helps you to construct the member retrieval query. The same builder must be returned.



.getPointer()
: boolean


getPointer( id:string ):boolean

Returns the pointer referenced by the URI provided. If no pointer exists, one is created and then returned. Returns null if the URI is outside the scope of the Documents instance.


Param Type Default Description
id string

URI to look for.



.hasPointer()
: boolean


hasPointer( id:string ):boolean

Returns true if the Documents instance has a pointer referenced by the URI provided.


Param Type Default Description
id string

URI to look for.



.inScope()
: boolean


inScope( pointer:CarbonLDP.Pointer ):boolean

Returns true if the pointer provided is inside the scope of the Documents instance.


Param Type Default Description
pointer CarbonLDP.Pointer

Pointer to evaluate.



inScope( id:string ):boolean

Returns true if the URI provided is inside the scope of the Documents instance.


Param Type Default Description
id string

URI to evaluate.



.listChildren()
: Promise<(T & CarbonLDP.PersistedDocument)[]>


listChildren<T extends object>( parentURI:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<(T & CarbonLDP.PersistedDocument)[]>

Retrieves the empty children of a document.


Param Type Default Description
parentURI string

URI of the document from where to look for its children.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.listMembers()
: Promise<(T & CarbonLDP.PersistedDocument)[]>


listMembers<T extends object>( uri:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<(T & CarbonLDP.PersistedDocument)[]>

Retrieves the empty members of a document.


Param Type Default Description
uri string

URI of the document from where to look for its members.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.off()
: void


off( event:CarbonLDP.Messaging.Event.CHILD_CREATED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.ChildCreated ) => void, onError:( error:Error ) => void ):void

Remove the subscription of the URI pattern event specified that have the exact onEvent callback provided.


Param Type Default Description
event CarbonLDP.Messaging.Event.CHILD_CREATED

The event of the subscription to remove.

uriPattern string

URI and/or pattern of the resource(s) of the subscription to remove.

onEvent ( message:CarbonLDP.Messaging.ChildCreated ) => void

The onEvent callback of the subscription to be removed. It must be the same call back provided in the on methods.

onError ( error:Error ) => void

Callback that receives the error thrown trying to remove the subscription.



off( event:CarbonLDP.Messaging.Event.ACCESS_POINT_CREATED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.AccessPointCreated ) => void, onError:( error:Error ) => void ):void

Remove the subscription of the URI pattern event specified that have the exact onEvent callback provided.


Param Type Default Description
event CarbonLDP.Messaging.Event.ACCESS_POINT_CREATED

The event of the subscription to remove.

uriPattern string

URI and/or pattern of the resource(s) of the subscription to remove.

onEvent ( message:CarbonLDP.Messaging.AccessPointCreated ) => void

The onEvent callback of the subscription to be removed. It must be the same call back provided in the on methods.

onError ( error:Error ) => void

Callback that receives the error thrown trying to remove the subscription.



off( event:CarbonLDP.Messaging.Event.DOCUMENT_CREATED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentCreated ) => void, onError:( error:Error ) => void ):void

Remove the subscription of the URI pattern event specified that have the exact onEvent callback provided.


Param Type Default Description
event CarbonLDP.Messaging.Event.DOCUMENT_CREATED

The event of the subscription to remove.

uriPattern string

URI and/or pattern of the resource(s) of the subscription to remove.

onEvent ( message:CarbonLDP.Messaging.DocumentCreated ) => void

The onEvent callback of the subscription to be removed. It must be the same call back provided in the on methods.

onError ( error:Error ) => void

Callback that receives the error thrown trying to remove the subscription.



off( event:CarbonLDP.Messaging.Event.DOCUMENT_MODIFIED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentModified ) => void, onError:( error:Error ) => void ):void

Remove the subscription of the URI pattern event specified that have the exact onEvent callback provided.


Param Type Default Description
event CarbonLDP.Messaging.Event.DOCUMENT_MODIFIED

The event of the subscription to remove.

uriPattern string

URI and/or pattern of the resource(s) of the subscription to remove.

onEvent ( message:CarbonLDP.Messaging.DocumentModified ) => void

The onEvent callback of the subscription to be removed. It must be the same call back provided in the on methods.

onError ( error:Error ) => void

Callback that receives the error thrown trying to remove the subscription.



off( event:CarbonLDP.Messaging.Event.DOCUMENT_DELETED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentDeleted ) => void, onError:( error:Error ) => void ):void

Remove the subscription of the URI pattern event specified that have the exact onEvent callback provided.


Param Type Default Description
event CarbonLDP.Messaging.Event.DOCUMENT_DELETED

The event of the subscription to remove.

uriPattern string

URI and/or pattern of the resource(s) of the subscription to remove.

onEvent ( message:CarbonLDP.Messaging.DocumentDeleted ) => void

The onEvent callback of the subscription to be removed. It must be the same call back provided in the on methods.

onError ( error:Error ) => void

Callback that receives the error thrown trying to remove the subscription.



off( event:CarbonLDP.Messaging.Event.MEMBER_ADDED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.MemberAdded ) => void, onError:( error:Error ) => void ):void

Remove the subscription of the URI pattern event specified that have the exact onEvent callback provided.


Param Type Default Description
event CarbonLDP.Messaging.Event.MEMBER_ADDED

The event of the subscription to remove.

uriPattern string

URI and/or pattern of the resource(s) of the subscription to remove.

onEvent ( message:CarbonLDP.Messaging.MemberAdded ) => void

The onEvent callback of the subscription to be removed. It must be the same call back provided in the on methods.

onError ( error:Error ) => void

Callback that receives the error thrown trying to remove the subscription.



off( event:CarbonLDP.Messaging.Event.MEMBER_REMOVED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.MemberRemoved ) => void, onError:( error:Error ) => void ):void

Remove the subscription of the URI pattern event specified that have the exact onEvent callback provided.


Param Type Default Description
event CarbonLDP.Messaging.Event.MEMBER_REMOVED

The event of the subscription to remove.

uriPattern string

URI and/or pattern of the resource(s) of the subscription to remove.

onEvent ( message:CarbonLDP.Messaging.MemberRemoved ) => void

The onEvent callback of the subscription to be removed. It must be the same call back provided in the on methods.

onError ( error:Error ) => void

Callback that receives the error thrown trying to remove the subscription.



off( event:CarbonLDP.Messaging.Event | string, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.EventMessage ) => void, onError:( error:Error ) => void ):void

Remove the subscription of the URI pattern event specified that have the exact onEvent callback provided.


Param Type Default Description
event CarbonLDP.Messaging.Event | string

The event of the subscription to remove.

uriPattern string

URI and/or pattern of the resource(s) of the subscription to remove.

onEvent ( message:CarbonLDP.Messaging.EventMessage ) => void

The onEvent callback of the subscription to be removed. It must be the same call back provided in the on methods.

onError ( error:Error ) => void

Callback that receives the error thrown trying to remove the subscription.



.on()
: void


on( event:CarbonLDP.Messaging.Event.CHILD_CREATED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.ChildCreated ) => void, onError:( error:Error ) => void ):void

Subscribe to an event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.CHILD_CREATED

The event to subscribe for its notifications.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.ChildCreated ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



on( event:CarbonLDP.Messaging.Event.ACCESS_POINT_CREATED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.AccessPointCreated ) => void, onError:( error:Error ) => void ):void

Subscribe to an event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.ACCESS_POINT_CREATED

The event to subscribe for its notifications.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.AccessPointCreated ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



on( event:CarbonLDP.Messaging.Event.DOCUMENT_CREATED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentCreated ) => void, onError:( error:Error ) => void ):void

Subscribe to an event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.DOCUMENT_CREATED

The event to subscribe for its notifications.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.DocumentCreated ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



on( event:CarbonLDP.Messaging.Event.DOCUMENT_MODIFIED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentModified ) => void, onError:( error:Error ) => void ):void

Subscribe to an event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.DOCUMENT_MODIFIED

The event to subscribe for its notifications.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.DocumentModified ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



on( event:CarbonLDP.Messaging.Event.DOCUMENT_DELETED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentDeleted ) => void, onError:( error:Error ) => void ):void

Subscribe to an event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.DOCUMENT_DELETED

The event to subscribe for its notifications.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.DocumentDeleted ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



on( event:CarbonLDP.Messaging.Event.MEMBER_ADDED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.MemberAdded ) => void, onError:( error:Error ) => void ):void

Subscribe to an event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.MEMBER_ADDED

The event to subscribe for its notifications.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.MemberAdded ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



on( event:CarbonLDP.Messaging.Event.MEMBER_REMOVED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.MemberRemoved ) => void, onError:( error:Error ) => void ):void

Subscribe to an event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.MEMBER_REMOVED

The event to subscribe for its notifications.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.MemberRemoved ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



on( event:CarbonLDP.Messaging.Event | string, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.EventMessage ) => void, onError:( error:Error ) => void ):void

Subscribe to an event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event | string

The event to subscribe for its notifications.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.EventMessage ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



.onAccessPointCreated()
: void


onAccessPointCreated( uriPattern:string, onEvent:( message:CarbonLDP.Messaging.AccessPointCreated ) => void, onError:( error:Error ) => void ):void

Subscribe to the CarbonLDP.Messaging.Event.ACCESS_POINT_CREATED event notifications for the specified URI pattern.


Param Type Default Description
uriPattern string

URI and/or pattern of the resource(s) to subscribe for.

onEvent ( message:CarbonLDP.Messaging.AccessPointCreated ) => void

Callback that receives the data message from the notifications event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



.onChildCreated()
: void


onChildCreated( uriPattern:string, onEvent:( message:CarbonLDP.Messaging.ChildCreated ) => void, onError:( error:Error ) => void ):void

Subscribe to the CarbonLDP.Messaging.Event.CHILD_CREATED event notifications for the specified URI pattern.


Param Type Default Description
uriPattern string

URI and/or pattern of the resource(s) to subscribe for.

onEvent ( message:CarbonLDP.Messaging.ChildCreated ) => void

Callback that receives the data message from the notifications event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



.onDocumentCreated()
: void


onDocumentCreated( uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentCreated ) => void, onError:( error:Error ) => void ):void

Subscribe to the CarbonLDP.Messaging.Event.DOCUMENT_CREATED event notifications for the specified URI pattern.


Param Type Default Description
uriPattern string

URI and/or pattern of the resource(s) to subscribe for.

onEvent ( message:CarbonLDP.Messaging.DocumentCreated ) => void

Callback that receives the data message from the notifications event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



.onDocumentDeleted()
: void


onDocumentDeleted( uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentDeleted ) => void, onError:( error:Error ) => void ):void

Subscribe to the CarbonLDP.Messaging.Event.DOCUMENT_DELETED event notifications for the specified URI pattern.


Param Type Default Description
uriPattern string

URI and/or pattern of the resource(s) to subscribe for.

onEvent ( message:CarbonLDP.Messaging.DocumentDeleted ) => void

Callback that receives the data message from the notifications event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



.onDocumentModified()
: void


onDocumentModified( uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentModified ) => void, onError:( error:Error ) => void ):void

Subscribe to the CarbonLDP.Messaging.Event.DOCUMENT_MODIFIED event notifications for the specified URI pattern.


Param Type Default Description
uriPattern string

URI and/or pattern of the resource(s) to subscribe for.

onEvent ( message:CarbonLDP.Messaging.DocumentModified ) => void

Callback that receives the data message from the notifications event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



.onMemberAdded()
: void


onMemberAdded( uriPattern:string, onEvent:( message:CarbonLDP.Messaging.MemberAdded ) => void, onError:( error:Error ) => void ):void

Subscribe to the CarbonLDP.Messaging.Event.MEMBER_ADDED event notifications for the specified URI pattern.


Param Type Default Description
uriPattern string

URI and/or pattern of the resource(s) to subscribe for.

onEvent ( message:CarbonLDP.Messaging.MemberAdded ) => void

Callback that receives the data message from the notifications event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



.onMemberRemoved()
: void


onMemberRemoved( uriPattern:string, onEvent:( message:CarbonLDP.Messaging.MemberRemoved ) => void, onError:( error:Error ) => void ):void

Subscribe to the CarbonLDP.Messaging.Event.MEMBER_REMOVED event notifications for the specified URI pattern.


Param Type Default Description
uriPattern string

URI and/or pattern of the resource(s) to subscribe for.

onEvent ( message:CarbonLDP.Messaging.MemberRemoved ) => void

Callback that receives the data message from the notifications event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



.one()
: void


one( event:CarbonLDP.Messaging.Event.CHILD_CREATED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.ChildCreated ) => void, onError:( error:Error ) => void ):void

Subscribe to only one event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.CHILD_CREATED

The event to subscribe for the notification.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.ChildCreated ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



one( event:CarbonLDP.Messaging.Event.ACCESS_POINT_CREATED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.AccessPointCreated ) => void, onError:( error:Error ) => void ):void

Subscribe to only one event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.ACCESS_POINT_CREATED

The event to subscribe for the notification.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.AccessPointCreated ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



one( event:CarbonLDP.Messaging.Event.DOCUMENT_CREATED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentCreated ) => void, onError:( error:Error ) => void ):void

Subscribe to only one event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.DOCUMENT_CREATED

The event to subscribe for the notification.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.DocumentCreated ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



one( event:CarbonLDP.Messaging.Event.DOCUMENT_MODIFIED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentModified ) => void, onError:( error:Error ) => void ):void

Subscribe to only one event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.DOCUMENT_MODIFIED

The event to subscribe for the notification.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.DocumentModified ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



one( event:CarbonLDP.Messaging.Event.DOCUMENT_DELETED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.DocumentDeleted ) => void, onError:( error:Error ) => void ):void

Subscribe to only one event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.DOCUMENT_DELETED

The event to subscribe for the notification.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.DocumentDeleted ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



one( event:CarbonLDP.Messaging.Event.MEMBER_ADDED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.MemberAdded ) => void, onError:( error:Error ) => void ):void

Subscribe to only one event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.MEMBER_ADDED

The event to subscribe for the notification.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.MemberAdded ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



one( event:CarbonLDP.Messaging.Event.MEMBER_REMOVED, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.MemberRemoved ) => void, onError:( error:Error ) => void ):void

Subscribe to only one event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event.MEMBER_REMOVED

The event to subscribe for the notification.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.MemberRemoved ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



one( event:CarbonLDP.Messaging.Event | string, uriPattern:string, onEvent:( message:CarbonLDP.Messaging.EventMessage ) => void, onError:( error:Error ) => void ):void

Subscribe to only one event notification in any specified URI pattern.


Param Type Default Description
event CarbonLDP.Messaging.Event | string

The event to subscribe for the notification.

uriPattern string

URI and/or pattern of the resource(s) to subscribe for the event specified.

onEvent ( message:CarbonLDP.Messaging.EventMessage ) => void

Callback that receives the data message from the notification event.

onError ( error:Error ) => void

Callback that receives the errors thrown by the subscription.



.refresh()
: Promise<T & CarbonLDP.PersistedDocument>


refresh<T extends object>( persistedDocument:T & CarbonLDP.PersistedDocument, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.PersistedDocument>

Update the specified document with the data of the Carbon LDP server, if a newest version exists.


Param Type Default Description
persistedDocument T & CarbonLDP.PersistedDocument

The persisted document to update.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.register()
: T & CarbonLDP.PersistedDocument


register<T extends object>( id:string, types?:string[] ):T & CarbonLDP.PersistedDocument

Register an empty PersistedDocument with the provided id and decorate it with the types provided.


Param Type Default Description
id string
types string[]


.removeAllMembers()
: Promise<void>


removeAllMembers( documentURI:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Remove all the member relations from the document container specified.


Param Type Default Description
documentURI string

URI of the document container where the members will be removed.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.removeMember()
: Promise<void>


removeMember( documentURI:string, member:CarbonLDP.Pointer, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Remove the member relation between the Pointer and the resource container specified.


Param Type Default Description
documentURI string

URI of the resource container from where the member will be removed.

member CarbonLDP.Pointer

Pointer object that references the resource to remove as a member.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



removeMember( documentURI:string, memberURI:string, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Remove the member relation between the resource URI and the resource container specified.


Param Type Default Description
documentURI string

URI of the resource container from where the member will be removed.

memberURI string

URI of the resource to remove as a member.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.removeMembers()
: Promise<void>


removeMembers( documentURI:string, members:(CarbonLDP.Pointer | string)[], requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<void>

Remove the member relation to every specified resource URI or Pointer form the document container specified.


Param Type Default Description
documentURI string

URI of the document container where the members will be removed.

members (CarbonLDP.Pointer | string)[]

Array of URIs or Pointers to remove as members

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.save()
: Promise<T & CarbonLDP.PersistedDocument>


save<T extends object>( persistedDocument:T & CarbonLDP.PersistedDocument, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.PersistedDocument>

Update the data of the document provided in the server.


Param Type Default Description
persistedDocument T & CarbonLDP.PersistedDocument

The persisted document with the data to update in the server.

requestOptions CarbonLDP.HTTP.RequestOptions

Customisable options for the request.



.saveAndRefresh()
: Promise<T & CarbonLDP.PersistedDocument>


saveAndRefresh<T extends object>( persistedDocument:T & CarbonLDP.PersistedDocument, requestOptions?:CarbonLDP.HTTP.RequestOptions ):Promise<T & CarbonLDP.PersistedDocument>

Save and refresh the PersistedDocument specified. If the documents is partial the refresh will be executed with another query.


Param Type Default Description
persistedDocument T & CarbonLDP.PersistedDocument

The persistedDocument to save and refresh.

requestOptions CarbonLDP.HTTP.RequestOptions

Customizable options for the request.



.sparql()
: SPARQLER/Clauses/QueryClause<CarbonLDP.SPARQL.Builder.FinishSPARQLSelect>


sparql( documentURI:string ):SPARQLER/Clauses/QueryClause<CarbonLDP.SPARQL.Builder.FinishSPARQLSelect>

Method that creates an instance of SPARQLER for the provided document end-point.


Param Type Default Description
documentURI string

URI of the document where to execute the SPARQL query.








Classes

C
CarbonLDP.Errors.AbstractError
Class that works as template for the custom errors in the SDK.




Class that works as template for the custom errors in the SDK.


Constructor


AbstractError( message:string )

Param Type Default Description
message string

Properties

.message
: string


.name
: string





Classes

C
CarbonLDP.Errors.IDAlreadyInUseError
Error class to indicate that an identifier (ID) is already in use.




Error class to indicate that an identifier (ID) is already in use.


Properties

.name
: string





Classes

C
CarbonLDP.Errors.IllegalActionError
Error class to indicate that an action not allowed was attempted.




Error class to indicate that an action not allowed was attempted.


Properties

.name
: string





Classes

C
CarbonLDP.Errors.IllegalArgumentError
Error class to indicate that a different argument than the expected was provided.




Error class to indicate that a different argument than the expected was provided.


Properties

.name
: string





Classes

C
CarbonLDP.Errors.IllegalStateError
Error class to indicate that a task can't be completed because of the lack of pre-required configuration or execution of previous tasks.




Error class to indicate that a task can't be completed because of the lack of pre-required configuration or execution of previous tasks.


Constructor


IllegalStateError( message?:string )

Param Type Default Description
message string

Properties

.name
: string





Classes

C
CarbonLDP.Errors.InvalidJSONLDSyntaxError
Error class to indicate that there an invalid syntax in a JSON-LD object.




Error class to indicate that there an invalid syntax in a JSON-LD object.


Properties

.name
: string





Classes

C
CarbonLDP.Errors.NotImplementedError
Error class to indicate that an action is not yet implemented.




Error class to indicate that an action is not yet implemented.


Constructor


NotImplementedError( message?:string )

Param Type Default Description
message string

Properties

.name
: string





Interfaces

I
CarbonLDP.Fragment
Interface of an in-memory fragment of a document.
I
CarbonLDP.FragmentFactory
Interface with the factory, decorate and utils methods of a CarbonLDP.Fragment object.

Properties

#Fragment
: CarbonLDP.FragmentFactory

Constant that implements the CarbonLDP.FragmentFactory interface





CarbonLDP.Fragment
Interface

Interface of an in-memory fragment of a document.


Properties

._document
: CarbonLDP.Document

The document the fragment belongs to.





Interface with the factory, decorate and utils methods of a CarbonLDP.Fragment object.


Methods

.create()
: CarbonLDP.Fragment


create( document:CarbonLDP.Document, id?:string ):CarbonLDP.Fragment

Creates a Fragment with the ID if provided.


Param Type Default Description
document CarbonLDP.Document

The document that the fragment will be part of.

id string

The ID of the fragment to create.



.createFrom()
: T & CarbonLDP.Fragment


createFrom<T extends object>( object:T, document:CarbonLDP.Document, id?:string ):T & CarbonLDP.Fragment

Creates a Fragment from an object with the ID if provided.


Param Type Default Description
object T

Object that will be converted to a fragment.

document CarbonLDP.Document

The document that the fragment will be part of.

id string

The ID that will be assigned to the fragment.



.decorate()
: T & CarbonLDP.Fragment


decorate<T extends object>( object:T ):T & CarbonLDP.Fragment

Decorates the object with the required CarbonLDP.Fragment properties and methods.


Param Type Default Description
object T

Object that will be converted to a fragment.



.is()
: object is CarbonLDP.Fragment


is( object:object ):object is CarbonLDP.Fragment

Returns true if the object provided is considered a CarbonLDP.Fragment object.


Param Type Default Description
object object


.isDecorated()
: object is CarbonLDP.Fragment


isDecorated( object:object ):object is CarbonLDP.Fragment

Returns true if the object provided has the properties and methods of a CarbonLDP.Fragment object.


Param Type Default Description
object object




Interfaces

I
CarbonLDP.FreeResources
Interface that represents a set of free resources.
I
CarbonLDP.FreeResourcesFactory
Interfaces with the factory, decorate and utils methods of a CarbonLDP.FreeResources object.

Properties




Interface that represents a set of free resources.


Properties

._documents
: Private property that contains the Documents class where the object scope is in.

._resourcesIndex
: Private property that contains the references of every free resource in a map form.

Map<string, CarbonLDP.Resource>


Methods

.createResource()
: CarbonLDP.Resource


createResource( id?:string ):CarbonLDP.Resource

Creates and returns a new free resource. Throw an Error if no valid ID if provided or if it's already in use.


Param Type Default Description
id string

The ID of the resource to create. It should be an ID as a BlankNode.



.createResourceFrom()
: CarbonLDP.Resource


createResourceFrom<T>( object:T, id?:string ):CarbonLDP.Resource

Create and returns a new free resource from an object. Throw an Error if no valid id is provided or if it is already in use.


Param Type Default Description
object T

The object to be used as the new resource.

id string

The ID of the resource to create. It should be an ID as a BlankNode.



.getPointer()
: CarbonLDP.Pointer


getPointer( id:string ):CarbonLDP.Pointer

Returns the pointer referred by the ID specified, or creates one if no pointer exists in the scope.


Param Type Default Description
id string

The ID of the pointer sought for or the one to create.



.getResource()
: CarbonLDP.Resource


getResource( id:string ):CarbonLDP.Resource

Returns the resource referred by the ID provided. If no resource exists with the ID specified, null is returned.


Param Type Default Description
id string

The ID of the resource to sought for.



.getResources()
: CarbonLDP.Resource[]


getResources():CarbonLDP.Resource[]

Returns an array with all the resources inside the FreeResources object.




.hasResource()
: boolean


hasResource( id:string ):boolean

Returns true if a resource with the ID specified exists.


Param Type Default Description
id string

The ID of the resource to sought for.



.toJSON()
: CarbonLDP.RDF.RDFNode[]


toJSON():CarbonLDP.RDF.RDFNode[]

Converts the resources contained in the current CarbonLDP.FreeResources object to a JSON object.






Interfaces with the factory, decorate and utils methods of a CarbonLDP.FreeResources object.


Methods

.create()
: CarbonLDP.FreeResources


create( documents:CarbonLDP.Documents ):CarbonLDP.FreeResources

Creates a empty CarbonLDP.FreeResources object.


Param Type Default Description
documents CarbonLDP.Documents

A CarbonLDP.Documents object where the FreeResources scope is in.



.createFrom()
: T & CarbonLDP.FreeResources


createFrom<T extends object>( object:T, documents:CarbonLDP.Documents ):T & CarbonLDP.FreeResources

Creates a CarbonLDP.FreeResources object from the plain object provided.


Param Type Default Description
object T

The object that wants be converted in a CarbonLDP.FreeResources.

documents CarbonLDP.Documents

A CarbonLDP.Documents object where the FreeResources scope is in.



.decorate()
: T & CarbonLDP.FreeResources


decorate<T extends object>( object:T ):T & CarbonLDP.FreeResources

Decorates the object provided with the properties and methods of a CarbonLDP.FreeResources object.


Param Type Default Description
object T


.is()
: object is CarbonLDP.FreeResources


is( object:object ):object is CarbonLDP.FreeResources

Returns true if the object is considered a CarbonLDP.FreeResources object.


Param Type Default Description
object object

Object to evaluate.



.isDecorated()
: object is CarbonLDP.FreeResources


isDecorated( object:object ):object is CarbonLDP.FreeResources

Returns true if the object provided has the properties and methods of a CarbonLDP.FreeResources object.


Param Type Default Description
object object

Object to evaluate.








Reexports


Properties

#statusCodeMap
: Map<number, typeof CarbonLDP.HTTP.Errors.HTTPError>

Map where all the HTTP Status Codes used in the SDK are assigned to their specific error class.





Classes

C
CarbonLDP.HTTP.Errors.BadRequestError
Error class to indicate that a malformed request has been sent.




Error class to indicate that a malformed request has been sent.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.ConflictError
Error class to indicate that the request could not be processed because of a conflict, such as an ID conflict.




Error class to indicate that the request could not be processed because of a conflict, such as an ID conflict.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.ForbiddenError
Error class to indicate that the current user doesn't have permissions to fulfill the request.




Error class to indicate that the current user doesn't have permissions to fulfill the request.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.MethodNotAllowedError
Error class to indicate that the method used in the request is not allowed for that URI.




Error class to indicate that the method used in the request is not allowed for that URI.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.NotAcceptableError
Error class to indicate that the server cannot respond with the data type specified by the accept header of the request.




Error class to indicate that the server cannot respond with the data type specified by the accept header of the request.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.NotFoundError
Error class to indicate that the resource was not found.




Error class to indicate that the resource was not found.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.PreconditionFailedError
Error class to indicate that the precondition header was resolved to false.




Error class to indicate that the precondition header was resolved to false.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.PreconditionRequiredError
Error class to indicate that the request is missing a precondition header.




Error class to indicate that the request is missing a precondition header.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.RequestEntityTooLargeError
Error class to indicate that the request entity is larger than the server is able to process.




Error class to indicate that the request entity is larger than the server is able to process.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.RequestHeaderFieldsTooLargeError
Error class to indicate that the server is not able to process the request because its header fields are too large.




Error class to indicate that the server is not able to process the request because its header fields are too large.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.RequestURITooLongError
Error class to indicate that the server is not able to process the request because the URI is too long.




Error class to indicate that the server is not able to process the request because the URI is too long.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.TooManyRequestsError
Error class to indicate that the current user has sent too many request in a given amount of time.




Error class to indicate that the current user has sent too many request in a given amount of time.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.UnauthorizedError
Error class to indicate that authentication is required or has failed.




Error class to indicate that authentication is required or has failed.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.UnsupportedMediaTypeError
Error class to indicate that the request has a media-type not supported by the server.




Error class to indicate that the request has a media-type not supported by the server.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.HTTPError
Generic error class that defines any type of HTTP Error used in the SDK.




Generic error class that defines any type of HTTP Error used in the SDK.


Constructor


HTTPError( message:string, response:CarbonLDP.HTTP.Response )

Param Type Default Description
message string
response CarbonLDP.HTTP.Response

Properties

Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.BadGatewayError
Error class to indicate that the server was acting as a gateway or proxy and received an invalid response from the upstream server.




Error class to indicate that the server was acting as a gateway or proxy and received an invalid response from the upstream server.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.BadResponseError
Error class to indicate that the response obtained isn't the expected or can't be interpreted.




Error class to indicate that the response obtained isn't the expected or can't be interpreted.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.GatewayTimeoutError
Error class to indicate that the server, while acting as a gateway or proxy, did not receive a timely response from the upstream server.




Error class to indicate that the server, while acting as a gateway or proxy, did not receive a timely response from the upstream server.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.HTTPVersionNotSupportedError
Error class to indicate that the server doesn't support the HTTP protocol version used in the request.




Error class to indicate that the server doesn't support the HTTP protocol version used in the request.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.InternalServerErrorError
Error class to indicate that the server encountered an unexpected condition. This generic error is given when no other specific error is suitable.




Error class to indicate that the server encountered an unexpected condition. This generic error is given when no other specific error is suitable.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.NotImplementedError
Error class to indicate that the server doesn't have the ability to fulfill the request yet.




Error class to indicate that the server doesn't have the ability to fulfill the request yet.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.ServiceUnavailableError
Error class to indicate that the server is currently unavailable (because it's overloaded or down for maintenance).




Error class to indicate that the server is currently unavailable (because it's overloaded or down for maintenance).


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.Errors.UnknownError
Error class that defines any error that could not be identified.




Error class that defines any error that could not be identified.


Properties

#statusCode
: number


.name
: string


Methods

.toString()
: string


toString():string





.HTTPMethod
: enum

Enum with the HTTP/1.1 methods.

Enumeration Description
CarbonLDP.HTTP.HTTPMethod.OPTIONS

Enum that identifies the OPTIONS HTTP/1.1 method, which allows the client to determine the options and/or requirements associated with a resource, or the capabilities of a server, without implying a resource action or initiating a resource retrieval.

CarbonLDP.HTTP.HTTPMethod.HEAD

Enum that identifies the HEAD HTTP/1.1 method, which returns only the headers of a GET HTTP request.

CarbonLDP.HTTP.HTTPMethod.GET

Enum that identifies the GET HTTP/1.1 method, which returns whatever information is identified by the request URI.

CarbonLDP.HTTP.HTTPMethod.POST

Enum that identifies the POST HTTP/1.1 method, which requests to the server to create a new entity.

CarbonLDP.HTTP.HTTPMethod.PUT

Enum that identifies the PUT HTTP/1.1 method, which allows you to replace an entirely entity, or to send a signal to a resource.

CarbonLDP.HTTP.HTTPMethod.PATCH

Enum that identifies the PATCH HTTP/1.1 method, which allows you to update specified fields of an entity.

CarbonLDP.HTTP.HTTPMethod.DELETE

Enum that identifies the DELETE HTTP/1.1 method, which allows you to request the deletion of a resource identified by the request URI.




Classes

C
CarbonLDP.HTTP.Header
Class to manage the values in an HTTP header.




Class to manage the values in an HTTP header.


Constructor


Header():void



Header( values:string[] ):void

Param Type Default Description
values string[]


Header( value:string ):void

Param Type Default Description
value string

Properties

.values
: string[]

Array that contains each value of the header.


Methods

#parseHeaders()
: Map <string, CarbonLDP.HTTP.Header>


parseHeaders( headersString:string ):Map <string, CarbonLDP.HTTP.Header>

Returns a Map object which relates all header names with a CarbonLDP.HTTP.Header object containing their values.


Param Type Default Description
headersString string

.toString()
: string


toString():string





Classes

C
CarbonLDP.HTTP.JSONParser
Wrapper class for the native JSON.parse() function using the Promise pattern.




Implements:

Wrapper class for the native JSON.parse() function using the Promise pattern.


Methods

.parse()
: Promise<object>


parse( body:string ):Promise<object>

Param Type Default Description
body string

A JSON string to parse.





Interfaces

I
CarbonLDP.HTTP.Parser
Interface that represents a what a parser must contains to be used when converting the response of a request.




Interface that represents a what a parser must contains to be used when converting the response of a request.


Methods

.parse()
: Promise<T>


parse( body:string ):Promise<T>

Method that parse the provided string to an specified T element.


Param Type Default Description
body string

The string to parse.





Classes

C
CarbonLDP.HTTP.RequestService
Class with functions to easily manage HTTP requests.
C
CarbonLDP.HTTP.RequestUtils
Class with useful functions to manage the options object of a request.

Interfaces

I
CarbonLDP.HTTP.RequestOptions
Customizable options that can change the behaviour of the request.
I
CarbonLDP.HTTP.RetrievalPreferences
Object used at CarbonLDP.HTTP.RequestUtils#setRetrievalPreferences() method, which specifies the behaviour of the of the requested document as a ldp:container.




Customizable options that can change the behaviour of the request.


Properties

.headers
: Map<string, CarbonLDP.HTTP.Header>

Map that contains the references to the headers to include in the request.


.sendCredentialsOnCORS
: boolean

Flag that enables Cross-Origin Resource Sharing (CORS).





Class with functions to easily manage HTTP requests.


Methods

#delete()
: Promise<CarbonLDP.HTTP.Response>


delete( url:string, body:string, options?:object ):Promise<CarbonLDP.HTTP.Response>

Simple delete request.


Param Type Default Description
url string
body string
options object { sendCredentialsOnCORS: true }


delete( url:string, options?:object, parser?:CarbonLDP.HTTP.Parser<T> ):Promise<CarbonLDP.HTTP.Response>

Delete request with specified response parser.


Param Type Default Description
url string
options object { sendCredentialsOnCORS: true }
parser CarbonLDP.HTTP.Parser<T>


delete( url:string, options?:object ):Promise<CarbonLDP.HTTP.Response>

Simple delete request.


Param Type Default Description
url string
options object { sendCredentialsOnCORS: true }


delete( url:string, options?:object, parser?:CarbonLDP.HTTP.Parser<T> ):Promise<CarbonLDP.HTTP.Response>

Delete request with specified response parser.


Param Type Default Description
url string
options object { sendCredentialsOnCORS: true }
parser CarbonLDP.HTTP.Parser<T>


#get()
: Promise<CarbonLDP.HTTP.Response>


get( url:string, options?:object ):Promise<CarbonLDP.HTTP.Response>

Simple get request.


Param Type Default Description
url string
options object { sendCredentialsOnCORS: true }


get( url:string, options?:object, parser?:CarbonLDP.HTTP.Parser<T> ):Promise<[Object, CarbonLDP.HTTP.Response]>

Get request with specified response parser.


Param Type Default Description
url string
options object { sendCredentialsOnCORS: true }
parser CarbonLDP.HTTP.Parser<T>


#head()
: Promise<CarbonLDP.HTTP.Response>


head( url:string, options?:object ):Promise<CarbonLDP.HTTP.Response>

Param Type Default Description
url string
options object { sendCredentialsOnCORS: true }


#options()
: Promise<CarbonLDP.HTTP.Response>


options( url:string, options?:object ):Promise<CarbonLDP.HTTP.Response>

Param Type Default Description
url string
options object { sendCredentialsOnCORS: true }


#patch()
: Promise<CarbonLDP.HTTP.Response>


patch( url:string, body:string, options?:object ):Promise<CarbonLDP.HTTP.Response>

Simple patch request.


Param Type Default Description
url string
body string
options object { sendCredentialsOnCORS: true }


patch( url:string, options?:object, parser?:CarbonLDP.HTTP.Parser<T> ):Promise<CarbonLDP.HTTP.Response>

Patch request with specified response parser.


Param Type Default Description
url string
options object { sendCredentialsOnCORS: true }
parser CarbonLDP.HTTP.Parser<T>


#post()
: Promise<CarbonLDP.HTTP.Response>


post( url:string, body:string, options?:object ):Promise<CarbonLDP.HTTP.Response>

Simple post request.


Param Type Default Description
url string
body string
options object { sendCredentialsOnCORS: true }


post( url:string, options?:object, parser?:CarbonLDP.HTTP.Parser<T> ):Promise<CarbonLDP.HTTP.Response>

Post request with specified response parser.


Param Type Default Description
url string
options object { sendCredentialsOnCORS: true }
parser CarbonLDP.HTTP.Parser<T>


#put()
: Promise<CarbonLDP.HTTP.Response>


put( url:string, body:string, options?:object ):Promise<CarbonLDP.HTTP.Response>

Simple put request.


Param Type Default Description
url string
body string
options object { sendCredentialsOnCORS: true }


put( url:string, options?:object, parser?:CarbonLDP.HTTP.Parser<T> ):Promise<CarbonLDP.HTTP.Response>

Put request with specified response parser.


Param Type Default Description
url string
options object { sendCredentialsOnCORS: true }
parser CarbonLDP.HTTP.Parser<T>


#send()
: Promise<CarbonLDP.HTTP.Response>


send( url:string, body:string, options:object ):Promise<CarbonLDP.HTTP.Response>

Generic send method, to be used by the others methods in the class.


Param Type Default Description
url string
body string
options object




Class with useful functions to manage the options object of a request.


Methods

#getHeader()
: CarbonLDP.HTTP.Header


getHeader( headerName:string, requestOptions:CarbonLDP.HTTP.RequestOptions, initialize?:boolean ):CarbonLDP.HTTP.Header

Returns the header object of a header-name inside an options object request. Returns undefined if the header doesn't exists. If initialize flag is provided with true, an empty header will be created even if it already exits.


Param Type Default Description
headerName string
requestOptions CarbonLDP.HTTP.RequestOptions
initialize boolean false


#isOptions()
: boolean


isOptions( object:Object ):boolean

Returns true if the object provided has at least a property of a CarbonLDP.HTTP.Request.Option object.


Param Type Default Description
object Object

The object to evaluate.



#setAcceptHeader()
: CarbonLDP.HTTP.RequestOptions


setAcceptHeader( accept:string, requestOptions:CarbonLDP.HTTP.RequestOptions ):CarbonLDP.HTTP.RequestOptions

Set an Accept header in an options object request.


Param Type Default Description
accept string
requestOptions CarbonLDP.HTTP.RequestOptions


#setContentTypeHeader()
: CarbonLDP.HTTP.RequestOptions


setContentTypeHeader( contentType:string, requestOptions:CarbonLDP.HTTP.RequestOptions ):CarbonLDP.HTTP.RequestOptions

Set a Content-Type header in an options object request.


Param Type Default Description
contentType string
requestOptions CarbonLDP.HTTP.RequestOptions


#setIfMatchHeader()
: CarbonLDP.HTTP.RequestOptions


setIfMatchHeader( eTag:string, requestOptions:CarbonLDP.HTTP.RequestOptions ):CarbonLDP.HTTP.RequestOptions

Set an If-Match header in an options object request.


Param Type Default Description
eTag string
requestOptions CarbonLDP.HTTP.RequestOptions


#setIfNoneMatchHeader()
: Object


setIfNoneMatchHeader( eTag:string, requestOptions:CarbonLDP.HTTP.RequestOptions ):Object

Set an If-None-Match header in an options object request.


Param Type Default Description
eTag string
requestOptions CarbonLDP.HTTP.RequestOptions


#setPreferredInteractionModel()
: CarbonLDP.HTTP.RequestOptions


setPreferredInteractionModel( interactionModelURI:string, requestOptions:CarbonLDP.HTTP.RequestOptions ):CarbonLDP.HTTP.RequestOptions

Set a Prefer header with rel=interaction-model in an options object request.


Param Type Default Description
interactionModelURI string
requestOptions CarbonLDP.HTTP.RequestOptions


#setPreferredRetrieval()
: CarbonLDP.HTTP.RequestOptions


setPreferredRetrieval( retrievalType:"representation" | "minimal", requestOptions:CarbonLDP.HTTP.RequestOptions ):CarbonLDP.HTTP.RequestOptions

Set a Prefer header which indicates to the platform to type of retrieval to make.


Param Type Default Description
retrievalType "representation" | "minimal"

If "representation" is chosen the platform must retrieve the entire resource; otherwise when "minimal" is sent the minimal data will be returned generally an empty one.

requestOptions CarbonLDP.HTTP.RequestOptions


#setRetrievalPreferences()
: CarbonLDP.HTTP.RequestOptions


setRetrievalPreferences( preference:CarbonLDP.HTTP.RetrievalPreferences, requestOptions:CarbonLDP.HTTP.RequestOptions ):CarbonLDP.HTTP.RequestOptions

Set a Prefer header with return=representation in an options object request.


Param Type Default Description
preference CarbonLDP.HTTP.RetrievalPreferences
requestOptions CarbonLDP.HTTP.RequestOptions


#setSlug()
: CarbonLDP.HTTP.RequestOptions


setSlug( slug:string, requestOptions:CarbonLDP.HTTP.RequestOptions ):CarbonLDP.HTTP.RequestOptions

Set a Slug header in an options object request.


Param Type Default Description
slug string
requestOptions CarbonLDP.HTTP.RequestOptions




Object used at CarbonLDP.HTTP.RequestUtils#setRetrievalPreferences() method, which specifies the behaviour of the of the requested document as a ldp:container.


Properties

.include
: string[]

Prefer URIs that indicates some specific information should be returned in the request's response.


.omit
: string[]

Prefer URIs that indicates some specific information should NOT be included in the request's response.





Classes

C
CarbonLDP.HTTP.Response
Class that represents an HTTP Response.




Class that represents an HTTP Response.


Constructor


Response( request:XMLHttpRequest ):void

Signature that only works in a web browser.


Param Type Default Description
request XMLHttpRequest


Response( request:ClientRequest, data:string, response:IncomingMessage ):void

Signature that only works in Node.js.


Param Type Default Description
request ClientRequest
data string
response IncomingMessage

Properties

.data
: string

The raw body returned by the request.


.headers
: Map<string, CarbonLDP.HTTP.Header>

A map object containing the headers returned by the request.


.request
: XMLHttpRequest | ClientRequest

The XMLHttpRequest object that was provided in the constructor when working in a Browser, or the ClientRequest object when working with Node.js.


.status
: number

The status code returned by the request.


Methods

.getETag()
: string


getETag():string

Return the ETag header of a CarbonLDP.HTTP.Response object. Returns null if no ETag exists.




.getHeader()
: CarbonLDP.HTTP.Header


getHeader( name:string ):CarbonLDP.HTTP.Header

Return the Header object referred by the name specified.


Param Type Default Description
name string




.StatusCode
: enum

Enum with the HTTP/1.1 status codes.

Enumeration Description
CarbonLDP.HTTP.StatusCode.CONTINUE

Enum that identifies the HTTP/1.1 100 status code.

CarbonLDP.HTTP.StatusCode.SWITCHING_PROTOCOLS

Enum that identifies the HTTP/1.1 101 status code.

CarbonLDP.HTTP.StatusCode.OK

Enum that identifies the HTTP/1.1 200 status code.

CarbonLDP.HTTP.StatusCode.CREATED

Enum that identifies the HTTP/1.1 201 status code.

CarbonLDP.HTTP.StatusCode.ACCEPTED

Enum that identifies the HTTP/1.1 202 status code.

CarbonLDP.HTTP.StatusCode.NON_AUTHORITATIVE_INFORMATION

Enum that identifies the HTTP/1.1 203 status code.

CarbonLDP.HTTP.StatusCode.NO_CONTENT

Enum that identifies the HTTP/1.1 204 status code.

CarbonLDP.HTTP.StatusCode.RESET_CONTENT

Enum that identifies the HTTP/1.1 205 status code.

CarbonLDP.HTTP.StatusCode.PARTIAL_CONTENT

Enum that identifies the HTTP/1.1 206 status code.

CarbonLDP.HTTP.StatusCode.MULTIPLE_CHOICES

Enum that identifies the HTTP/1.1 300 status code.

CarbonLDP.HTTP.StatusCode.MOVED_PERMANENTLY

Enum that identifies the HTTP/1.1 301 status code.

CarbonLDP.HTTP.StatusCode.FOUND

Enum that identifies the HTTP/1.1 302 status code.

CarbonLDP.HTTP.StatusCode.SEE_OTHER

Enum that identifies the HTTP/1.1 303 status code.

CarbonLDP.HTTP.StatusCode.NOT_MODIFIED

Enum that identifies the HTTP/1.1 304 status code.

CarbonLDP.HTTP.StatusCode.USE_PROXY

Enum that identifies the HTTP/1.1 305 status code.

CarbonLDP.HTTP.StatusCode.TEMPORARY_REDIRECT

Enum that identifies the HTTP/1.1 307 status code.

CarbonLDP.HTTP.StatusCode.BAD_REQUEST

Enum that identifies the HTTP/1.1 400 status code.

CarbonLDP.HTTP.StatusCode.UNAUTHORIZED

Enum that identifies the HTTP/1.1 401 status code.

CarbonLDP.HTTP.StatusCode.PAYMENT_REQUIRED

Enum that identifies the HTTP/1.1 402 status code.

CarbonLDP.HTTP.StatusCode.FORBIDDEN

Enum that identifies the HTTP/1.1 403 status code.

CarbonLDP.HTTP.StatusCode.NOT_FOUND

Enum that identifies the HTTP/1.1 404 status code.

CarbonLDP.HTTP.StatusCode.METHOD_NOT_ALLOWED

Enum that identifies the HTTP/1.1 405 status code.

CarbonLDP.HTTP.StatusCode.NOT_ACCEPTABLE

Enum that identifies the HTTP/1.1 406 status code.

CarbonLDP.HTTP.StatusCode.PROXY_AUTHENTICATION_REQUIRED

Enum that identifies the HTTP/1.1 407 status code.

CarbonLDP.HTTP.StatusCode.REQUEST_TIME_OUT

Enum that identifies the HTTP/1.1 408 status code.

CarbonLDP.HTTP.StatusCode.CONFLICT

Enum that identifies the HTTP/1.1 409 status code.

CarbonLDP.HTTP.StatusCode.GONE

Enum that identifies the HTTP/1.1 410 status code.

CarbonLDP.HTTP.StatusCode.LENGTH_REQUIRED

Enum that identifies the HTTP/1.1 411 status code.

CarbonLDP.HTTP.StatusCode.PRECONDITION_FAILED

Enum that identifies the HTTP/1.1 412 status code.

CarbonLDP.HTTP.StatusCode.REQUEST_ENTITY_TOO_LARGE

Enum that identifies the HTTP/1.1 413 status code.

CarbonLDP.HTTP.StatusCode.REQUEST_URI_TOO_LARGE

Enum that identifies the HTTP/1.1 414 status code.

CarbonLDP.HTTP.StatusCode.UNSUPPORTED_MEDIA_TYPE

Enum that identifies the HTTP/1.1 415 status code.

CarbonLDP.HTTP.StatusCode.REQUESTED_RANGE_NOT_SATISFIABLE

Enum that identifies the HTTP/1.1 416 status code.

CarbonLDP.HTTP.StatusCode.EXPECTATION_FAILED

Enum that identifies the HTTP/1.1 417 status code.

CarbonLDP.HTTP.StatusCode.INTERNAL_SERVER_ERROR

Enum that identifies the HTTP/1.1 500 status code.

CarbonLDP.HTTP.StatusCode.NOT_IMPLEMENTED

Enum that identifies the HTTP/1.1 501 status code.

CarbonLDP.HTTP.StatusCode.BAD_GATEWAY

Enum that identifies the HTTP/1.1 502 status code.

CarbonLDP.HTTP.StatusCode.SERVICE_UNAVAILABLE

Enum that identifies the HTTP/1.1 503 status code.

CarbonLDP.HTTP.StatusCode.GATEWAY_TIME_OUT

Enum that identifies the HTTP/1.1 504 status code.

CarbonLDP.HTTP.StatusCode.HTTP_VERSION_NOT_SUPPORTED

Enum that identifies the HTTP/1.1 505 status code.







Implements:

Parses the body of a CarbonLDP.HTTP.Response and returns a string.


Methods

.parse()
: Promise<string>


parse( body:string ):Promise<string>

Gets a string and returns a Promise with the same string.


Param Type Default Description
body string







Classes

C
CarbonLDP.JSONLD.JSONLDCompacter
Class for compacting a set of RDF resources in level of relations




Class for compacting a set of RDF resources in level of relations


Methods




Classes

C
CarbonLDP.JSONLD.JSONLDConverter
Class that have methods for convert expanded JSON-LD objects to compacted Carbon SDK Resources and vice versa.




Class that have methods for convert expanded JSON-LD objects to compacted Carbon SDK Resources and vice versa.


Constructor


JSONLDConverter( literalSerializers?:Map<string, CarbonLDP.RDF.Literal.Serializer> )

Param Type Default Description
literalSerializers Map<string, CarbonLDP.RDF.Literal.Serializer>

A Map object with the data type serializers that the converter will only be able to handle.


Properties

.literalSerializers
: Map<string, CarbonLDP.RDF.Literal.Serializer>

A Map object with data-type/serializer pairs for stringify the data of a SDK Resource when expanding it.


Methods

.compact()
: Object


compact( expandedObject:Object, targetObject:Object, digestedSchema:CarbonLDP.DigestedObjectSchema, pointerLibrary:CarbonLDP.PointerLibrary ):Object

Assign the data of the expanded JSON-LD object, to the target object in a friendly mode, ie. without the JSON-LD Syntax Tokens and parsed values, in accordance to the schema provided.


Param Type Default Description
expandedObject Object

The JSON-LD object to compact.

targetObject Object

The target object where will be added the data of the expanded object.

digestedSchema CarbonLDP.DigestedObjectSchema

The schema that describes how compact the expanded object.

pointerLibrary CarbonLDP.PointerLibrary

An object from where one can obtain pointers to SDK Resources.



.expand()
: Object


expand( compactedObject:Object, digestedSchema:CarbonLDP.DigestedObjectSchema ):Object

Creates a expanded JSON-LD object from the compacted object in accordance to the schema provided.


Param Type Default Description
compactedObject Object

The compacted object to generate its expanded JSON-LD object.

digestedSchema CarbonLDP.DigestedObjectSchema

The schema that describes how construct the expanded object.





Classes

C
CarbonLDP.JSONLD.JSONLDParser
Class to parse strings to valid JSONLD objects.




Implements:

Class to parse strings to valid JSONLD objects.


Methods

.parse()
: Promise<object[]>


parse( body:string ):Promise<object[]>

Parse the string provided using the CarbonLDP.JSONLD.JSONLDProcessor#expand() method.


Param Type Default Description
body string

A JSON-LD string to parse.





Classes

C
CarbonLDP.JSONLD.JSONLDProcessor
Class that contains methods that can process JSON-LD objects.




Class that contains methods that can process JSON-LD objects.


Methods

#expand()
: Promise<object[]>


expand( input:object ):Promise<object[]>

Static method that expand a compacted JSON-LD object.


Param Type Default Description
input object

The compacted JSON-LD object to expand.








Interfaces

I
CarbonLDP.LDP.AddMemberAction
Interface that represents an object to be sent in a request that add members to a container.
I
CarbonLDP.LDP.AddMemberActionFactory
Interface with the factory, decorate and utils methods of CarbonLDP.LDP.AddMemberAction objects

Properties




Interface that represents an object to be sent in a request that add members to a container.


Properties

.targetMembers
: CarbonLDP.Pointer[]

Array with the members to be added to the container.





Interface with the factory, decorate and utils methods of CarbonLDP.LDP.AddMemberAction objects


Properties

Methods




Interfaces

I
CarbonLDP.LDP.DirectContainer
Interface that represents an ldp:DirectContainer.
I
CarbonLDP.LDP.DirectContainerFactory
Interface with the factory, decorate and utils methods of a CarbonLDP.LDP.DirectContainer

Properties




Interface that represents an ldp:DirectContainer.


Properties

.hasMembershipRelation
: CarbonLDP.Pointer

Pointer that reference to the property the direct container manages.


.membershipResource
: CarbonLDP.Pointer

Pointer that references the document that the direct container belongs to.





Interface with the factory, decorate and utils methods of a CarbonLDP.LDP.DirectContainer


Properties

.TYPE
: string


Methods

.create()
: CarbonLDP.LDP.DirectContainer


create( membershipResource:CarbonLDP.Pointer, hasMemberRelation:string | CarbonLDP.Pointer, isMemberOfRelation?:string | CarbonLDP.Pointer ):CarbonLDP.LDP.DirectContainer

Creates a CarbonLDP.LDP.DirectContainer object with the parameters specified.


Param Type Default Description
membershipResource CarbonLDP.Pointer
hasMemberRelation string | CarbonLDP.Pointer
isMemberOfRelation string | CarbonLDP.Pointer


.createFrom()
: T & CarbonLDP.LDP.DirectContainer


createFrom<T extends object>( object:T, membershipResource:CarbonLDP.Pointer, hasMemberRelation:string | CarbonLDP.Pointer, isMemberOfRelation?:string | CarbonLDP.Pointer ):T & CarbonLDP.LDP.DirectContainer

Creates a CarbonLDP.LDP.DirectContainer object with the object provided and the parameters specified.


Param Type Default Description
object T
membershipResource CarbonLDP.Pointer
hasMemberRelation string | CarbonLDP.Pointer
isMemberOfRelation string | CarbonLDP.Pointer


.is()
: object is CarbonLDP.LDP.DirectContainer


is( object:object ):object is CarbonLDP.LDP.DirectContainer

Returns true if the object provided is considered a CarbonLDP.LDP.DirectContainer object.


Param Type Default Description
object object




Interfaces

I
CarbonLDP.LDP.DocumentMetadata
Interface that represents a free node resource that contains dynamic information about an specific resource.
I
CarbonLDP.LDP.DocumentMetadataFactory
Interface with the factory, decorate and utils methods for CarbonLDP.LDP.DocumentMetadata objects.

Properties




Interface that represents a free node resource that contains dynamic information about an specific resource.


Properties

.bNodesMap
: CarbonLDP.LDP.Map<CarbonLDP.BlankNode, CarbonLDP.BlankNode>

A c:Map object that contains the changes of persisted BNode IDs.


.eTag
: string

The ETag of the resource the metadata refers to.


.relatedDocument
: CarbonLDP.Pointer

Reference to the resource the metadata information refers to.





Interface with the factory, decorate and utils methods for CarbonLDP.LDP.DocumentMetadata objects.


Properties

Methods

.is()
: object is CarbonLDP.LDP.DocumentMetadata


is( object:object ):object is CarbonLDP.LDP.DocumentMetadata

Return true if the object provided is considered a CarbonLDP.LDP.DocumentMetadata object.


Param Type Default Description
object object

Object to check.



.isDecorated()
: object is CarbonLDP.LDP.DocumentMetadata


isDecorated( object:object ):object is CarbonLDP.LDP.DocumentMetadata

Return true if the object provided has the properties of a CarbonLDP.LDP.DocumentMetadata object.


Param Type Default Description
object object

Object to check.





Interfaces

I
CarbonLDP.LDP.Error
Interface that represents an error occurred in the server.
I
CarbonLDP.LDP.ErrorFactory
Interface with the factory, decorate and utils function for CarbonLDP.LDP.Error objects.

Properties




Interface that represents an error occurred in the server.


Properties

.errorCode
: string

An specific code that indicates the type of error the current object is.


.errorMessage
: string

Message that explains the error occurred in the server.


.errorParameters
: CarbonLDP.LDP.Map<string, any>

Map that contains the specific elements that make the error been thrown.





Interface with the factory, decorate and utils function for CarbonLDP.LDP.Error objects.


Properties




Classes

C
CarbonLDP.LDP.ErrorResponseFactory
Useful functions for managing CarbonLDP.LDP.ErrorResponse objects.

Interfaces

I
CarbonLDP.LDP.ErrorResponse
Interface that its used to represents part of an error (or multiple of them) thrown by the server.
I
CarbonLDP.LDP.ErrorResponseFactory
Interface with the factory, decorate and utils methods for CarbonLDP.LDP.ErrorResponse objects.




Interface that its used to represents part of an error (or multiple of them) thrown by the server.


Properties

.errors
: CarbonLDP.LDP.Error[]

Array that list the error occurred in the server.


.requestID
: string

An ID that identifies the request which cause the error.


.statusCode
: number

The HTTP status code that represents all the errors occurred.





Interface with the factory, decorate and utils methods for CarbonLDP.LDP.ErrorResponse objects.


Properties

Methods

.getMessage()
: string


getMessage( errorResponse:CarbonLDP.LDP.ErrorResponse ):string

Returns a string with the message of all the errors in the ErrorResponse.


Param Type Default Description
errorResponse CarbonLDP.LDP.ErrorResponse

The ErrorResponse object to obtain the message from.





Useful functions for managing CarbonLDP.LDP.ErrorResponse objects.





Interfaces

I
CarbonLDP.LDP.Map
Interface that contains a set entries with a close relation in the form of a key/value pair.
I
CarbonLDP.LDP.MapFactory
Interface with the factory, decorate and utils methods for CarbonLDP.LDP.Map objects.

Properties




CarbonLDP.LDP.Map
Interface

Interface that contains a set entries with a close relation in the form of a key/value pair.


Properties

.entries
: CarbonLDP.LDP.MapEntry<K,V>[]

An array of entries' pair relations.





Interface with the factory, decorate and utils methods for CarbonLDP.LDP.Map objects.


Properties

Methods

.is()
: object is CarbonLDP.LDP.Map<any, any>


is( object:object ):object is CarbonLDP.LDP.Map<any, any>

Return true if the object provided is considered a CarbonLDP.LDP.Map object.


Param Type Default Description
object object

Object to check





Interfaces

I
CarbonLDP.LDP.MapEntry
Entries of the CarbonLDP.LDP.Map with the key/value pair.
I
CarbonLDP.LDP.MapEntryFactory
Interface with the factory, decorate and utils methods for CarbonLDP.LDP.MapEntry objects

Properties




Entries of the CarbonLDP.LDP.Map with the key/value pair.


Properties

.entryKey
: K

The key element of the entry's pair.


.entryValue
: V

The value element of the entry's pair.





Interface with the factory, decorate and utils methods for CarbonLDP.LDP.MapEntry objects


Properties




Interfaces

I
CarbonLDP.PersistedBlankNode
Interface that represents a persisted blank node of a persisted document.




Interface that represents a persisted blank node of a persisted document.





Interfaces

I
CarbonLDP.LDP.RemoveMemberAction
Interface that represents an object to be sent in a request that removes specific members to a container.
I
CarbonLDP.LDP.RemoveMemberActionFactory
Interface with the factory, decorate and utils methods for CarbonLDP.LDP.RemoveMemberAction

Properties




Interface that represents an object to be sent in a request that removes specific members to a container.


Properties

.targetMembers
: CarbonLDP.Pointer[]

Array with the members to be removed from the container.





Interface with the factory, decorate and utils methods for CarbonLDP.LDP.RemoveMemberAction


Properties

Methods




Interfaces

I
CarbonLDP.LDP.ResponseMetadata
Interface that represents the main resource of a set of metadata resources, which references everyone resource related to an specific dynamic response of tha server.
I
CarbonLDP.LDP.ResponseMetadataFactory
Interface with the factory, decorate and utils methods for CarbonLDP.LDP.ResponseMetadata objects.

Properties




Interface that represents the main resource of a set of metadata resources, which references everyone resource related to an specific dynamic response of tha server.


Properties

.documentsMetadata
: CarbonLDP.LDP.DocumentMetadata[]

An array with all the metadata resources of the dynamic response.





Interface with the factory, decorate and utils methods for CarbonLDP.LDP.ResponseMetadata objects.


Properties

Methods

.is()
: object is CarbonLDP.LDP.ResponseMetadata


is( object:object ):object is CarbonLDP.LDP.ResponseMetadata

Return true if the object provided is considered a CarbonLDP.LDP.ResponseMetadata object.


Param Type Default Description
object object

Object to check





Interfaces

I
CarbonLDP.LDP.ValidationError
Interface that contains the properties that describe how the validation failed.
I
CarbonLDP.LDP.ValidationErrorFactory
Interface with the factory, decorate and utils methods for CarbonLDP.LDP.ValidationError objects.

Properties




Interface that contains the properties that describe how the validation failed.


Properties

.errorDetails
: CarbonLDP.Pointer

Pointer with the error details of how the validation failed.





Interface with the factory, decorate and utils methods for CarbonLDP.LDP.ValidationError objects.


Properties




Interfaces

I
CarbonLDP.LDP.VolatileResource
Interface that represents a free resource, i.e. a dynamic generated resource that does not have a persisted form.
I
CarbonLDP.LDP.VolatileResourceFactory
Interface with the factory, decorate an utils methods for CarbonLDP.LDP.VolatileResource objects.

Properties




Interface that represents a free resource, i.e. a dynamic generated resource that does not have a persisted form.





Interface with the factory, decorate an utils methods for CarbonLDP.LDP.VolatileResource objects.


Properties

.TYPE
: string


Methods

.create()
: CarbonLDP.LDP.VolatileResource


create():CarbonLDP.LDP.VolatileResource

Creates empty CarbonLDP.LDP.VolatileResource object.




.createFrom()
: T & CarbonLDP.LDP.VolatileResource


createFrom<T extends object>( object:T ):T & CarbonLDP.LDP.VolatileResource

Creates a CarbonLDP.LDP.VolatileResource object from the object specified.


Param Type Default Description
object T


.is()
: object is CarbonLDP.LDP.VolatileResource


is( object:object ):object is CarbonLDP.LDP.VolatileResource

Return true if the object provided is considered a CarbonLDP.LDP.VolatileResource object.


Param Type Default Description
object object

Object to check.











Creator of LDPatch deltas


Constructor


DeltaCreator( jsonldConverter:CarbonLDP.JSONLD.JSONLDConverter ):void

Param Type Default Description
jsonldConverter CarbonLDP.JSONLD.JSONLDConverter

The converted of JSON-LD to Javascript and viceversa to use.


Methods

.addResource()
: void


addResource( schema:CarbonLDP.DigestedObjectSchema, oldResource:CarbonLDP.Resource, newResource:CarbonLDP.Resource ):void

Creates and adds the delta to the patch, of the provided old and new resource.


Param Type Default Description
schema CarbonLDP.DigestedObjectSchema

The schema of the resource to create its delta.

oldResource CarbonLDP.Resource

The old representation of the resource to create the delta.

newResource CarbonLDP.Resource

The current representation of the resource to create the delta.



.getPatch()
: string


getPatch():string

Returns the LD Patch string of the resources provided in addResource method.






Classes

C
CarbonLDP.LDPatch.AddToken
LD Patch add action.
C
CarbonLDP.LDPatch.DeleteToken
LD Patch delete action.
C
CarbonLDP.LDPatch.LDPatchToken
An LD Patch expression.
C
CarbonLDP.LDPatch.PrefixToken
LD Patch add action.
C
CarbonLDP.LDPatch.SliceToken
LD Patch list slice expression token.
C
CarbonLDP.LDPatch.UpdateListToken
LD Patch update list action.




Implements:
sparqler/tokens/TokenNode

LD Patch add action.


Constructor


AddToken():void


Properties

.token
: add


.triples
: sparqler/tokens/SubjectToken[]


Methods




Implements:
sparqler/tokens/TokenNode

LD Patch delete action.


Constructor


DeleteToken():void


Properties

.token
: delete


.triples
: sparqler/tokens/SubjectToken[]


Methods







Implements:
sparqler/tokens/TokenNode

LD Patch add action.


Constructor


PrefixToken( namespace:string, iri:sparqler/tokens/IRIToken ):void

Param Type Default Description
namespace string

The namespace of the LD Patch prefix.

iri sparqler/tokens/IRIToken

The IRI of the LD Patch prefix.


Properties

.iri
: sparqler/tokens/IRIToken


.namespace
: string


.token
: prefix


Methods




Implements:
sparqler/tokens/TokenNode

LD Patch list slice expression token.


Constructor


SliceToken( minIndex?:number, maxIndex?:number ):void

Param Type Default Description
minIndex number

The minimum index of the list's range to update.

maxIndex number

The maximum index of the list's range to update.


Properties

.maxIndex
: number


.minIndex
: number


.token
: slice


Methods




Implements:
sparqler/tokens/TokenNode

LD Patch update list action.


Constructor