Sage-Bionetworks / sage-monorepo

Where OpenChallenges, Schematic, and other Sage open source apps are built
https://sage-bionetworks.github.io/sage-monorepo/
Apache License 2.0
21 stars 12 forks source link

feat(openchallenges): create endpoint to search EDAM concepts #2622

Closed tschaffter closed 2 months ago

tschaffter commented 2 months ago

Closes #2608

Description

Add endpoints to the Challenge Service to explore EDAM concepts.

This endpoint will be used by the OC web app to enable users to filter challenges using selected EDAM concepts. The filtering of challenges using EDAM concepts will be implemented in another PR to keep this PR lean.

cc: @rrchai

Changelog

Notes

For the new endpoint to be accessible via the API gateway, its config must be updated. See #2636.

Preview

List EDAM concepts:

GET {{basePath}}/edamConcepts
HTTP/1.1 200 

{
  "number": 0,
  "size": 100,
  "totalElements": 3473,
  "totalPages": 35,
  "hasNext": true,
  "hasPrevious": false,
  "edamConcepts": [
    {
      "id": 7,
      "classId": "http://edamontology.org/data_0831",
      "preferredLabel": "MeSH vocabulary"
    },
    {
      "id": 19,
      "classId": "http://edamontology.org/data_0851",
      "preferredLabel": "Sequence mask character"
    },

List the EDAM concepts that match the space-separated search terms "sequence":

GET {{basePath}}/edamConcepts?searchTerms=sequence
HTTP/1.1 200 

{
  "number": 0,
  "size": 100,
  "totalElements": 362,
  "totalPages": 4,
  "hasNext": true,
  "hasPrevious": false,
  "edamConcepts": [
    {
      "id": 805,
      "classId": "http://edamontology.org/data_2044",
      "preferredLabel": "Sequence"
    },
    {
      "id": 18,
      "classId": "http://edamontology.org/data_0850",
      "preferredLabel": "Sequence set"
    },
    {
      "id": 3073,
      "classId": "http://edamontology.org/topic_0158",
      "preferredLabel": "Sequence motifs"
    },

How to test

  1. Remove all Docker artifacts: workspace-docker-stop && docker system prune -a
  2. Build the OC images: openchallenges-build-images
  3. Start the challenge service and its dependencies: nx serve-detach openchallenges-challenge-service
  4. Try the EDAM example queries defined in apps/openchallenges/challenge-service/requests.http
tschaffter commented 2 months ago

I need to fix 9 issues identified by Sonar for the challenge service.

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed for 'openchallenges-app'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed for 'openchallenges-challenge-service'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed for 'openchallenges-organization-service'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed for 'openchallenges-image-service'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud