Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

TypeDescription
UNDEFINED(Default) The user has not specified details for the Activity
MANUAL

The user manually generated the wasGeneratedBy entities of this Activity

CODE EXECUTIONThe user executed code that generated the wasGeneratedBy entities of this Activity

 

Current Entity API

The following table describes how provenance effects the current entity Entity CRUD API:

Update identified by type and id. For a version-able entity this will update Delete the entity identified by type and id. For a entity this will delete the entity and all versions of the entityannotations

URL

HTTP Type

Description

/entity

POST

Creates a new entity of the given entity. This will create a new "Undefined" activity

/entity

GET

Get a list of all entities of the given type: entity. For version-able entity types, this will list the current version of each entity of that typeand links it to a new UNDEFINED activity.

/entity?activityId={activity id}POSTCreate a new entity and links it to the provided activity*.

/entity/{id}

GETPUT

Get an entity using its type and id. For Updates the entity. If the entity is version-able entities this will return the current version of the entityand the update results in a new version then a new UNDEFINED activity is created and linked with the new version.

/entity/{id}?activityId={activity id}PUTUpdates the entity and links the current version of the entity to the provided activity.

/entity/{id}/version

DELETE

POST

Creates a new version of a given version-able

entity and links it to a new UNDEFINED activity.

/entity/{id}/

GET

Get the annotations for the entity identified by type and id. For a version-able entity this will return the annotations of the current entity.

/entity/{id}/annotations

PUT

Update the annotations for the entity identified by type and id. For a version-able entity this will update the annotations of the current entity.

...

version?activityId={activityId}POSTCreates a new version of a given version-able entity and links it to the provided activity.

*- see Permission and Access to Activites below  

Provenance Additions to the API

The following table describes the new methods for manipulating the versions of a version-able entity.

{versionable-entityType}/{entityId}/versionNot Supported! You can only change the annotations of the current version

URL

HTTP Type

Description

/activityPOST

Create a new version of a given version-able entity. The user should provide a versionLabel and Synapse will auto-generate a new versionNumber. When this called on a version-able entity, the annotations of the current entity will be copied and applied to the newly created version.

/{versionable-entityType}/{entityId}/version

GET

Returns a list of all versions of this entity. This will be a paginated list with a default sort on versionNumber descending

/{versionable-entityType}/{entityId}/version/{versionNumber}

GET

Get a particular version of a version-able entity using the given id and version number.

/{versionable-entityType}/{entityId}/version/{versionNumber}

PUT

Not supported! Only the current version of an entity can be updated using the existing API.

/{versionable-entityType}/{entityId}/version/{versionNumber}

DELETE

Delete a particular version of a version-able entity using the given id and version number.

/{versionable-entityType}/{entityId}/version/{versionNumber}/annotations

GET

Get the annotations of a particular version of a version-able entity using the given id and version number.

/{versionable-entityType}/{entityId}/version/{versionNumber}/annotations

PUT

Creates a new activity object.

/activity/{activityId}PUTUpdates the specified activity. Only the creator of an activity may update it.
/activity/{activityId}GETReturns the specified activity. READ access is permitted if you can see a single wasGeneratedBy entity that links to this activity.
/activity/{activityId}DELETEDelete the specified activity. Only the creator of an activity may delete it.