Skip to content

PodResourcesService

This service, automatically created by the AppService with the key pod-resources, allows you to manage resources through the LDP protocol. See this page for usage examples.

Actions

The following service actions are available.

post

Post a resource on a given LDP container.

Parameters

PropertyTypeDescription
containerUriURIContainer where the resource will be created
resourceObjectResource to create in JSON-LD format
actorUriURIWebID of the Pod on which the action should be done

Return value

The URI of the created resource, or false if the creation failed.

list

Get a LDP container

Parameters

PropertyTypeDescription
containerUriURIContainer to be fetched
actorUriURIWebID of the Pod on which the action should be done

Return value

An object with the following properties:

PropertyTypeDescription
okBooleantrue if the query succeeded
statusNumberThe status code returned by the Pod provider
statusTextStringThe status text returned by the Pod provider
bodyObjectA JSON-LD representation of the LDP container
headersObjectThe headers returned by the Pod provider

get

Get a LDP resource

Parameters

PropertyTypeDescription
resourceUriURIResource to be fetched
actorUriURIWebID of the Pod on which the action should be done

Return value

An object with the following properties:

PropertyTypeDescription
okBooleantrue if the query succeeded
statusNumberThe status code returned by the Pod provider
statusTextStringThe status text returned by the Pod provider
bodyObjectA JSON-LD representation of the LDP resource
headersObjectThe headers returned by the Pod provider

patch

Parameters

PropertyTypeDescription
resourceUriURIURI of resource to update
triplesToAddArrayArray of triples conforming with the RDF.js data model
triplesToRemoveArrayArray of triples conforming with the RDF.js data model
actorUriURIWebID of the Pod on which the action should be done

Return value

An object with the following properties:

PropertyTypeDescription
okBooleantrue if the query succeeded
statusNumberThe status code returned by the Pod provider
statusTextStringThe status text returned by the Pod provider

put

Update a resource, overwriting any existing data. This action should be used carefully, because if the resource was modified between the GET and the PUT, it will be lost. Use the patch method instead, whenever is possible.

Parameters

PropertyTypeDescription
resourceObjectResource to update in JSON-LD format
actorUriURIWebID of the Pod on which the action should be done

Return value

An object with the following properties:

PropertyTypeDescription
okBooleantrue if the query succeeded
statusNumberThe status code returned by the Pod provider
statusTextStringThe status text returned by the Pod provider

delete

Delete a resource.

Parameters

PropertyTypeDescription
resourceUriURIResource to delete
actorUriURIWebID of the Pod on which the action should be done

Return value

An object with the following properties:

PropertyTypeDescription
okBooleantrue if the query succeeded
statusNumberThe status code returned by the Pod provider
statusTextStringThe status text returned by the Pod provider