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

Bug fix to sources endpoint #148

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.5
2.1.6
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "ubkg_api"
version = "2.1.5"
version = "2.1.6"
authors = [
{ name="HuBMAP Consortium", email="api-developers@hubmapconsortium.org" },
]
Expand All @@ -22,7 +22,7 @@ classifiers = [
dependencies = [
"python_dateutil>=2.6.0",
"setuptools>=21.0.0",
"Flask==2.1.3",
"Flask==3.0.3",
"neo4j==5.15.0"
]

Expand Down
8 changes: 4 additions & 4 deletions src/ubkg_api/cypher/sources.cypher
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CALL
CALL
{
WITH CUISource
MATCH (pSource:Concept)-[:has_sab]->(p:Concept)-[:CODE]->(c:Code)-[r:PT]->(t:Term)
MATCH (pSource:Concept)-[:has_sab]->(p:Concept)-[:CODE]->(c:Code)-[r:PT]->(t:Term)
WHERE pSource.CUI=CUISource
$sabfilter
AND r.CUI = p.CUI
Expand Down Expand Up @@ -44,7 +44,7 @@ CALL
CALL
{
WITH CUISource
MATCH (pSource:Concept)-[:has_home_url]->(p:Concept)-[:CODE]->(c:Code)-[r:PT]->(t:Term)
OPTIONAL MATCH (pSource:Concept)-[:has_home_url]->(p:Concept)-[:CODE]->(c:Code)-[r:PT]->(t:Term)
WHERE pSource.CUI=CUISource
AND r.CUI = p.CUI
RETURN COLLECT(t.name) AS home_urls
Expand All @@ -53,7 +53,7 @@ CALL
CALL
{
WITH CUISource
MATCH (pSource:Concept)-[:has_source_dictionary_url]->(p:Concept)-[:CODE]->(c:Code)-[r:PT]->(t:Term)
OPTIONAL MATCH (pSource:Concept)-[:has_source_dictionary_url]->(p:Concept)-[:CODE]->(c:Code)-[r:PT]->(t:Term)
WHERE pSource.CUI=CUISource
AND r.CUI = p.CUI
RETURN t.name AS source_dictionary_url
Expand All @@ -62,7 +62,7 @@ CALL
CALL
{
WITH CUISource
MATCH (pSource:Concept)-[:has_citation]->(p:Concept)-[:CODE]->(c:Code)-[r:PT]->(t:Term)
OPTIONAL MATCH (pSource:Concept)-[:has_citation]->(p:Concept)-[:CODE]->(c:Code)-[r:PT]->(t:Term)
WHERE pSource.CUI=CUISource
AND r.CUI = p.CUI
RETURN COLLECT(DISTINCT {PMID:split(t.name,':')[1], url:'https://pubmed.ncbi.nlm.nih.gov/'+split(t.name,':')[1]}) AS citations
Expand Down
10 changes: 3 additions & 7 deletions src/ubkg_api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
Flask==3.0.3
# Flask depends on Werkzeug...
Werkzeug==3.0.3

python_dateutil >= 2.6.0
setuptools >= 21.0.0
Flask == 2.1.3
neo4j == 5.15.0
pytest==7.3.1

# Flask 2.1.3 installs the latest Werkzeug==3.0.0 (released on 9/30/2023) and causing import issues
# Use a pinned version 2.3.7 (the latest release before 3.0.0) to mitigate temporaryly
# Will upgrade Flask to newer version later on across all APIs. 10/3/2023 - Zhou
Werkzeug==2.3.7

2 changes: 1 addition & 1 deletion ubkg-api-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ paths:
description: A sequential set of relationships that specifies the pattern of relationships in the paths in the subgraph. Each element in the set should be in format SAB:relationship type. SAB corresponds to the source in which the relationship was asserted--e.g., "NCI:is_marked_by_gene_product" corresponds to the "is_marked_by_gene_product" relationship asserted in NCI. The set can be specified with a list of values delimited with commas (e.g., ?relsequence=SAB1:relationshiptype1,SAB2:relationshiptype2) or with individual key-value pairs (e.g., ?relsequence=SAB1:relationship_type1&relsequence=SAB2:relationshiptype2).
schema:
type: string
example: NCI:is_marked_by_gene_product,NCI:3Agene_product_encoded_by_gene
example: NCI:is_marked_by_gene_product,NCI:gene_product_encoded_by_gene
- name: skip
in: query
required: false
Expand Down
Loading