Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Add endpoint returning queryable attributes + refine existing endpoint for attribute instances #194

Merged
merged 8 commits into from
Oct 3, 2023

Conversation

alyssadai
Copy link
Contributor

@alyssadai alyssadai commented Oct 3, 2023

Closes #176
Closes #186

Changes proposed in this pull request:

  • New router created for paths under the /attributes prefix
    • Existing endpoint for terms discovery: also moved under this prefix, i.e. /attributes/{data_element_URI}
  • New endpoint created that returns all subclasses of nb:ControlledTerm
  • Query string for existing terms discovery endpoint updated to return URIs for only instances of controlled term subclasses
  • Helper function added to abbreviate namespaces in term URLs from the graph (e.g., "http://neurobagel.org/vocab/Diagnosis" -> "nb:Diagnosis")

Checklist

  • PR has an interpretable title with a prefix ([ENH], [FIX], [REF], [TST], [CI], [MNT], [INF], [MODEL], [DOC]) (see https://neurobagel.org/contributing/pull_requests for more info)
  • PR links to GitHub issue with mention Closes #XXXX
  • Tests pass
  • Checks pass

For new features:

  • Tests have been added

For bug fixes:

  • There is at least one test that would fail under the original bug conditions.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 6389516984

  • 70 of 70 (100.0%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 99.786%

Totals Coverage Status
Change from base Build 6343634889: 0.03%
Covered Lines: 467
Relevant Lines: 468

💛 - Coveralls

@rmanaem rmanaem self-requested a review October 3, 2023 17:11
Copy link
Collaborator

@rmanaem rmanaem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a comment regarding the new function in crud.py other than that it's good to go. 🧑‍🍳

tests/test_query.py Show resolved Hide resolved
tests/test_query.py Show resolved Hide resolved
tests/test_query.py Show resolved Hide resolved
tests/test_query.py Show resolved Hide resolved
app/api/crud.py Show resolved Hide resolved
rmanaem

This comment was marked as duplicate.

@alyssadai alyssadai merged commit 8a5efa1 into main Oct 3, 2023
4 checks passed
@alyssadai alyssadai deleted the iss-176/create-attributes-endpoint branch October 3, 2023 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants