Skip to content

Commit

Permalink
Merge pull request #148 from x-atlas-consortia/jas_fix_sources
Browse files Browse the repository at this point in the history
Bug fix to sources endpoint
  • Loading branch information
yuanzhou authored Aug 12, 2024
2 parents 27bff22 + 6c94ed5 commit affaf1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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
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

0 comments on commit affaf1d

Please sign in to comment.