Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Introduction

See Service API Design for the rationale and design details for this api.

See Developer Bootstrap#DeveloperBootstrap-ServiceDevelopment for instructions on how to run a local instance of this service.

Encoding

The primary request and response encoding for the service is JSON. Here's a handy tool to make a blob of JSON more readable: http://jsonformatter.curiousconcept.com/

In responses from the service, dates are serialized as long integers expressing epoch time - the number of seconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds. Here's a handy tool to convert from epoch time to human readable dates: http://www.epochconverter.com/

In requests to the service, dates can be serialized either as long integers expressing epoch time or human readable dates in http://www.ietf.org/rfc/rfc3339.txt format such as '2011-01-31' or '2011-01-31T22:00:00'

Security

Eventually these services will be HTTPS only and disallow HTTP. Users will pass something like ?access_token=... as a query parameter for every request to the service

Query API Examples

'Select *' Query

Right now only a subset of query functionality is supported

SELECT * FROM <data type> [LIMIT <#>] [OFFSET <#>]

Request

curl -i -H Accept:application/json 'http://deflaux-test.appspot.com/repo/v1/query?query=select+*+from+dataset+limit+3+offset+1'

Response

HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 13 Feb 2011 00:27:40 GMT
Server: Google Frontend
Cache-Control: private, x-gzip-ok=""
Transfer-Encoding: chunked

{
  "results": [
    {
      "Disease": ["Cancer"],
      "Institution": ["TCGA"],
      "Number of Samples": ["465"],
      "Reference / PubMed ID": ["18772890"],
      "Species": ["Human"],
      "Tumor / Tissue Type": ["Glioblastoma"],
      "creationDate": 1297465568905,
      "creator": null,
      "description": null,
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA",
      "name": "Glioblastoma TCGA",
      "releaseDate": null,
      "status": "Available",
      "version": "0.0.1"
    },
    {
      "Disease": ["Metabolic"],
      "Institution": ["UCLA"],
      "Number of Samples": ["111"],
      "Reference / PubMed ID": ["12646919"],
      "Species": ["Mouse"],
      "Tumor / Tissue Type": ["Liver"],
      "creationDate": 1297465572211,
      "creator": "Jake Lusis",
      "description": null,
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY2aoEDA",
      "name": "Mouse Model of Diet-Induced Atherosclerosis",
      "releaseDate": null,
      "status": "Available",
      "version": "0.0.1"
    },
    {
      "Disease": ["Cancer"],
      "Institution": ["BCCA Cambridge"],
      "Number of Samples": ["1500"],
      "Species": ["Human"],
      "Tumor / Tissue Type": ["Breast"],
      "creationDate": 1297465580576,
      "creator": "Aparicio, Caldas",
      "description": null,
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY2qoEDA",
      "name": "METABRIC Breast Cancer",
      "releaseDate": null,
      "status": "In Transition",
      "version": "0.0.1"
    }
  ],
  "totalNumberOfResults": 11
}

'Order By' Query

Right now only a subset of query functionality is supported

SELECT * FROM <data type> ORDER BY "<field name>" [ASC|DESC] [LIMIT <#>] [OFFSET #]

Request

curl -i -H Accept:application/json 'http://deflaux-test.appspot.com/repo/v1/query?query=select+*+from+dataset+order+by+"name"+limit+3+offset+1'

Response

HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 13 Feb 2011 00:27:41 GMT
Server: Google Frontend
Cache-Control: private, x-gzip-ok=""
Transfer-Encoding: chunked

{
  "results": [
    {
      "Date Curated": [1296432000000],
      "Disease": ["Imaginary Friends"],
      "Institution": ["Sage Bionetworks"],
      "Number of Samples": ["42"],
      "Species": ["Unicorn"],
      "Tumor / Tissue Type": ["Unicorn Horn"],
      "creationDate": 1297465586365,
      "creator": "Nicole Deflaux",
      "description": null,
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY4dEEDA",
      "name": "Fake Dataset",
      "releaseDate": 1297382400000,
      "status": "Never",
      "version": "0.0.1"
    },
    {
      "Disease": ["Normal Phenotypes"],
      "Number of Samples": ["1027"],
      "Species": ["Mouse"],
      "creationDate": 1297465585103,
      "creator": "Jonathan Flint",
      "description": null,
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYksIEDA",
      "name": "Flint HS Mice",
      "releaseDate": null,
      "status": "Future",
      "version": "0.0.1"
    },
    {
      "Disease": ["Cancer"],
      "Institution": ["TCGA"],
      "Number of Samples": ["465"],
      "Reference / PubMed ID": ["18772890"],
      "Species": ["Human"],
      "Tumor / Tissue Type": ["Glioblastoma"],
      "creationDate": 1297465568905,
      "creator": null,
      "description": null,
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA",
      "name": "Glioblastoma TCGA",
      "releaseDate": null,
      "status": "Available",
      "version": "0.0.1"
    }
  ],
  "totalNumberOfResults": 11
}

'Where Equal To' Query

Right now only a subset of query functionality is supported

SELECT * FROM <data type> WHERE "<field name>" == "<value>" [LIMIT <#>] [OFFSET #]

Request

curl -i -H Accept:application/json 'http://deflaux-test.appspot.com/repo/v1/query?query=select+*+from+dataset+where+"Species"+==+"Human"+limit+3+offset+1'

Response

HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 13 Feb 2011 00:27:43 GMT
Server: Google Frontend
Cache-Control: private, x-gzip-ok=""
Transfer-Encoding: chunked

{
  "results": [
    {
      "Disease": ["Cancer"],
      "Institution": ["TCGA"],
      "Number of Samples": ["465"],
      "Reference / PubMed ID": ["18772890"],
      "Species": ["Human"],
      "Tumor / Tissue Type": ["Glioblastoma"],
      "creationDate": 1297465568905,
      "creator": null,
      "description": null,
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA",
      "name": "Glioblastoma TCGA",
      "releaseDate": null,
      "status": "Available",
      "version": "0.0.1"
    },
    {
      "Disease": ["Cancer"],
      "Institution": ["BCCA Cambridge"],
      "Number of Samples": ["1500"],
      "Species": ["Human"],
      "Tumor / Tissue Type": ["Breast"],
      "creationDate": 1297465580576,
      "creator": "Aparicio, Caldas",
      "description": null,
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY2qoEDA",
      "name": "METABRIC Breast Cancer",
      "releaseDate": null,
      "status": "In Transition",
      "version": "0.0.1"
    },
    {
      "Disease": ["Cancer"],
      "Institution": ["FHCRC"],
      "Number of Samples": ["200"],
      "Species": ["Human"],
      "Tumor / Tissue Type": ["AML (pediatric)"],
      "creationDate": 1297465583813,
      "creator": "Soheil Meshinchi",
      "description": null,
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY26oEDA",
      "name": "Pediatric AML TARGET",
      "releaseDate": null,
      "status": "In Transition",
      "version": "0.0.1"
    }
  ],
  "totalNumberOfResults": 11
}

REST API Examples (Read Only)

Sanity check request

This is just a 'hello world' type request that you can make to ensure that the service is running.

Request

curl -i -H Accept:application/json 'http://deflaux-test.appspot.com/repo/v1/dataset/test'

Response

HTTP/1.1 200 OK
Content-Language: en-US
Content-Type: application/json; charset=UTF-8
Pragma: no-cache
Cache-Control: no-cache, no-store, max-age=0
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Date: Sun, 13 Feb 2011 00:27:43 GMT
Server: Google Frontend
Transfer-Encoding: chunked

{"hello": "REST for Datasets rocks"}

Get All Datasets

Optional Parameters

  • offset - integer - 1-based pagination offset
  • limit - integer - maximum number of results to return
  • sort - string - the name of the field upon which to sort
  • ascending - boolean - whether or not to sort ascending

Request

curl -i -H Accept:application/json 'http://deflaux-test.appspot.com/repo/v1/dataset?sort=name&limit=3'

Response

HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 13 Feb 2011 00:27:44 GMT
Server: Google Frontend
Cache-Control: private, x-gzip-ok=""
Transfer-Encoding: chunked

{
  "paging": {"next": "/repo/v1/dataset?offset=4&limit=3&sort=name&ascending=true"},
  "results": [
    {
      "annotations": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY4dEEDA/annotations",
      "creationDate": 1297465586365,
      "creator": "Nicole Deflaux",
      "description": null,
      "etag": "-1441125823",
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY4dEEDA",
      "layer": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY4dEEDA/layer",
      "name": "Fake Dataset",
      "releaseDate": 1297382400000,
      "status": "Never",
      "uri": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY4dEEDA",
      "version": "0.0.1"
    },
    {
      "annotations": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYksIEDA/annotations",
      "creationDate": 1297465585103,
      "creator": "Jonathan Flint",
      "description": null,
      "etag": "1698149418",
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYksIEDA",
      "layer": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYksIEDA/layer",
      "name": "Flint HS Mice",
      "releaseDate": null,
      "status": "Future",
      "uri": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYksIEDA",
      "version": "0.0.1"
    },
    {
      "annotations": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA/annotations",
      "creationDate": 1297465568905,
      "creator": null,
      "description": null,
      "etag": "2011502454",
      "hasClinicalData": false,
      "hasExpressionData": false,
      "hasGeneticData": false,
      "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA",
      "layer": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA/layer",
      "name": "Glioblastoma TCGA",
      "releaseDate": null,
      "status": "Available",
      "uri": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA",
      "version": "0.0.1"
    }
  ],
  "totalNumberOfResults": 11
}

Get a Dataset

This returns the primary fields of a dataset and links to get additional info.

Request

curl -i -H Accept:application/json 'http://deflaux-test.appspot.com/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA'

Response

HTTP/1.1 200 OK
ETag: 2011502454
Content-Type: application/json
Date: Sun, 13 Feb 2011 00:27:44 GMT
Server: Google Frontend
Cache-Control: private, x-gzip-ok=""
Transfer-Encoding: chunked

{
  "annotations": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA/annotations",
  "creationDate": 1297465568905,
  "creator": null,
  "description": null,
  "etag": "2011502454",
  "hasClinicalData": false,
  "hasExpressionData": false,
  "hasGeneticData": false,
  "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA",
  "layer": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA/layer",
  "name": "Glioblastoma TCGA",
  "releaseDate": null,
  "status": "Available",
  "uri": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA",
  "version": "0.0.1"
}

Get Annotations for a Dataset

This returns the annotations for a dataset.

Request

curl -i -H Accept:application/json 'http://deflaux-test.appspot.com/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA/annotations'

Response

HTTP/1.1 200 OK
ETag: -1609182934
Content-Type: application/json
Date: Sun, 13 Feb 2011 00:27:44 GMT
Server: Google Frontend
Cache-Control: private, x-gzip-ok=""
Transfer-Encoding: chunked

{
  "creationDate": null,
  "dateAnnotations": {},
  "doubleAnnotations": {},
  "etag": "-1609182934",
  "id": "agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA",
  "longAnnotations": {},
  "stringAnnotations": {
    "Disease": ["Cancer"],
    "Institution": ["TCGA"],
    "Number of Samples": ["465"],
    "Reference / PubMed ID": ["18772890"],
    "Species": ["Human"],
    "Tumor / Tissue Type": ["Glioblastoma"]
  },
  "uri": "/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA/annotations"
}

Get all the Layers for a Dataset

This returns the primary fields for all the layers of a dataset.

Request

curl -i -H Accept:application/json 'http://deflaux-test.appspot.com/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQY8aIEDA/layer'

Response

HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 13 Feb 2011 00:27:45 GMT
Server: Google Frontend
Cache-Control: private, x-gzip-ok=""
Transfer-Encoding: chunked

{
  "paging": {},
  "results": [],
  "totalNumberOfResults": 0
}

Get a Dataset Layer

This returns the primary fields of the dataset layer and links to get additional info.

TODO add an example here

Get Annotations for a Dataset Layer

This returns the annotations for a dataset layer.

TODO add an example here

REST API Usage Examples (Read/Write and slightly out of date)

This is a REST api (see Service API Design for more details as to what this means). You can create entities, updated entities, read entities, and delete entities. More advanced querying will be implemented as a separate API. Partial updates (e.g., just updating two fields in a dataset) are not supported. In a nutshell, when you update something like a dataset, you GET the dataset first, modify the properties you want to change, and then send the entire object back to the service so that this revised entity overwrites the previously stored entity.

Create a Dataset

Request:

curl -i -H Accept:application/json -H Content-Type:application/json
-d '{"name":"test dataset", "creator":"fake creator", "releaseDate":"2009-10-01", "status":"not curated"}'
http://localhost:8080/repo/v1/dataset

Response

HTTP/1.1 201 Created
ETag: 1736839268
Location: /repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYBAw
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

{
   "name":"test dataset",
   "annotations":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw/annotations",
   "id":"agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw",
   "version":"0.0.1",
   "creator":"fake creator",
   "description":null,
   "creationDate":1296595870715,
   "status":"not curated",
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw",
   "etag":"1309185941",
   "releaseDate":1254355200000,
   "layers":[]
}

Update a Dataset

Note that in the example below the creator and description fields have been changed but all others remain the same.

Request:

curl -i -H Accept:application/json -H Content-Type:application/json -X PUT -H ETag:1309185941 -d '{
   "name":"test dataset",
   "annotations":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw/annotations",
   "id":"agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw",
   "version":"0.0.1",
   "creator":"updated creator",
   "description":"I just added a description",
   "creationDate":1296595870715,
   "status":"not curated",
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw",
   "etag":"1309185941",
   "releaseDate":1254355200000,
   "layers":[]
}
' http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw

Response

HTTP/1.1 200 OK
ETag: -852418664
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

{
   "name":"test dataset",
   "annotations":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw/annotations",
   "id":"agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw",
   "version":"0.0.1",
   "creator":"updated creator",
   "description":"I just added a description",
   "creationDate":1296595870715,
   "status":"not curated",
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw",
   "etag":"-852418664",
   "releaseDate":1254355200000,
   "layers":[]
}

Add Annotations to a Dataset

First get the empty annotations container for your newly created dataset

Request

curl -i -H Accept:application/json http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw/annotations

Response

HTTP/1.1 200 OK
ETag: 923521
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

{
   "id":"agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw",
   "creationDate":null,
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw/annotations",
   "etag":"923521",
   "stringAnnotations":{

   },
   "floatAnnotations":{

   },
   "dateAnnotations":{

   }
}

Then you add/modify the annotations of interest and do a PUT. Note that annotation values must always be list values even if the list is only of length one.

Request

curl -i -H Accept:application/json -H Content-Type:application/json -X PUT -H ETag:923521 -d '{
   "id":"agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw",
   "creationDate":null,
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw/annotations",
   "etag":"923521",
   "stringAnnotations":{
        "Experimental Design Templates":["exp-122887", "exp-97765"]
   },
   "floatAnnotations":{
        "Number of Samples":[500]
   },
   "dateAnnotations":{
        "Publication Date":["2011-01-15"]
   }
}' http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw/annotations

Response

HTTP/1.1 200 OK
ETag: -1638393853
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

{
   "id":"agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYBww",
   "creationDate":null,
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYBww/annotations",
   "etag":"-1638393853",
   "stringAnnotations":{
      "Experimental Design Templates":[
         "exp-122887",
         "exp-97765"
      ]
   },
   "floatAnnotations":{
      "Number of Samples":[
         500.0
      ]
   },
   "dateAnnotations":{
      "Publication Date":[
         1295049600000
      ]
   }
}

Delete a Dataset

Request

curl -i -X DELETE http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw

Response

HTTP/1.1 204 No Content
Server: Jetty(6.1.x)

Get a Layers for a Dataset

Request

curl -i -H Accept:application/json http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer

Response

HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

{
   "results":[
      {
         "name":"Flint HS Mice Affy",
         "annotations":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww/annotations",
         "id":"agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
         "type":"E",
         "version":"0.0.1",
         "description":"this is a description",
         "creationDate":1296690778880,
         "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
         "etag":"1424771925",
         "publicationDate":null,
         "releaseNotes":"this is a release note",
         "tissueType":"liver",
         "platform":null,
         "processingFacility":null,
         "qcBy":null,
         "qcDate":null
      },
      {
         "name":"Flint HS Mice Phenotypes",
         "annotations":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjpBww/annotations",
         "id":"agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjpBww",
         "type":"C",
         "version":"0.0.1",
         "description":"this is a description",
         "creationDate":1296693007167,
         "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjpBww",
         "etag":"1445062754",
         "publicationDate":null,
         "releaseNotes":"this is a release note",
         "tissueType":null,
         "platform":null,
         "processingFacility":null,
         "qcBy":null,
         "qcDate":null
      }
   ],
   "totalNumberOfResults":2,
   "paging":{

   }
}

Get a Layer

Request

curl -i -H Accept:application/json http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww

Response

HTTP/1.1 200 OK
ETag: 1240467407
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

{
   "name":"Flint HS Mice Affy",
   "annotations":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww/annotations",
   "id":"agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
   "type":"E",
   "version":"0.0.1",
   "description":"this is a description",
   "creationDate":1296690778880,
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
   "etag":"1240467407",
   "publicationDate":null,
   "releaseNotes":"this is a release note",
   "tissueType":null,
   "platform":null,
   "processingFacility":null,
   "qcBy":null,
   "qcDate":null
}

Get annotations for a layer

Request

curl -i -H Accept:application/json http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww/annotations

Response

HTTP/1.1 200 OK
ETag: 923521
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

{
   "id":"agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
   "creationDate":null,
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww/annotations",
   "etag":"923521",
   "stringAnnotations":{

   },
   "floatAnnotations":{

   },
   "dateAnnotations":{

   }
}

Create a layer

Request

curl -i -H Accept:application/json -H Content-Type:application/json -d '{"name":"Flint HS Mice Affy", "type":"E", "description":"this is a description", "releaseNotes":"this is a release note"}' http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer

Response

HTTP/1.1 201 Created
ETag: 1240467407
Location: /repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

{
   "name":"Flint HS Mice Affy",
   "annotations":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww/annotations",
   "id":"agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
   "type":"E",
   "version":"0.0.1",
   "description":"this is a description",
   "creationDate":1296690778880,
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
   "etag":"1240467407",
   "publicationDate":null,
   "releaseNotes":"this is a release note",
   "tissueType":null,
   "platform":null,
   "processingFacility":null,
   "qcBy":null,
   "qcDate":null
}

Now ask for the owning dataset and you can see the preview of the layer

Request

curl -i -H Accept:application/json http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww

Response

HTTP/1.1 200 OK
ETag: -801135512
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

{
"name":"Flint HS Mice",
"annotations":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/annotations",
"id":"agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww",
"version":"0.0.1",
"creator":"Jonathan Flint",
"description":null,
"creationDate":1296690549675,
"status":"Future",
"uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww",
"etag":"-801135512",
"releaseDate":null,
"layers":[
{
         "id":"agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
         "type":"E",
         "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww"
      },{
         "id":"use this uri to make a new layer",
         "type":"hack",
         "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer"
      }
]
}

Update a Layer

In the example below we updated the tissue type.

Request

curl -i -H Accept:application/json -H Content-Type:application/json -X PUT -H ETag:1240467407 -d '
{
   "name":"Flint HS Mice Affy",
   "annotations":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww/annotations",
   "id":"agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
   "type":"E",
   "version":"0.0.1",
   "description":"this is a description",
   "creationDate":1296690778880,
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
   "etag":"1240467407",
   "publicationDate":null,
   "releaseNotes":"this is a release note",
   "tissueType":"liver",
   "platform":null,
   "processingFacility":null,
   "qcBy":null,
   "qcDate":null
}' http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww

Response

HTTP/1.1 200 OK
ETag: 1424771925
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

{
   "name":"Flint HS Mice Affy",
   "annotations":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww/annotations",
   "id":"agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
   "type":"E",
   "version":"0.0.1",
   "description":"this is a description",
   "creationDate":1296690778880,
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
   "etag":"1424771925",
   "publicationDate":null,
   "releaseNotes":"this is a release note",
   "tissueType":"liver",
   "platform":null,
   "processingFacility":null,
   "qcBy":null,
   "qcDate":null
}

Delete a layer

Request

curl -i -X DELETE http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww

Response

HTTP/1.1 204 No Content
Server: Jetty(6.1.x)

Add annotations to a layer

Request

curl -i -H Accept:application/json -H Content-Type:application/json -X PUT -H ETag:923521 -d '
{
   "id":"agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
   "creationDate":null,
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww/annotations",
   "etag":"923521",
   "stringAnnotations":{
      "notes":["I threw away 6 samples during the curation process due to gender chromosome mismatches"]
   },
   "floatAnnotations":{

   },
   "dateAnnotations":{

   }
}' http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww/annotations

Response

HTTP/1.1 200 OK
ETag: -1897035229
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(6.1.x)

{
   "id":"agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww",
   "creationDate":null,
   "uri":"/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYUww/layer/agxkZWZsYXV4LXRlc3RyLgsSDUdBRUpET0RhdGFzZXQYUwwLEhRHQUVKRE9JbnB1dERhdGFMYXllchjoBww/annotations",
   "etag":"-1897035229",
   "stringAnnotations":{
      "notes":[
         "I threw away 6 samples during the curation process due to gender chromosome mismatches"
      ]
   },
   "floatAnnotations":{

   },
   "dateAnnotations":{

   }
}
  • No labels