Skip to content

OntologyTerm endpoints

tudorgroza edited this page Apr 23, 2021 · 11 revisions

TOC

CREATE

  • Endpoint: POST /v1/projects/{projectId}/ontology-terms
  • Note: if no status is provided in the ontologyTerm part of the payload, the term will automatically get the NEEDS_CREATION status.
  • Payload:
{
  "context": "CONTEXT",
  "ontologyTerm": 
    {
      "curie": "MONDO:0007037",                                   // NOT EMPTY
      "iri": "http://purl.obolibrary.org/obo/MONDO_0007037",      // NOT EMPTY
      "label": "Achondroplasia",                                  // NOT EMPTY
      "status": "NEEDS_IMPORT",
      "description": "Description",
      "crossRefs": "X-refs"
    }
}
201 | CREATED

{
  "curie": "MONDO:0007037",
  "iri": "http://purl.obolibrary.org/obo/MONDO_0007037",
  "label": "Achondroplasia",
  "status": "NEEDS_IMPORT",
  "description": "Description",
  "crossRefs": "X-refs"
}

OR

404 | NOT FOUND
  • If projectId is inexistent or user doesn't have access to it

RETRIEVE

  • Endpoint: GET /v1/projects/{projectId}/ontology-terms?status=<STATUS>&context=<CONTEXT>
  • Parameters:
    • status (MANDATORY) - NEEDS_IMPORT | NEEDS_CREATION.
    • context (MANDATORY) - project context
  • Response (Paginated list of OntologyTerm):
200 | OK
[
  {
    "curie": "MONDO:0007037",
    "iri": "http://purl.obolibrary.org/obo/MONDO_0007037",
    "label": "Achondroplasia",
    "status": "NEEDS_IMPORT",
    "description": "Description",
    "crossRefs": "X-refs"
  },
...
]

OR

404 | NOT FOUND
  • If projectId is inexistent or user doesn't have access to it

ACTION

  • Endpoint: POST /v1/projects/{projectId}/ontology-terms/action
  • Payload:
{
  "status": "NEEDS_IMPORT | NEEDS_CREATION",
  "context": "CONTEXT",
  "comment": "STRING"
}
  • Response: 201 | CREATED OR
404 | NOT FOUND
  • If projectId is inexistent or user doesn't have access to it

EXPORT

  • Endpoint: POST /v1/projects/{projectId}/ontology-terms/export
  • Payload:
{
  "status": "NEEDS_IMPORT | NEEDS_CREATION",
  "context": "CONTEXT"
}
  • Response: 201 | CREATED + byte array payload denoting the resulted file
  • Note: CONTENT_DISPOSITION will contain in filename the name of the resulted file OR
404 | NOT FOUND
  • If projectId is inexistent or user doesn't have access to it

STATS

  • Endpoint: GET /v1/projects/{projectId}/ontology-terms-stats?context=<CONTEXT>
  • Parameter: context (MANDATORY) - project context
  • Response:
200 | OK
 ​{
   ​"stats": {
     "NEEDS_CREATION": 10,
     "NEEDS_IMPORT": 10
   }
 ​}

OR

404 | NOT FOUND

​* If projectId is inexistent or user doesn't have access to it