Template

From ToxBank API Wiki
(Difference between revisions)
Jump to: navigation, search
m (Protocol templates moved to a separate page)
 
(Protocol templates)
Line 2: Line 2:
 
}}
 
}}
  
=Protocol templates =  
+
=Data templates =  
  
Template content is specific for [[API_Protocol|Protocols]]. There will be predefined templates for different kind of data.
+
This is a placeholder for data templates. The data template content is specific for a [[API_Protocol|Protocol]].  
Templates and guidance how to use them can be shown via "Help resources" panel (on the right in the paper prototype).
+
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.
  
=== [http://www.w3.org/DesignIssues/Notation3 N3] representation of a Template===
+
A template is a file with a pre-defined MIME type (RDF or ISA-TAB).
  
tb:Template_12
+
==== Example (spreadsheet) ====
      a      tb:Template .
+
 
 +
A spreadsheet template defines the number of columns, column names and defines how rows should be filled in.
 +
 
 +
==== Example (ISA-TAB) ====
 +
 
 +
todo
 +
 
 +
==== Example (RDF) ====
 +
 
 +
todo
  
 
== Retrieve data templates, defined for a Protocol ==
 
== Retrieve data templates, defined for a Protocol ==
Line 20: Line 30:
 
== Retrieve a data template ==
 
== Retrieve a data template ==
 
{{HasOperation |id=API_Protocol:RetrieveTemplate}}
 
{{HasOperation |id=API_Protocol:RetrieveTemplate}}
 +
 +
todo - should there be many templates, or a single one?

Revision as of 11:59, 19 November 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)

todo

Example (RDF)

todo

Retrieve data templates, 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



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



Retrieve a data template

Description Retrieves a protocol template
Resource Protocol
Method GET
URI /protocol/{id}/datatemplate/{id}
Parameters none?
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) none?
Results The template representation in supported media type
Media Type (output) RDF,JSON,XML
Status code 200,400,401,402,403

Links: Page, Edit with form



todo - should there be many templates, or a single one?
Facts about TemplateRDF feed
Acts onProtocol  +
HasOperationAPI Protocol:RetrieveTemplates  +, API Protocol:UploadTemplate  + and API Protocol:RetrieveTemplate  +
Has output media typetext/uri-list;application/rdf+xml;text/n3;text/csv  +, text/uri-list;application/rdf+xml;text/n3  + and RDF,JSON,XML  +
Has status code200,400,401,402,403  + and 200,202,400,401,402,403,500  +
Personal tools