Protocol

From ToxBank API Wiki
(Difference between revisions)
Jump to: navigation, search
(Create data template for a Protocol)
(Retrieve a data template)
Line 91: Line 91:
  
 
== Retrieve a data template ==
 
== Retrieve a data template ==
{{:API_Protocol:RetrieveTemplate}}
 
 
{{HasOperation |id=API_Protocol:RetrieveTemplate}}
 
{{HasOperation |id=API_Protocol:RetrieveTemplate}}

Revision as of 09:42, 7 October 2011

Protocol


Contents

Protocol

Protocols contain document(s) and metadata, describing how to perform certain experiment (lab or in-silico). The results of performing the experiment are recorder in a (set of) Study.

A Protocol may have versions, a Protocol version is another Protocol.

A Protocol includes links to a Template URI ,frequency and its Author (an User). The rest of the fields may be defined as below.

N3 representation of a Protocol

@prefix tb:  <http://www.owl-ontologies.com/toxbank.owl#> .
@prefix dcterms:  <http://dublincore.org/documents/dcmi-terms/> .
<http://toxbank.net/services/protocol/Protocol_9>
     a       tb:Protocol ;
     dcterms:title "Protocol title";
     dcterms:identifier "SEURAT-P1234567890";
     tb:hasAbstract "This is the abstract"^^xsd:string ;
     tb:hasAuthor tb:OliviaSanger ;
     tb:hasKeyword ""^^xsd:string ;
     tb:hasOwner tb:ORG5 ;
     tb:hasTemplate tb:Template_12 ;
     tb:isSummarySearchable "true"^^xsd:boolean ;
     tb:project tb:DETECTIVE ;
     tb:hasDocument <http://toxbank.net/services/protocol/Protocol_9/ABC.pdf> ;
     tb:versionInfo "123"^^xsd:string.
tb:ORG5
     a       tb:Organization .
tb:DETECTIVE
     a       tb:Project .
tb:OliviaSanger
     a       tb:User .

Retrieve the List of Protocols

Description Retrieves list of protocols
Resource Protocol
Method GET
URI /protocol
Parameters none, or ?search=name or paging parameters: page, pagesize or modefiedSince=UNIX-TIME-STAMP-in-ms
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) none
Results The protocol representation in supported media type
Media Type (output) text/uri-list;application/rdf+xml;text/n3
Status code 200, 400, 401, 402, 403

Links: Page, Edit with form



Upload a new Protocol

Description Uploads a protocol
Resource Protocol
Method POST
URI /protocol
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 single Protocol

Description Retrieves the document, describing the protocol
Resource Protocol
Method GET
URI /protocol/{id}/document
Parameters none
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) none
Results Protocol content in one of supported MIME format
Media Type (output) application/pdf;application/msword
Status code 200,400,401,402,403

Links: Page, Edit with form



cURL example - retrieve the protocol in PDF and Word formats

curl -X GET -H "application/pdf"  /protocol/id
curl -X GET -H "application/msword"  /protocol/id

Retrieve Metadata of a single Protocol

Description Retrieves the protocol metadata
Resource Protocol
Method GET
URI /protocol/{id}
Parameters none
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) none
Results The metadata representation in supported media type
Media Type (output) text/uri-list;application/rdf+xml;text/n3
Status code 200,400,401,402,403

Links: Page, Edit with form



Protocol versions

N3 representation of a Protocol with a previous version

<http://toxbank.net/services/protocol/Protocol_10>    a       tb:Protocol ;
     tb:hasAbstract "New abstract"^^xsd:string ;
     tb:isSummarySearchable
             "false"^^xsd:boolean ;
     tb:protocolPriorVersion
             <http://toxbank.net/services/protocol/Protocol_9> ;
     tb:submissionDate
             "2011-09-15T00:00:00"^^xsd:dateTime ;
     tb:versionInfo "2011-09-15"^^xsd:string .

Retrieve versions of a single Protocol

Description Retrieves the protocol versions
Resource Protocol
Method GET
URI /protocol/{id}/versions
Parameters none, or ?search=name or paging parameters: page, pagesize
Header Parameters subjectid:SECURITY-TOKEN
Media Type (input) none
Results The protocol URI or other supported representation
Media Type (output) text/uri-list;application/rdf+xml;text/n3
Status code 200,400,401,402,403

Links: Page, Edit with form



Upload a new Protocol version

Description Uploads a newprotocol version
Resource Protocol
Method POST
URI /protocol/{id}/versions
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

Links: Page, Edit with form



Protocol templates

Template content is specific for protocols. There will be predefined templates for different kind of data. Templates and guidance how to use them can be shown via "Help resources" panel (on the right in the paper prototype).

N3 representation of a Template

tb:Template_12
     a       tb:Template .

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


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


Personal tools