Skip to content

Commit

Permalink
Agent type can be either object or subject in get_stmts_for_agent_type
Browse files Browse the repository at this point in the history
  • Loading branch information
haohangyan committed Oct 31, 2024
1 parent 6320529 commit 5683014
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/indra_cogex/client/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,14 +1272,17 @@ def get_stmts_for_agent_type(
RETURN p LIMIT $limit
"""
else:
raise ValueError("agent_role must be 'subject' or 'object'")
query = """
MATCH p = (a:BioEntity {name: $agent_name})-[r:indra_rel]-(b:BioEntity)
RETURN p LIMIT $limit
"""

params = {
"agent_name": agent_name,
"limit": limit
}

logger.info(f"Getting statements for agent '{agent_name}' as '{agent_role}' with limit {limit}")
logger.info(f"Getting statements for agent '{agent_name}' with limit {limit}")
rels = client.query_relations(query, **params)
stmts = indra_stmts_from_relations(rels, deduplicate=True)
if evidence_limit and evidence_limit > 1:
Expand Down

0 comments on commit 5683014

Please sign in to comment.