Skip to content

Mapping endpoints

tudorgroza edited this page Mar 5, 2021 · 14 revisions

Current workflow

  1. Create initial mapping with POST and a single Ontology Term
  2. Update mapping by changing the list of mapped Ontology Terms with PUT
  3. Delete a mapping completely with DELETE

TOC

RETRIEVE

  • Endpoint: GET /v1/projects/{projectId}/mappings?entityId=<entityId>
  • Response (Entity):
200 | OK

{
  "id": "60252fc2d5efd95ee8890ead",
  "name": "Achondroplasia",
  "mappingStatus": "AUTO_MAPPED | ...",
  "source": <SOURCE_OBJECT>,
  "mappingSuggestions": [
      <MAPPING_SUGGESTION_OBJECT>
  ],
  "mapping": <MAPPING_OBJECT>,
  "created": {
    "user": {
      "name": "Test User 1",
      "email": "[email protected]"
    },
    "timestamp": "2021-02-11T21:23:14.156+08:00"
  }
}

OR

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

CREATE

  • Endpoint: POST /v1/projects/{projectId}/mappings
  • Payload (Short version of a MappingSuggestion):
{
  "entityId": "60252fc2d5efd95ee8890ead",
  "ontologyTerm": {
    "curie": "MONDO:0007037",
    "iri": "http://purl.obolibrary.org/obo/MONDO_0007037",
    "label": "Achondroplasia",
    "status": "NEEDS_IMPORT | ..."
  }
}
200 | OK

{
  "id": "60252fc2d5efd95ee8890ead",
  "name": "Achondroplasia",
  "mappingStatus": "AUTO_MAPPED | ...",
  "source": <SOURCE_OBJECT>,
  "mappingSuggestions": [
      <MAPPING_SUGGESTION_OBJECT>
  ],
  "mapping": <MAPPING_OBJECT>,
  "created": {
    "user": {
      "name": "Test User 1",
      "email": "[email protected]"
    },
    "timestamp": "2021-02-11T21:23:14.156+08:00"
  }
}

OR

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

UPDATE

  • Endpoint: PUT /v1/projects/{projectId}/mappings/{mappingId}

DELETE

  • Endpoint: DELETE /v1/projects/{projectId}/mappings/{mappingId}