Stanbol Home

The RESTful Semantic Engine

Entityhub Entity

Service Endpoint /entityhub/entity

Subresource entityhub/entity

Service to get/create/update and delete Entities managed by the Entityhub.

GET entityhub/entity

Description Service to get
Request GET /entityhub/entity?id={uri}
Parameter id: the URI of the entity
Produces Depends on requested media type

Example

curl "http://wit.istc.cnr.it:9090/entityhub/entity?id=

Test

Get entity for URI

Create an Entity

Description Service to create entities for the Entityhub.
Request POST /entityhub/entity?[id={uri}]&[update=true/false]
Parameter id: optional the id of the Entity to add. If an id is parsed it is ensured that regardless of the included data only the entity with the parsed id is created. Information for other ids will be ignored.
update: Switch that allows to allow updates to existing entities for POST requests. Default is false
Produces 201 with an link to the created entity

Examples:

The following request would create all Entities defines within {file.rdf} in the entityhub. If any of such Entities already exists within the Entityhub the request would fail with BAD REQUEST

curl -i -X POST -H "Content-Type:application/rdf+xml" -T {file.rdf} "http://wit.istc.cnr.it:9090/entityhub/entity

Here the same request, but now it would be also allowed to update existing Entities

curl -i -X POST -H "Content-Type:application/rdf+xml" -T {file.rdf} "http://wit.istc.cnr.it:9090/entityhub/entity?update=true

This request would only import the Entity with the id {id} while ignoring all triples with a subject other that {id} contained within {file.rdf}

curl -i -X POST -H "Content-Type:application/rdf+xml" -T {file.rdf} "http://wit.istc.cnr.it:9090/entityhub/entity?id={id}

Update an Entity

Description Service to update an Entity already managed by the Entityhub
Request PUT /entityhub/entity?[id={uri}]&[create=true/false]
Parameter id: optional the id of the Entity to update. If an id is parsed it is ensured that regardless of the parsed data only information of this entity are updated.
create: Switch that allows to enable/disable the creation of new Entities for update (PUT) requests. The default true.
Produces 200 with the data of the entity encoded in the format specified by the Accept header

Examples:

The following request would update/create all Entities defines within {file.rdf} in the entityhub. Non existent Entities will be created and already existing one will be updated (replaced with the submitted version).

curl -i -X PUT -H "Content-Type:application/rdf+xml" -T {file.rdf} "http://wit.istc.cnr.it:9090/entityhub/entity

This request would only update Entities. If any of the Entities in {file.rdf} would not already be present within the Entityhub this request would return a BAD REQUEST.

curl -i -X PUT -H "Content-Type:application/rdf+xml" -T {file.rdf} "http://wit.istc.cnr.it:9090/entityhub/entity?create=false

This request would update the Entity with the id {id} while ignoring all triples with a subject other that {id} contained within {file}. If an entity with {id} is not yet present within the Entityhub, than a BAD REQUEST would be returned

curl -i -X POST -H "Content-Type:application/rdf+xml" -T {file.rdf} "http://wit.istc.cnr.it:9090/entityhub/entity?id={id}&create=false

Delete an/all Entities

Description Service to delete an/all entities managed by the Entityhub
Request DELETE /entityhub/entity?id={uri}
Parameter id: The {uri} of the Entity to delete or '*' to delete all Entities
Produces Status "200 OK" with:
  • the deleted entity encoded in the format specified by the Accept header
  • an empty response if all entities where deleted ('*' was parsed as URI
Status "404 NOT FOUND" if no Entity with the parsed URI is managed by the Entityhub