Skip to main content

LdpRegistryService

This service is automatically created by the LdpService with the key ldp.registry. It keeps a registry of LDP containers and their associated options (which may be passed through the ControlledContainerMixin).

Actions

The following service actions are available:

getByType

Get the first container registration matching with the acceptedTypes.

Parameters
PropertyTypeDefaultDescription
typeString or ArrayrequiredURI of container to which the resource will be attached
datasetStringIf provided, will look in pod-specific containers
Return

A container registration

getByUri

Get the first container registration matching with the resource or container URI. If a resource URI is provided, it will get the first container containing this resource.

Parameters
PropertyTypeDefaultDescription
containerUriStringURI of the container
resourceUriStringURI of the resource
datasetStringIf provided, will look in pod-specific containers
Return

A container registration

getUri

Get a container URI based on the container path and webId.

Parameters
PropertyTypeDefaultDescription
pathStringrequiredContainer path
webIdStringRequired in Pod providers config

list

Get the list of container registrations

Parameters
PropertyTypeDefaultDescription
datasetStringIf provided, will return pod-specific containers
Return

A object with the container registration name (or path) as key, and the container registration as value.

register

Register a container.

Parameters
PropertyTypeDefaultDescription
pathStringPath of the container. If not provided, will be generated with ldp.container.getPath and the acceptedTypes
nameStringName of the container, used to store it (path will be used if none are provided)
acceptedTypesArray or StringRDF classes accepted in this container
datasetStringIf provided, will register the container only for the given dataset

For other available parameters, see the container options.

Return

The container registration