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

Create a more universal method of supporting and retreiving protocol_url #606

Open
maxsibilla opened this issue Feb 4, 2025 · 1 comment · May be fixed by #619
Open

Create a more universal method of supporting and retreiving protocol_url #606

maxsibilla opened this issue Feb 4, 2025 · 1 comment · May be fixed by #619
Assignees

Comments

@maxsibilla
Copy link
Contributor

maxsibilla commented Feb 4, 2025

The two primary issues with protocol_url is that it lives inside of Activity and it isn't always necessary.

We currently have to specially handle this property in these main locations:

  • app_neo4j_queries.py where we iterate over the result of the initial query then append the result of get_activity_protocol which is another Neo4j query
    • We could potentially combine these queries into 1 to make it faster and cleaner
@maxsibilla maxsibilla added this to CODCC Feb 4, 2025
@maxsibilla maxsibilla converted this from a draft issue Feb 4, 2025
@maxsibilla
Copy link
Contributor Author

From @libpitt, potential query to address the first point

MATCH (e:Entity)<-[:USED|WAS_GENERATED_BY*]-(t:Entity) WHERE e.uuid='15c6e1725831929ee8405c432a61331d' AND e.entity_type <> 'Lab' 
MATCH (e2:Entity)-[:WAS_GENERATED_BY]->(a:Activity) WHERE e2.uuid = t.uuid

WITH keys(t) AS k1, t, a unwind k1 AS k2 WITH t, a, k2 WHERE k2 IN ['protocol_url', 'entity_type', 'data_access_level', 'group_name', 'group_uuid', 'sennet_id', 'uuid', 'source_type', 'sample_category', 'organ', 'dataset_type', 'contains_human_genetic_sequences', 'status'] WITH a, t, apoc.map.fromPairs([[k2, t[k2]], ['uuid', t.uuid], ['url', a.protocol_url]]) AS dict WITH collect(dict) as list WITH apoc.map.groupByMulti(list, 'uuid') AS groups unwind keys(groups) AS uuids WITH apoc.map.mergeList(groups[uuids]) AS rows RETURN collect(rows) AS result

@libpitt libpitt self-assigned this Feb 5, 2025
@libpitt libpitt moved this from Ready to In Progress in CODCC Feb 5, 2025
libpitt added a commit that referenced this issue Feb 5, 2025
libpitt added a commit that referenced this issue Feb 6, 2025
libpitt added a commit that referenced this issue Feb 7, 2025
libpitt added a commit that referenced this issue Feb 10, 2025
libpitt added a commit that referenced this issue Feb 10, 2025
libpitt added a commit that referenced this issue Feb 10, 2025
@libpitt libpitt moved this from In Progress to Review/QA in CODCC Feb 10, 2025
@maxsibilla maxsibilla linked a pull request Feb 10, 2025 that will close this issue
libpitt added a commit that referenced this issue Feb 11, 2025
libpitt added a commit that referenced this issue Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review/QA
Development

Successfully merging a pull request may close this issue.

2 participants