Versions Compared

Key

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

...

Code Block
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

...

Code Block
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":[
      {
         "id":"agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw",
         "type":"C",
         "uri":"/datalayer/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw"
      },
      {
         "id":"agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYiaECDA",
         "type":"E",
         "uri":"agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYiaECDA"
      },
      {
         "id":"agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYmfIBDA",
         "type":"G",
         "uri":"/datalayer/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYmfIBDA"
      }
   ]
}

Add Annotations to a Dataset

First get the empty annotations container for your newly created dataset

Request

Code Block
curl  ]
}

Add Annotations to a Dataset

code
-i http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw/annotations

Response

Code Block

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":{

   }
}

Request

Code Block

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

Code Block

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
      ]
   }
}

Update a Dataset

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

...

Code Block
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":[
      {
         "id":"agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw",
         "type":"C",
         "uri":"/datalayer/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw"
      },
      {
         "id":"agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYiaECDA",
         "type":"E",
         "uri":"agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYiaECDA"
      },
      {
         "id":"agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYmfIBDA",
         "type":"G",
         "uri":"/datalayer/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYmfIBDA"
      }
   ]
}
' http://localhost:8080/repo/v1/dataset/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw

...

Code Block
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":[
      {
         "id":"agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw",
         "type":"C",
         "uri":"/datalayer/agxkZWZsYXV4LXRlc3RyEwsSDUdBRUpET0RhdGFzZXQYAQw"
      },
      {
         "id":"agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYiaECDA",
         "type":"E",
         "uri":"agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYiaECDA"
      },
      {
         "id":"agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYmfIBDA",
         "type":"G",
         "uri":"/datalayer/agxkZWZsYXV4LXRlc3RyFQsSDUdBRUpET0RhdGFzZXQYmfIBDA"
      }
   ]
}

Delete a Dataset

Request

Code Block

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

Response

Code Block

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