Aller au contenu principal

LdpResourceService

Actions#

The following service actions are available:

ldp.resource.get#

  • Get a resource by its URI
  • Accept triples, turtle or JSON-LD (see @semapps/mime-types package)
Parameters#
PropertyTypeDefaultDescription
resourceUriStringrequireduri of getting subject
acceptstringrequiredType to return (application/ld+json, text/turtle or application/n-triples)
webIdstringLogged user's webIdUser doing the action

You can also pass parameters defined in the container options.

Return#

Triples, Turtle or JSON-LD depending on accept type.

ldp.resource.post#

  • Create a resource
  • Content-type can be triples, turtle or JSON-LD (see @semapps/mime-types package)
Parameters#
PropertyTypeDefaultDescription
resourceString or ObjectrequiredResource to create
containerUristringrequiredContainer where the resource will be created
contentTypestringrequiredType of provided resource (application/ld+json, text/turtle or application/n-triples)
webIdstringLogged user's webIdUser doing the action
slugStringSpecific ID tu use for URI instead generated UUID
Return#

String : URI of the created resource

ldp.resource.patch#

  • Partial update of an existing resource. Only the provided predicates will be replaced.
  • Content-type can be triples, turtle or JSON-LD (see @semapps/mime-types package)
Parameters#
PropertyTypeDefaultDescription
resourceString or ObjectrequiredResource to update
contentTypestringrequiredType of provided resource (application/ld+json, text/turtle or application/n-triples)
webIdstringLogged user's webIdUser doing the action
Return#

String : URI of the updated resource

ldp.resource.put#

  • Full update of an existing resource
  • If some predicates existed but are not provided, they will be deleted.
  • Content-type can be triples, turtle or JSON-LD (see @semapps/mime-types package)
Parameters#
PropertyTypeDefaultDescription
resourceString, ObjectrequiredResource to update
contentTypestringrequiredType of provided resource (application/ld+json, text/turtle or application/n-triples)
webIdstringLogged user's webIdUser doing the action
Return#

String : URI of the updated resource

ldp.resource.delete#

  • Delete the whole resource and detach it from its container
Parameters#
PropertyTypeDefaultDescription
resourceUriStringrequiredURI of resource to delete
webIdstringLogged user's webIdUser doing the action