OpenTox API 1.2 Compound
From ToxBank API Wiki
(Difference between revisions)
Mrautenberg (Talk | contribs) (Created page with "<h2>Chemical compound</h2> <h3>Component description</h3> <p>Provides different representations for chemical compounds with a unique and defined chemical structure.</p> <h3>REST ...") |
|||
Line 57: | Line 57: | ||
| GET<br> | | GET<br> | ||
| /compound/{cid}/feature<br> | | /compound/{cid}/feature<br> | ||
− | | <strong>[subjectid]</strong><br>?<strong>feature_uris[]</strong>=" | + | | <strong>[subjectid]</strong><br>?<strong>feature_uris[]</strong>="URI to features" (optional)<br> |
| Returns representation of the features as uri-list or RDF<br>All available features are returned, if no parameter is specified<br> | | Returns representation of the features as uri-list or RDF<br>All available features are returned, if no parameter is specified<br> | ||
| 200,404,503<br> | | 200,404,503<br> | ||
Line 64: | Line 64: | ||
| POST<br> | | POST<br> | ||
| /compound/{cid}/feature | | /compound/{cid}/feature | ||
− | | <strong>[subjectid]</strong><br>?<strong>feature_uri</strong>=" | + | | <strong>[subjectid]</strong><br>?<strong>feature_uri</strong>="URI to feature" (mandatory, single feature)&<strong>value</strong>=the_value |
| URI of the compound with the new feature, e.g.<br>/compound/{id}?feature_uris[]=the-new-feature<br> | | URI of the compound with the new feature, e.g.<br>/compound/{id}?feature_uris[]=the-new-feature<br> | ||
| 200,400,503 | | 200,400,503 | ||
Line 71: | Line 71: | ||
| PUT<br> | | PUT<br> | ||
| /compound/{cid}/feature | | /compound/{cid}/feature | ||
− | | <strong>[subjectid]</strong><br>?<strong>feature_uri</strong>=" | + | | <strong>[subjectid]</strong><br>?<strong>feature_uri</strong>="URI to feature" (mandatory, single feature)&<strong>value</strong>=the_value<br><br> |
| <br> | | <br> | ||
| 200,400,404,503 | | 200,400,404,503 | ||
Line 78: | Line 78: | ||
| DELETE<br> | | DELETE<br> | ||
| /compound/{cid}/feature | | /compound/{cid}/feature | ||
− | | <strong>[subjectid]</strong><br>?<strong>feature_uris[]</strong>=" | + | | <strong>[subjectid]</strong><br>?<strong>feature_uris[]</strong>="URI to features" (optional) |
| <br> | | <br> | ||
| 200,400,404,503</tbody> | | 200,400,404,503</tbody> |
Latest revision as of 11:31, 2 September 2011
Contents |
Chemical compound
Component description
Provides different representations for chemical compounds with a unique and defined chemical structure.
REST operations
Description | Method | URI | Parameters | Result | Status codes |
Search for compounds |
GET |
/compound |
[subjectid] ?search=value&sameas=URI_FROM_AN_ONTOLOGY |
List of compounds, matching the query |
200,404,503 |
Get the representation of a compound | GET | /compound/{id} | [subjectid] (optional) ?feature_uris[]="URI to features" |
Compound representation in one of the supported MIME formats, if feature_uris[] provided includes features and values | 200,404,503 |
Create a new compound | POST | /compound | [subjectid] Compound representation in a supported MIME format |
URIs for new compounds | 200,400,503 |
Update a compound (optional) |
PUT | /compound/{id} | [subjectid] Compound representation in a supported MIME format |
– | 200,400,404,503 |
Delete a compound (optional) |
DELETE | /compound/{id} | [subjectid] | – Delete all feature values per compound recursively? |
200,400,404,503</tbody> |
Features per Compound
Description |
Method |
URI |
Parameter |
Result |
Status codes |
Get available feature URIs for a compound |
GET |
/compound/{cid}/feature |
[subjectid] ?feature_uris[]="URI to features" (optional) |
Returns representation of the features as uri-list or RDF All available features are returned, if no parameter is specified |
200,404,503 |
Create a new feature value |
POST |
/compound/{cid}/feature | [subjectid] ?feature_uri="URI to feature" (mandatory, single feature)&value=the_value |
URI of the compound with the new feature, e.g. /compound/{id}?feature_uris[]=the-new-feature |
200,400,503 |
Update a new feature value | PUT |
/compound/{cid}/feature | [subjectid] ?feature_uri="URI to feature" (mandatory, single feature)&value=the_value |
|
200,400,404,503 |
Delete specified features from the compound | DELETE |
/compound/{cid}/feature | [subjectid] ?feature_uris[]="URI to features" (optional) |
|
200,400,404,503</tbody> |
HTTP status codes
Interpretation | Nr | Name |
Success | 200 | OK |
Compound not found | 404 | Not Found |
Incorrect MIME type | 400 | Bad request |
Service not available | 503 | Service unavailable</tbody> |
Compound representation
Supported MIME formats
http://chemical-mime.sourceforge.net/Mandatory:
-
chemical/x-daylight-smiles (default)
- chemical/x-inchi
- chemical/x-mdl-sdfile
- chemical/x-mdl-molfile
Optional:
- chemical/x-mol2
- chemical/x-cml
- other chemical formats
- image/png
- other image formats
- text/plain (chemical names)
- application/rdf+xml
Conformers (optional)
Component description
[Optional] support for multiple (e.g. 3D) structures per chemical compound (single structure by default)
REST operations
Description | Method | URI | Parameters | Result | Status codes |
Get available structures of a compound | GET | /compound/{id1}/conformer/ | [subjectid] | List of structure URIs |
200,404,503 |
Create a new structure | POST | /compound/{id1}/conformer | [subjectid] Representation in a supported MIME format |
New URI /compound/{id1}/conformer/{id2} | 200,400,503 |
Remove all structures | DELETE | /compound/{id1}/conformer/ | [subjectid] | – | 200,400,404,503 |
Get the representation of a structure |
GET | /compound/{id1}/conformer/{id2} | [subjectid] ?feature_uris[]="URI to features" |
Representation in a supported MIME format , with feature values , if feature_uris[] provided |
200,404,503 |
Update the representation of a structure | PUT | /compound/{id1}/conformer/{id2} | [subjectid] Representation in a supported MIME format |
URI /compound/{id1}/conformer/{id2} | 200,400,404,503 |
Remove a structure | DELETE | /compound/{id1}/conformer/{id2} | – | – | 200,400,404,503</tbody> |
Features per Conformer
Description |
Method |
URI |
Parameter |
Result |
Status codes |
Get available feature URIs for a compound |
GET |
/compound/{cid}/conformer/{cid}/feature |
[subjectid] ?feature_uris[]="URIto features" (optional) |
Returns representation of the features as uri-list or RDF All available features are returned, if no parameter is specified |
200,404,503 |
Create a new feature value |
POST |
/compound/{cid}/conformer/{cid}/feature | [subjectid] ?feature_uri="URIto feature" (mandatory, single feature)&value=the_value |
URI of the compound with the new feature, e.g. /compound/{id}/conformer/{cid}?feature_uris[]=the-new-feature |
200,400,503 |
Update a new feature value | PUT |
/compound/{cid}/conformer/{cid}/feature | [subjectid] ?feature_uri="URIto feature" (mandatory, single feature)&value=the_value |
|
200,400,404,503 |
Delete specified features from the compound | DELETE |
/compound/{cid}/conformer/{cid}/feature | [subjectid] ?feature_uris[]="URIto features" (optional) |
|
200,400,404,503</tbody> |
- subjectid (optional) parameter that contains the OpenSSO A&A token needed to access protected services.
HTTP status codes
same as for Compounds
Structure representation
same as for Compounds