Skip to content

Commit

Permalink
update docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssadai committed Oct 17, 2024
1 parent f76880d commit 154c298
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/api/routers/route_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
def create_get_instances_handler(
data_element_uri: str, external_vocab: str | None
):
"""
When a GET request is sent, return a dict with the only key corresponding to the controlled term of a neurobagel class,
and the value being a list of dictionaries each corresponding to an available class instance term from the graph.
"""
"""Create the handler function (path function) for the root `/` path of an attribute router."""

async def get_instances(request: Request):
"""
When a GET request is sent, return a dict with the only key corresponding to the controlled term of a neurobagel class,
and the value being a list of dictionaries each corresponding to an available class instance term from the graph.
"""
term_labels_path = (
request.app.state.vocab_lookup_paths[external_vocab]
if external_vocab is not None
Expand All @@ -23,9 +24,13 @@ async def get_instances(request: Request):


def create_get_vocab_handler(external_vocab: str, vocab_name: str):
"""When a GET request is sent, return a dict containing the name, namespace info, and all term ID-label mappings for the vocabulary of the specified variable."""
"""Create the handler function (path function) for the `/vocab` endpoint of an attribute router."""

async def get_vocab(request: Request):
"""
When a GET request is sent, return a dict containing the name, namespace info,
and all term ID-label mappings for the vocabulary of the specified variable.
"""
return await crud.get_term_labels_for_vocab(
term_labels_path=request.app.state.vocab_lookup_paths[
external_vocab
Expand Down

0 comments on commit 154c298

Please sign in to comment.