Versions Compared

Key

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

...

URL

HTTP Type

Description

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

POSTPUT

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. Note that the specific version fetched cannot be used to update the current version. Instead, promote it to the current version.

/{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

Not Supported! You can only change the annotations of the current version.

/{versionable-entityType}/{entityId}/promoteVersion/{versionNumber}POSTPromote the specified versionNumber to be the current version. Effectively, this just changes the number of that version to be current + 1.

...


Currently supported data types:

<data type>
dataset
layer
project
folder
code
phenotypedata
genotypedata
expressiondata
robject
summary
genomicdata

file

entity

 

Request

Code Block
curl -i  -H sessionToken:YourSessionToken -H Accept:application/json 'https://repo-staging.sagebase.org/repo/v1/query?query=select+*+from+dataset+limit+3+offset+1'

...

Code Block
SELECT * FROM layer WHERE layer.parentId == <parentId> [LIMIT <#>] [OFFSET <#>]

...

Code Block
SELECT * FROM layer WHERE layer.parentId == <parentId> ORDER BY <field name> [ASC|DESC] [LIMIT <#>] [OFFSET <#>]

...

Get all the descendants of an entity. The results are paginated. Use the optional query parameter limit to set the maximum page size. The default page size is 20. To fetch the next page, find the last entity (descendant) on the current page and use its ID to set the query parameter lastEntityId. Here is an example:

Code Block
languagebash
titleRequest for getting the first page
# To be writtencurl -i -H sessionToken:<yourToken> -H Accept:application/json 'https://repo.prod.sagebase.org/repo/v1/entity/<entityID>/descendants&limit=2'
Code Block
languagebash
titleResponse for getting the first page
collapsetrue
# To be written{
    "idList": [
        {
            "id": "syn111"
        }, 
        {
            "id": "syn112"
        }
    ]
}

Code Block
languagebash
titleRequest for getting the second page
# To be writtencurl -i -H sessionToken:<yourToken> -H Accept:application/json 'https://repo.prod.sagebase.org/repo/v1/entity/<entityID>/descendants?limit=20&lastEntityId=syn112'
Code Block
languagebash
titleResponse for getting the second page
collapsetrue
# To be written
{
    "idList": [
        {
            "id": "syn113"
        }, 
        {
            "id": "syn114"
        }, 
        {
            "id": "syn115"
        }
    ]
}

Get the descendants of a specific generation

Get all the descendants that are exactly n generations away. The children is generation 1. Children's children are generation 2. So on and so forth. The results are paginated in the same manner. To fetch the next page, find the last entity (descendant) on the current page and use its ID to set the query parameter lastEntityId.  Here is an example:

# To be written
Code Block
languagebash
titleRequest for getting the first page
the descendants of the 2nd generation
curl -i -H sessionToken:<yourToken> -H Accept:application/json 'https://repo.prod.sagebase.org/repo/v1/entity/<entityID>/descendants/2'
# To be written
Code Block
Code Block
languagebash
titleResponse for getting the second page
collapsetrue
languagebash
titleResponse for getting the first page
collapsetrue
# To be written
Code Block
languagebash
titleRequest for getting the second page
# To be written
descendants of the 2nd generation
{
    "idList": [
        {
            "id": "syn114"
        }, 
        {
            "id": "syn115"
        }
    ]
}

 

References

Find reference to any version of an entity

...