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

Endpoint Queries #186

Merged
merged 22 commits into from
Dec 2, 2024
Merged

Endpoint Queries #186

merged 22 commits into from
Dec 2, 2024

Conversation

haohangyan
Copy link
Contributor

@haohangyan haohangyan commented Oct 28, 2024

This PR adds the REST API related to getting statements from graph databases based on various constraints
There are four endpoints added:
get_stmts_for_agent_type: Query Retrieves statements on agent type (subject/subject) as well as the agent name in text
get_stmts_for_source: Retrieves statements based on the source type (e.g "reach")
get_stmts_for_rel_type: Retrieves statements based on the statement type(e.g. "Phosphorylation")
get_statements_mix: A comprehensive endpoint that allows combined filtering by agent name, agent type, source type, and statement type.

Todo

In the get_statements_mix function:

  • Rename the function to simply get_statements
  • agent_name should be agent and be either a tuple, which assumes (namespace, id) is provided, or a string, which assumes a name is provided.
  • Add other_agent and other_role as optional parameters for second agent in query.
  • Add MeSH filter, this is missing currently.
  • Add paper filter, this is also missing currently.

@haohangyan haohangyan changed the title Queries Endpoint Queries Oct 28, 2024
Copy link
Collaborator

@kkaris kkaris left a comment

Choose a reason for hiding this comment

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

I think this looks good overall, I only have minor changes that I think you should look at. Otherwise, I have some suggestions that we should discuss if they make sense or not that we don't necessarily have to implement.

src/indra_cogex/client/queries.py Outdated Show resolved Hide resolved
src/indra_cogex/client/queries.py Outdated Show resolved Hide resolved
src/indra_cogex/client/queries.py Outdated Show resolved Hide resolved
src/indra_cogex/client/queries.py Outdated Show resolved Hide resolved
src/indra_cogex/client/queries.py Outdated Show resolved Hide resolved
@kkaris kkaris self-requested a review November 1, 2024 20:25
Copy link
Collaborator

@kkaris kkaris left a comment

Choose a reason for hiding this comment

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

Just minor changes requested, otherwise it's done.

src/indra_cogex/client/queries.py Outdated Show resolved Hide resolved
src/indra_cogex/client/queries.py Outdated Show resolved Hide resolved
src/indra_cogex/client/queries.py Outdated Show resolved Hide resolved
@kkaris
Copy link
Collaborator

kkaris commented Nov 4, 2024

Updated description with todo list

@bgyori bgyori merged commit eb23c31 into gyorilab:main Dec 2, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants