Annotation API
/text_annotation
| GET | Annotate a block of text, based on the specified dictionaries. |
|---|
Parameters
| Name | Located in | Description | Type |
|---|---|---|---|
| dictionaries | query | dictionary names, delimited by comma (',') | String |
| text | query | a block of text | String |
| rich | query | set it to 'true' for rich output | Boolean |
| threshold | query | similarity threshold for cut-off | Float |
Responses
200 annotation result in the PubAnnotation JSON Format
{
"text":"I have a stomach ache.",
"denotations":[
{
"span":{"begin":9,"end":16},
"obj":"http://purl.obolibrary.org/obo/UBERON_0000945"
}
]
}400 Bad Request, e.g., a mandatory parameter setting is missing.
{
"message": "no text is supplied."
}| POST | Same as above, but a block (or blocks) of text can be given in JSON |
|---|
Parameters
| Name | Located in | Description | Type |
|---|---|---|---|
| body | body | a JSON object with a block of text | Array of Object |
| rich | query | set it to 'true' for rich output | Boolean |
| threshold | query | similarity threshold for cut-off | Float |
Responses
200 annotation result in PubAnnotation JSON Format
{
"text":"I have a stomach ache.",
"denotations":[
{
"span":{"begin":9,"end":16},
"obj":"http://purl.obolibrary.org/obo/UBERON_0000945"
}
]
}400 Bad Request, e.g., a mandatory parameter setting is missing.
{
"message": "no text is supplied."
}/annotation_tasks
| POST | To create an annotation task to a block of text (or blocks of text). |
|---|
Parameters
| Name | Located in | Description | Type |
|---|---|---|---|
| dictionaries | query | dictionaries, delimited by comma (',') | String |
| body | body | a JSON object with a block of text, or an array of multiple JSON objects | Array of Object |
| rich | query | set it to 'true' for rich output | Boolean |
| threshold | query | similarity threshold for cut-off | Float |
Responses
201 The URL from which the result of annotation to be retrieved will be informed through the Location header
Headers
| Name | Description | Type | Format |
|---|---|---|---|
| Location | The URL from which the result of annotation to be retrieved | string | url |
400 Bad Request, e.g., a mandatory parameter setting is missing.
{
"message": "no text is supplied."
}503 The request is valid, but the server is unavailable to fulfil it due to, e.g., server overload.
/annotation_tasks/{id}
/annotation_results/{id}
| GET | To retrieve the result of annotation |
|---|
Parameters
| Name | Located in | Description | Type |
|---|---|---|---|
| id | path | the id of annotation result | String |
Responses
200 The result of annotation in PubAnnotation JSON format.
{
"text":"I have a stomach ache.",
"denotations":[
{
"span":{"begin":9,"end":16},
"obj":"http://purl.obolibrary.org/obo/UBERON_0000945"
}
]
}