Template
(→Protocol templates) |
m (→Example (RDF)) |
||
(6 intermediate revisions by one user not shown) | |||
Line 16: | Line 16: | ||
==== Example (ISA-TAB) ==== | ==== Example (ISA-TAB) ==== | ||
− | + | ISA-TAB XML template | |
==== Example (RDF) ==== | ==== Example (RDF) ==== | ||
− | + | TODO: Example using [https://github.com/ToxBank/isa2rdf] | |
− | == Retrieve data | + | = REST interface = |
+ | == GET: Retrieve the data template, defined for a Protocol == | ||
{{HasOperation |id=API_Protocol:RetrieveTemplates}} | {{HasOperation |id=API_Protocol:RetrieveTemplates}} | ||
+ | Example [http://toxbanktest1.opentox.org:8080/toxbank/protocol/SEURAT-Protocol-30-4/datatemplate http://toxbanktest1.opentox.org:8080/toxbank/protocol/SEURAT-Protocol-30-4/datatemplate] | ||
+ | ===cURL template=== | ||
+ | curl -X GET -H 'Accept:SUPPORTED-MEDIA-TYPE' -H 'subjectid:TOKEN' \ | ||
+ | http://toxbanktest1.opentox.org:8080/toxbank/protocol/SEURAT-Protocol-30-4/datatemplate | ||
− | == Create data template for a Protocol == | + | == POST: Create data template for a Protocol == |
{{HasOperation |id=API_Protocol:UploadTemplate}} | {{HasOperation |id=API_Protocol:UploadTemplate}} | ||
− | + | ==== cURL example ==== | |
− | == | + | curl -X POST -H 'subjectid:TOKEN' -H 'Content-Type:multipart/form-data' -F 'datatemplate=@FILE_NAME' \ |
− | + | http://toxbanktest1.opentox.org:8080/toxbank/protocol/SEURAT-Protocol-30-4/datatemplate | |
− | + | ||
− | + |
Latest revision as of 16:24, 14 December 2011
Template |
---|
Contents |
Data templates
This is a placeholder for data templates. The data template content is specific for a Protocol. In ToxBank, any data is assumed to be generated by a protocol (experimental or data processing). The data coming from different procotols can have different structure and formats. The data template specifies the format and structure of the data, expected from a certain protocol.
A template is a file with a pre-defined MIME type (RDF or ISA-TAB).
Example (spreadsheet)
A spreadsheet template defines the number of columns, column names and defines how rows should be filled in.
Example (ISA-TAB)
ISA-TAB XML template
Example (RDF)
TODO: Example using [1]
REST interface
GET: Retrieve the data template, defined for a Protocol
Description | Retrieves the data template, defined for a protocol |
---|---|
Resource | Protocol |
Method | GET |
URI | /protocol/{id}/datatemplate |
Parameters | none |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | none |
Results | The template representation in supported media type |
Media Type (output) | text/uri-list;application/rdf+xml;text/n3;text/csv |
Status code | 200,400,401,402,403 |
Links: Page, Edit with form
Example http://toxbanktest1.opentox.org:8080/toxbank/protocol/SEURAT-Protocol-30-4/datatemplate
cURL template
curl -X GET -H 'Accept:SUPPORTED-MEDIA-TYPE' -H 'subjectid:TOKEN' \ http://toxbanktest1.opentox.org:8080/toxbank/protocol/SEURAT-Protocol-30-4/datatemplate
POST: Create data template for a Protocol
Description | Uploads a template, to be assigned to a protocol |
---|---|
Resource | Protocol |
Method | POST |
URI | /protocol/{id}/datatemplate |
Parameters | (see cURL example) |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | multipart/form-data |
Results | Task representation in supported MIME formats |
Media Type (output) | text/uri-list;application/rdf+xml;text/n3 |
Status code | 200,202,400,401,402,403,500 |
Links: Page, Edit with form
cURL example
curl -X POST -H 'subjectid:TOKEN' -H 'Content-Type:multipart/form-data' -F 'datatemplate=@FILE_NAME' \ http://toxbanktest1.opentox.org:8080/toxbank/protocol/SEURAT-Protocol-30-4/datatemplate
Acts on | Protocol + |
HasOperation | API Protocol:RetrieveTemplates + and API Protocol:UploadTemplate + |
Has output media type | text/uri-list;application/rdf+xml;text/n3;text/csv + and text/uri-list;application/rdf+xml;text/n3 + |
Has status code | 200,400,401,402,403 + and 200,202,400,401,402,403,500 + |