From 20e9c13864c8bea13b8099df31892412a225cf12 Mon Sep 17 00:00:00 2001 From: Ugur Bayindir Date: Fri, 6 Oct 2023 16:20:38 +0100 Subject: [PATCH] =?UTF-8?q?Added=20=E2=80=98has=20soma=20location=E2=80=99?= =?UTF-8?q?=20RO:0002100=20to=20get=5Fscope=5Fquery=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/generic_coverage.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/scripts/generic_coverage.py b/src/scripts/generic_coverage.py index f64d765fe..e1e35b09a 100755 --- a/src/scripts/generic_coverage.py +++ b/src/scripts/generic_coverage.py @@ -92,10 +92,12 @@ def get_scope_query(scope_term: str) -> str: PREFIX owl: PREFIX UBERON: PREFIX CL: + PREFIX BFO: + PREFIX RO: SELECT ?scope_member ?label WHERE {{ - ?scope_member | {_scope} . + ?scope_member rdfs:subClassOf|BFO:0000050|RO:0002100 {_scope} . ?scope_member rdfs:isDefinedBy . ?scope_member rdfs:label ?label. }} @@ -116,14 +118,15 @@ def get_superclass_value_query(term_iri_list: List[str], _scope: str) -> str: PREFIX rdfs: PREFIX UBERON: PREFIX CL: + PREFIX BFO: SELECT DISTINCT ?super ?label WHERE {{ - ?term ?super. ?super rdfs:label ?label. - ?super | {_scope}. + ?term rdfs:subClassOf ?super. ?super rdfs:label ?label. + ?super rdfs:subClassOf|BFO:0000050 {_scope}. ?super rdfs:isDefinedBy . VALUES ?term {{{' '.join(term_iri_list)}}} - FILTER(?term != ?super) + FILTER(?term != ?super) }} """ @@ -143,12 +146,13 @@ def get_term_leaves_list_query(term_iri_list: List[str], scope_term: str) -> str PREFIX rdfs: PREFIX CL: PREFIX UBERON: + PREFIX BFO: SELECT ?term_label ?term_leaf ?term_leaf_label WHERE {{ - ?term_leaf ?term. + ?term_leaf rdfs:subClassOf ?term. ?term_leaf rdfs:label ?term_leaf_label. ?term_leaf rdfs:isDefinedBy . - ?term_leaf | {_scope}. + ?term_leaf rdfs:subClassOf|BFO:0000050 {_scope}. ?term rdfs:label ?term_label. VALUES ?term {{{' '.join(term_iri_list)}}} }}