Skip to content

Mapping endpoints

tudorgroza edited this page Mar 22, 2021 · 14 revisions

Current workflow

  1. Create initial mapping with POST and a list of Ontology Terms
  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: Mapping:
200 | OK

{
  "id": "60252fc2d5efd95ee8890eb2",
  "entityId": "60252fc2d5efd95ee8890ead",
  "ontologyTerms": [{
    "curie": "Orphanet:15",
    "iri": "http://www.orpha.net/ORDO/Orphanet_15",
    "label": "Achondroplasia",
    "status": "CURRENT | ..."
  },
  ...
  ]
  "reviewed": false,
  "status": "AWAITING_REVIEW | ...",
  "reviews": [],
  "comments": [],
  "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:
{
  "entityId": "STRING",
  "ontologyTerms": [{
    "curie": "MONDO:0007037",
    "iri": "http://purl.obolibrary.org/obo/MONDO_0007037",
    "label": "Achondroplasia",
    "status": "NEEDS_IMPORT | ..."
  }]
}
201 | CREATED

{
  "id": "60252fc2d5efd95ee8890eb2",
  "entityId": "60252fc2d5efd95ee8890ead",
  "ontologyTerms": [{
    "curie": "Orphanet:15",
    "iri": "http://www.orpha.net/ORDO/Orphanet_15",
    "label": "Achondroplasia",
    "status": "CURRENT | ..."
  },
  ...
  ]
  "reviewed": false,
  "status": "AWAITING_REVIEW | ...",
  "reviews": [],
  "comments": [],
  "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

UPDATE

  • Endpoint: PUT /v1/projects/{projectId}/mappings/{mappingId}
  • Payload Mapping
{
  "id": "60252fc2d5efd95ee8890eb2",
  "entityId": "60252fc2d5efd95ee8890ead",
  "ontologyTerms": [{
    "curie": "Orphanet:15",
    "iri": "http://www.orpha.net/ORDO/Orphanet_15",
    "label": "Achondroplasia",
    "status": "CURRENT | ..."
  },
  ...
  ]
  "reviewed": false,
  "status": "AWAITING_REVIEW | ...",
  "reviews": [],
  "comments": [],
  "created": {
    "user": {
      "name": "Test User 1",
      "email": "[email protected]"
    },
    "timestamp": "2021-02-11T21:23:14.156+08:00"
  }
}
200 | OK

{
  "id": "60252fc2d5efd95ee8890eb2",
  "entityId": "60252fc2d5efd95ee8890ead",
  "ontologyTerms": [{
    "curie": "Orphanet:15",
    "iri": "http://www.orpha.net/ORDO/Orphanet_15",
    "label": "Achondroplasia",
    "status": "CURRENT | ..."
  },
  ...
  ]
  "reviewed": false,
  "status": "AWAITING_REVIEW | ...",
  "reviews": [],
  "comments": [],
  "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 mappingId are inexistent or user doesn't have access to projectId

DELETE

  • Endpoint: DELETE /v1/projects/{projectId}/mappings/{mappingId}
  • Response: 200 | OK or 404 | NOT FOUND if projectId or mappingId are inexistent or user doesn't have access to projectId