INCATools / ubergraph

Integrated OBO ontology store
BSD 3-Clause "New" or "Revised" License
42 stars 3 forks source link

Visualize ubergraph property hierarchy #120

Closed raven44099 closed 1 year ago

raven44099 commented 1 year ago

Hi, I want to have a python tree object of the ubergraph. What would be the recommended way to get there? I have a solution, but it is very unsatisfying:

  1. Using the "https://ubergraph.apps.renci.org/sparql"-API I download all owl:OjectProperty.
code

```python from SPARQLWrapper import SPARQLWrapper, JSON def query_SPARQL_api(new_query, link, return_ret=False, print_ret = True): sparql = SPARQLWrapper( link) sparql.setReturnFormat(JSON) sparql.setQuery(new_query) ret = sparql.queryAndConvert() try: ret = sparql.queryAndConvert() if print_ret==True: for i, r in enumerate(ret["results"]["bindings"]): print(f'{i} has {r}') if return_ret==True: return ret except Exception as e: print(e) print('was exception') api_link = "https://ubergraph.apps.renci.org/sparql" new_query = """ SELECT DISTINCT ?property ?parent ?label WHERE { ?property a owl:ObjectProperty . OPTIONAL { ?property rdfs:subPropertyOf ?parent . } OPTIONAL { ?property rdfs:label ?label . } # FILTER (STRSTARTS(STR(?property), STR(ro:))) } """ ret = query_SPARQL_api(new_query, api_link, return_ret=True, print_ret=False) ret["results"]["bindings"][:11] ```

  1. Next, I build a tree by by iteratively adding children to the parents, starting from a root called 'None'.
    code

from treelib import Tree

results = ret["results"]["bindings"]
count =0
tree = Tree()
tree.create_node("None", "None")
results_current = results.copy()
while results_current != []:
    lst_indizes = []
    for i, row in enumerate(results_current[:]):
        property_uri = row['property']['value']
        label      = row['label']['value']  if 'label'  in row else property_uri
        parent_uri = row['parent']['value'] if 'parent' in row else 'None' 

        # check if the parent node exists in the tree
        parent_node = tree.get_node(str(parent_uri))
        if parent_node is not None:
            exist_node = tree.get_node(str(property_uri))
            if exist_node is None:
                tree.create_node(label, str(property_uri), parent=str(parent_uri))
        else:
          lst_indizes.append(i)

    results_current = [results_current[i] for i in lst_indizes]
    print(len(lst_indizes))
    if len(lst_indizes) < 9:
      count +=1
      print(results_current)
      if count == 10:

        results_current =[]

For some reason, this method cannot attach 8 nodes:

Nodes 1-8

[{'property': {'type': 'uri', 'value': '[http://purl.obolibrary.org/obo/RO_0001000](http://purl.obolibrary.org/obo/RO_0001000)'}, 'parent': {'type': 'uri', 'value': '[http://www.w3.org/2002/07/owl#topObjectProperty](http://www.w3.org/2002/07/owl#topObjectProperty)'}, 'label': {'xml:lang': 'en', 'type': 'literal', 'value': 'derives from'}}, {'property': {'type': 'uri', 'value': '[http://purl.obolibrary.org/obo/COB_0000016](http://purl.obolibrary.org/obo/COB_0000016)'}, 'parent': {'type': 'uri', 'value': '[http://www.w3.org/2002/07/owl#topObjectProperty](http://www.w3.org/2002/07/owl#topObjectProperty)'}, 'label': {'xml:lang': 'en', 'type': 'literal', 'value': 'executed by'}}, {'property': {'type': 'uri', 'value': '[http://purl.obolibrary.org/obo/FOODON_00001303](http://purl.obolibrary.org/obo/FOODON_00001303)'}, 'parent': {'type': 'uri', 'value': '[http://www.w3.org/2002/07/owl#topObjectProperty](http://www.w3.org/2002/07/owl#topObjectProperty)'}, 'label': {'xml:lang': 'en', 'type': 'literal', 'value': 'obsolete - has taxonomic identifier'}}, {'property': {'type': 'uri', 'value': '[http://purl.obolibrary.org/obo/CLAO_0001272](http://purl.obolibrary.org/obo/CLAO_0001272)'}, 'parent': {'type': 'uri', 'value': '[http://www.w3.org/2002/07/owl#topObjectProperty](http://www.w3.org/2002/07/owl#topObjectProperty)'}, 'label': {'xml:lang': 'en', 'type': 'literal', 'value': 'encircled by'}}, {'property': {'type': 'uri', 'value': '[http://purl.obolibrary.org/obo/RO_0015001](http://purl.obolibrary.org/obo/RO_0015001)'}, 'parent': {'type': 'uri', 'value': '[http://www.w3.org/2002/07/owl#topObjectProperty](http://www.w3.org/2002/07/owl#topObjectProperty)'}, 'label': {'datatype': 'http://www.w3.org/2001/XMLSchema#string', 'type': 'literal', 'value': 'has exemplar data'}}, {'property': {'type': 'uri', 'value': '[http://purl.obolibrary.org/obo/RO_0015002](http://purl.obolibrary.org/obo/RO_0015002)'}, 'parent': {'type': 'uri', 'value': '[http://www.w3.org/2002/07/owl#topObjectProperty](http://www.w3.org/2002/07/owl#topObjectProperty)'}, 'label': {'datatype': 'http://www.w3.org/2001/XMLSchema#string', 'type': 'literal', 'value': 'exemplar data of'}}, {'property': {'type': 'uri', 'value': '[http://purl.obolibrary.org/obo/RO_0002378](http://purl.obolibrary.org/obo/RO_0002378)'}, 'parent': {'type': 'bnode', 'value': 't13502079'}, 'label': {'xml:lang': 'en', 'type': 'literal', 'value': 'anabranch of'}}, {'property': {'type': 'uri', 'value': '[http://purl.obolibrary.org/obo/RO_0002378](http://purl.obolibrary.org/obo/RO_0002378)'}, 'parent': {'type': 'bnode', 'value': 't17991863'}, 'label': {'xml:lang': 'en', 'type': 'literal', 'value': 'anabranch of'}}]

The resulting tree looks as follows:

`tree.show()` run `tree.show()` ``` None ├── Allele_Has_Activity ├── Allele_Plays_Role_In_Metabolism_Of_Chemical_Or_Drug ├── Anatomic_Structure_Has_Location ├── Anatomic_Structure_Is_Physical_Part_Of ├── Biological_Process_Has_Associated_Location ├── Biological_Process_Has_Initiator_Chemical_Or_Drug ├── Biological_Process_Has_Initiator_Process ├── Biological_Process_Has_Result_Anatomy ├── Biological_Process_Has_Result_Biological_Process ├── Biological_Process_Has_Result_Chemical_Or_Drug ├── Biological_Process_Is_Part_Of_Process ├── Chemical_Or_Drug_Affects_Abnormal_Cell ├── Chemical_Or_Drug_Affects_Cell_Type_Or_Tissue ├── Chemical_Or_Drug_Affects_Gene_Product ├── Chemical_Or_Drug_Has_Mechanism_Of_Action ├── Chemical_Or_Drug_Has_Physiologic_Effect ├── Chemical_Or_Drug_Is_Metabolized_By_Enzyme ├── Chemical_Or_Drug_Plays_Role_In_Biological_Process ├── Chemotherapy_Regimen_Has_Component ├── Conceptual_Part_Of ├── Cytogenetic_Abnormality_Involves_Chromosome ├── DEPRECATED bearer of ├── DEPRECATED inheres in ├── Disease_Excludes_Abnormal_Cell ├── Disease_Excludes_Cytogenetic_Abnormality ├── Disease_Excludes_Finding ├── Disease_Excludes_Metastatic_Anatomic_Site ├── Disease_Excludes_Molecular_Abnormality ├── Disease_Excludes_Normal_Cell_Origin ├── Disease_Excludes_Normal_Tissue_Origin ├── Disease_Excludes_Primary_Anatomic_Site ├── Disease_Has_Abnormal_Cell ├── Disease_Has_Associated_Anatomic_Site ├── Disease_Has_Associated_Disease ├── Disease_Has_Cytogenetic_Abnormality ├── Disease_Has_Finding ├── Disease_Has_Metastatic_Anatomic_Site ├── Disease_Has_Molecular_Abnormality ├── Disease_Has_Normal_Cell_Origin ├── Disease_Has_Normal_Tissue_Origin ├── Disease_Has_Primary_Anatomic_Site ├── Disease_Is_Grade ├── Disease_Is_Stage ├── Disease_Mapped_To_Chromosome ├── Disease_Mapped_To_Gene ├── Disease_May_Have_Abnormal_Cell ├── Disease_May_Have_Associated_Disease ├── Disease_May_Have_Cytogenetic_Abnormality ├── Disease_May_Have_Finding ├── Disease_May_Have_Molecular_Abnormality ├── Disease_May_Have_Normal_Cell_Origin ├── Disease_May_Have_Normal_Tissue_Origin ├── EO_Disease_Has_Associated_Cell_Type ├── EO_Disease_Has_Associated_EO_Anatomy ├── EO_Disease_Has_Property_Or_Attribute ├── EO_Disease_Maps_To_Human_Disease ├── Gene_Associated_With_Disease ├── Gene_Found_In_Organism ├── Gene_Has_Abnormality │ └── Allele_Has_Abnormality ├── Gene_Has_Physical_Location ├── Gene_In_Chromosomal_Location │ ├── Allele_Absent_From_Wild-type_Chromosomal_Location │ └── Allele_In_Chromosomal_Location ├── Gene_Involved_In_Pathogenesis_Of_Disease ├── Gene_Is_Biomarker_Of ├── Gene_Is_Biomarker_Type ├── Gene_Is_Element_In_Pathway ├── Gene_Mutant_Encodes_Gene_Product_Sequence_Variation ├── Gene_Plays_Role_In_Process │ └── Allele_Plays_Altered_Role_In_Process ├── Gene_Product_Encoded_By_Gene ├── Gene_Product_Expressed_In_Tissue ├── Gene_Product_Has_Abnormality ├── Gene_Product_Has_Associated_Anatomy ├── Gene_Product_Has_Biochemical_Function ├── Gene_Product_Has_Chemical_Classification ├── Gene_Product_Has_Organism_Source ├── Gene_Product_Has_Structural_Domain_Or_Motif ├── Gene_Product_Is_Biomarker_Of ├── Gene_Product_Is_Biomarker_Type ├── Gene_Product_Is_Element_In_Pathway ├── Gene_Product_Is_Physical_Part_Of ├── Gene_Product_Malfunction_Associated_With_Disease ├── Gene_Product_Plays_Role_In_Biological_Process ├── Gene_Product_Sequence_Variation_Encoded_By_Gene_Mutant ├── Gene_Product_Variant_Of_Gene_Product ├── Molecular_Abnormality_Involves_Gene ├── Procedure_Has_Target_Anatomy │ ├── Procedure_Has_Imaged_Anatomy │ └── Procedure_May_Have_Excised_Anatomy │ └── Procedure_Has_Excised_Anatomy │ ├── Procedure_May_Have_Completely_Excised_Anatomy │ │ └── Procedure_Has_Completely_Excised_Anatomy │ └── Procedure_May_Have_Partially_Excised_Anatomy │ └── Procedure_Has_Partially_Excised_Anatomy ├── Procedure_Has_Target_Disease ├── Procedure_Uses_Manufactured_Object ├── Regimen_Has_Accepted_Use_For_Disease ├── X medial to y if x is closer to the midsagittal plane than y. ├── aboral to ├── abscised ├── abscised from ├── achieves_planned_objective ├── adjacent_to ├── after ├── aligned with ├── amount ├── anastomoses with ├── anatomical relation ├── anterior to │ ├── immediately anterior to │ └── posteriorly connected to ├── anterior_to │ ├── anterolateral_to │ └── anteromedial_to ├── approximately perpendicular to ├── associated_with ├── attached_to ├── avoided behavior ├── avoided food ├── avoided medical action ├── bearer of │ ├── has disposition │ ├── has function │ ├── has quality │ └── has role │ ├── has application role │ ├── has biological role │ └── has chemical role ├── bound_to ├── by_means ├── causally related to │ ├── causal relation between entities │ │ ├── causally influenced by │ │ │ └── determined by │ │ ├── causally influences │ │ │ ├── determines │ │ │ ├── regulates activity of │ │ │ │ └── indirectly regulates activity of │ │ │ │ ├── indirectly negatively regulates activity of │ │ │ │ └── indirectly positively regulates activity of │ │ │ └── regulates quantity of │ │ │ ├── directly regulates quantity of │ │ │ │ ├── directly negatively regulates quantity of │ │ │ │ │ └── destabilizes quantity of │ │ │ │ └── directly positively regulates quantity of │ │ │ │ └── stabilizes quantity of │ │ │ └── indirectly regulates quantity of │ │ │ ├── indirectly negatively regulates quantity of │ │ │ │ └── decreases by repression quantity of │ │ │ └── indirectly positively regulates quantity of │ │ │ └── increases by expression quantity of │ │ └── determined by part of │ ├── causal relation between material entity and a process │ │ └── causal agent in process │ │ ├── acts upstream of or within │ │ │ ├── acts upstream of │ │ │ ├── acts upstream of or within, negative effect │ │ │ │ └── acts upstream of, negative effect │ │ │ └── acts upstream of or within, positive effect │ │ │ └── acts upstream of, positive effect │ │ └── capable of regulating │ │ ├── capable of negatively regulating │ │ │ ├── capable of inhibiting or preventing pathological process │ │ │ │ └── is substance that treats │ │ │ └── is small molecule inhibitor of │ │ ├── capable of positively regulating │ │ │ ├── capable of upregulating or causing pathological process │ │ │ └── is small molecule activator of │ │ └── is small molecule regulator of │ ├── causal relation between processes │ │ ├── causally downstream of or within │ │ │ └── regulated by │ │ │ ├── directly regulated by │ │ │ │ ├── directly negatively regulated by │ │ │ │ └── directly positively regulated by │ │ │ ├── has regulatory component activity │ │ │ │ ├── has negative regulatory component activity │ │ │ │ └── has positive regulatory component activity │ │ │ ├── negatively regulated by │ │ │ └── positively regulated by │ │ │ └── has necessary component activity │ │ └── causally upstream of or within │ │ ├── causally upstream of or within, negative effect │ │ ├── causally upstream of or within, positive effect │ │ │ └── transitively provides input for │ │ ├── occurrent_part_of │ │ └── regulates in other organism │ ├── causal relationship with disease as subject │ │ ├── disease causes dysfunction of │ │ └── disease disrupts │ ├── causes or contributes to condition │ │ ├── causes condition │ │ │ ├── is causal germline mutation in │ │ │ └── is causal somatic mutation in │ │ ├── contributes to condition │ │ │ ├── confers susceptibility to condition │ │ │ ├── contributes to frequency of condition │ │ │ ├── contributes to severity of condition │ │ │ │ ├── ameliorates condition │ │ │ │ └── exacerbates condition │ │ │ └── is causal germline mutation partially giving rise to │ │ ├── has allergic trigger │ │ ├── has autoimmune trigger │ │ ├── is allergic trigger for │ │ └── is autoimmune trigger for │ ├── condition ameliorated by │ ├── condition exacerbated by │ ├── condition has genetic basis in │ │ ├── has major susceptibility factor │ │ ├── has material basis in gain of function germline mutation in │ │ ├── has material basis in germline mutation in │ │ ├── has material basis in loss of function germline mutation in │ │ ├── has material basis in somatic mutation in │ │ └── has partial material basis in germline mutation in │ ├── is basis for realizable │ │ └── is genetic basis for condition │ │ ├── is causal gain of function germline mutation of in │ │ ├── is causal loss of function germline mutation of in │ │ └── is causal susceptibility factor for │ ├── is treated by substance │ ├── process has causal agent │ ├── realizable has basis in │ │ └── disease has basis in │ │ ├── disease arises from structure │ │ ├── disease caused by disruption of │ │ ├── disease has basis in dysfunction of │ │ └── disease has infectious agent │ │ ├── disease caused by reactivation of latent infectious agent │ │ └── disease has primary infectious agent │ ├── realized in response to │ ├── realized in response to stimulus │ ├── regulates characteristic │ │ ├── negatively regulates characteristic │ │ └── positively regulates characteristic │ └── related via exposure to │ ├── has exposure medium │ ├── has exposure receptor │ ├── has exposure route │ ├── has exposure stimulus │ │ └── has exposure stressor │ └── has exposure transport path ├── channel for ├── channels_from ├── channels_into ├── characteristic of ├── concretizes ├── concretizes ├── conditionality ├── conduit for ├── connects_on ├── contained in │ └── tracheates ├── contained_by ├── contains ├── contains ├── contains process ├── contains process ├── correlated with │ ├── correlated with condition │ └── is marker for ├── cross-species analog ├── deep to │ └── immediately deep to ├── denoted by ├── derives from part of │ └── derives from ├── derives into ├── derives_from ├── developmentally related to │ ├── developmentally preceded by │ │ ├── child nucleus of │ │ │ ├── child nucleus of in hermaphrodite │ │ │ └── child nucleus of in male │ │ ├── developmentally induced by │ │ ├── developmentally replaces │ │ ├── develops in │ │ ├── develops_from │ │ │ ├── develops_directly_from │ │ │ │ └── immediate transformation of │ │ │ ├── develops_from_part_of │ │ │ └── transformation of │ │ └── has developmental contribution from │ ├── has developmental potential involving │ │ ├── developmentally succeeded by │ │ │ └── part of developmental precursor of │ │ ├── has potential to develop into │ │ │ ├── develops_into │ │ │ │ └── directly develops into │ │ │ └── has potential to directly develop into │ │ ├── has potential to developmentally contribute to │ │ │ └── developmentally contributes to │ │ └── has potential to developmentally induce │ │ └── developmentally induces │ └── results in developmental progression of │ ├── results in acquisition of features of │ ├── results in commitment to │ ├── results in determination of │ ├── results in development of │ ├── results in developmental induction of │ ├── results in growth of │ ├── results in maturation of │ ├── results in morphogenesis of │ ├── results in specification of │ └── results in structural organization of ├── develops_from ├── develops_in ├── develops_into ├── device utilizes material ├── different in magnitude relative to │ ├── decreased in magnitude relative to │ └── increased in magnitude relative to ├── differs in │ ├── differs in attribute │ └── differs in attribute of ├── disconnected_from ├── disease causes feature ├── disease has basis in accumulation of ├── disease relationship │ ├── disease has feature │ │ └── disease has major feature │ └── disease has location │ └── disease has inflammation site ├── disease responds to ├── disease shares features of ├── disease triggers ├── disease_has_basis_in_development_of ├── distal to │ ├── immediately distal to │ └── proximally connected to ├── dorsal to │ └── immediately dorsal to ├── dorsal_to ├── during ├── during ├── ecologically related to │ ├── confers advantage in │ ├── creates habitat for │ ├── ecologically co-occurs with │ │ └── co-roosts with │ ├── has habitat │ └── transmitted by ├── edited_from ├── edited_to ├── encircles ├── ends_at ├── evidence_for_feature │ ├── complete_evidence_for_feature │ └── partial_evidence_for_feature ├── evolutionarily related to │ ├── derived by descent from │ │ └── derived from ancestral fusion of │ ├── evolutionary variant of │ ├── has derived by descendant │ ├── in taxon │ │ └── only in taxon │ ├── serially homologous to │ └── shares ancestor with │ └── sexually_homologous_to ├── exclusive_union_of ├── executes ├── exemplar_of ├── exists_during ├── exists_during ├── filtered through ├── finished_by ├── finishes ├── finishes axis ├── follows axis ├── functionally related to │ ├── biomechanically related to │ │ └── has muscle antagonist │ ├── capable of part of │ │ └── capable of │ │ └── enables │ ├── enables subfunction │ ├── has part structure that is capable of │ ├── involved in or involved in regulation of │ │ └── involved in regulation of │ │ ├── involved in negative regulation of │ │ └── involved in positive regulation of │ ├── is active in │ ├── part of structure that is capable of │ │ └── contributes to │ └── regulates levels of ├── fused with ├── gained ├── generated from ├── generates ├── generically depends on ├── genome_of ├── genomically related to │ ├── expressed in │ │ ├── over-expressed in │ │ ├── ubiquitously expressed in │ │ └── under-expressed in │ ├── expresses │ │ ├── cell expresses │ │ └── ubiquitously expresses │ ├── gene product of │ ├── has gene product │ ├── ribosomal translation of │ ├── ribosomally translates to │ ├── transcribed from │ └── transcribed to ├── guided_by ├── guides ├── haplotype member of ├── happens_during ├── has assay target context ├── has axis ├── has characteristic ├── has characterizing marker set ├── has consumer ├── has cross section ├── has disposition to bind ├── has driver │ └── has disease driver ├── has end point ├── has food substance analog ├── has functional parent ├── has major microspecies at pH 7.3 ├── has model ├── has modifier ├── has onset ├── has organization member ├── has parent hydride ├── has part ├── has part that occurs in │ ├── has end location │ ├── has start location │ └── occurs across │ └── results in transport across ├── has participant │ ├── acts on population of │ ├── acts_on_population_of │ ├── enabled by │ ├── has component participant │ ├── has input │ │ ├── has direct input │ │ ├── has ligand │ │ ├── has primary input │ │ ├── results in breakdown of │ │ │ └── results in catabolism of │ │ └── results in remodeling of │ ├── has intermediate │ ├── has output │ │ ├── has primary output │ │ └── results in formation of │ │ ├── results in assembly of │ │ └── results in synthesis of │ ├── has performer │ ├── has primary input or output │ ├── has small molecule regulator │ │ ├── has small molecule activator │ │ └── has small molecule inhibitor │ ├── has_specified_input │ ├── has_specified_output │ ├── results in changes to anatomical or cellular structure │ │ ├── results in adhesion of │ │ ├── results in closure of │ │ ├── results in ending of │ │ │ ├── results in developmental regression of │ │ │ └── results in disappearance of │ │ ├── results in movement of │ │ └── transports or maintains localization of │ │ └── transports │ │ ├── exports │ │ └── imports │ ├── results in division of │ ├── results in fission of │ └── results in organization of │ ├── results in disassembly of │ ├── results in fusion of │ └── results in maintenance of ├── has participant │ ├── enabled by │ ├── has specified input │ └── has specified output ├── has phenotype affecting │ └── depends on │ ├── characteristic of │ │ ├── disposition of │ │ ├── function of │ │ ├── quality of │ │ └── role of │ ├── characteristic of part of │ ├── depends on structure │ └── towards ├── has phenotype or disease │ ├── has disease │ └── has phenotype │ ├── disease arises from feature │ └── has symptom ├── has plan ├── has prototype ├── has quality ├── has quality datum ├── has relative magnitude ├── has role in modeling ├── has start point ├── has substance added │ ├── has ingredient │ │ └── has defining ingredient │ └── has primary substance added ├── has substance removed ├── has-input ├── has_age ├── has_central_participant ├── has_condition ├── has_not_completed ├── has_onset_before ├── has_onset_during_or_after ├── has_origin ├── has_output ├── has_part ├── has_part │ └── has_integral_part ├── has_part ├── has_participant ├── has_quality ├── has_start ├── has_supplier ├── helper property (not for use in curation) │ └── interaction relation helper property │ ├── is symbiosis │ │ ├── is commensalism │ │ ├── is mutualism │ │ └── is parasitism │ └── molecular interaction relation helper property │ ├── is kinase activity │ ├── is myristoyltransferase activity │ └── is ubiquitination ├── http://purl.obolibrary.org/obo/BFO_0000056 ├── http://purl.obolibrary.org/obo/BFO_0000070 ├── http://purl.obolibrary.org/obo/HANCESTRO_0308 ├── http://purl.obolibrary.org/obo/HAO#_attached_to ├── http://purl.obolibrary.org/obo/OArCS#_gives_rise ├── http://purl.obolibrary.org/obo/OBO_REL_0000004 ├── http://purl.obolibrary.org/obo/STATO_0000102 ├── http://purl.obolibrary.org/obo/TO_has_dividend_quality ├── http://purl.obolibrary.org/obo/TO_has_divisor_quality ├── http://purl.obolibrary.org/obo/bspo#parallel_to ├── http://purl.obolibrary.org/obo/envo#has_increased_levels_of ├── http://purl.obolibrary.org/obo/fypo#qualifier ├── http://purl.obolibrary.org/obo/mpath#part_of ├── http://purl.obolibrary.org/obo/peco#part_of ├── http://purl.obolibrary.org/obo/po#derives_by_manipulation_from ├── http://purl.obolibrary.org/obo/pr#confers_resistance_to ├── http://purl.obolibrary.org/obo/pr#has_constituent_monomer ├── http://purl.obolibrary.org/obo/pr#has_gene_template ├── http://purl.obolibrary.org/obo/pr#lacks_part ├── http://purl.obolibrary.org/obo/pr#non-covalently_bound_to ├── http://purl.obolibrary.org/obo/wbphenotype/wbphenotype-equivalent-axioms-subq#during ├── http://purl.obolibrary.org/obo/wbphenotype/wbphenotype-equivalent-axioms-subq#ends_during_or_before ├── http://purl.obolibrary.org/obo/wbphenotype/wbphenotype-equivalent-axioms-subq#has_quality ├── http://purl.obolibrary.org/obo/wbphenotype/wbphenotype-equivalent-axioms-subq#in_response_to ├── http://purl.obolibrary.org/obo/wbphenotype/wbphenotype-equivalent-axioms-subq#starts_during_or_after ├── http://translator.renci.org/ubergraph-axioms.ofn#decreasedAmountRole ├── http://translator.renci.org/ubergraph-axioms.ofn#increasedAmountRole ├── http://www.geneontology.org/formats/oboInOwl#ObsoleteProperty │ ├── obsolete_describes │ ├── obsolete_has_function │ ├── obsolete_has_quality │ ├── obsolete_has_role │ ├── obsolete_is_concretization_of │ ├── obsolete_is_concretized_as │ ├── obsolete_is_described_by │ ├── obsolete_is_realized_by │ ├── obsolete_materially denotes │ ├── obsolete_realizes │ ├── obsolete_represents │ ├── obsolete_results_from │ ├── obsolete_specifically denotes │ ├── obsoleted_has_specified_input_information │ ├── obsoleted_has_specified_output_information │ ├── obsoleted_is_device_for │ ├── obsoleted_is_reagent_in │ ├── obsoleted_is_specified_information_intput_of │ ├── obsoleted_is_specified_information_output_of │ ├── obsoleted_utilizes_device │ └── obsoleted_utilizes_reagent ├── immersed in ├── in similarity relationship with │ ├── in functional equivalence relationship with │ ├── in homocracy relationship with │ │ ├── in deep homology relationship with │ │ ├── in paramorphism relationship with │ │ └── in syngeny relationship with │ ├── in homology relationship with │ │ ├── in biological homology relationship with │ │ │ ├── in heterochronous homology relationship with │ │ │ │ ├── in paedomorphorsis relationship with │ │ │ │ │ ├── in neoteny relationship with │ │ │ │ │ ├── in postdisplacement relationship with │ │ │ │ │ └── in progenesis relationship with │ │ │ │ └── in peramorphosis relationship with │ │ │ │ └── in hypermorphosis relationship with │ │ │ ├── in homeosis relationship with │ │ │ └── in iterative homology relationship with │ │ │ └── in serial homology relationship with │ │ ├── in historical homology relationship with │ │ │ ├── in 1 to 1 homology relationship with │ │ │ │ └── in apparent orthology relationship with │ │ │ ├── in 1 to many homology relationship with │ │ │ ├── in apomorphy relationship with │ │ │ ├── in chromosomal homology relationship with │ │ │ │ └── in gametology relationship with │ │ │ ├── in equivalogy relationship with │ │ │ ├── in hemiplasy relationship with │ │ │ ├── in interology relationship with │ │ │ ├── in many to many homology relationship with │ │ │ ├── in orthology relationship with │ │ │ │ ├── in 1 to 1 orthology relationship with │ │ │ │ ├── in 1 to many orthology relationship with │ │ │ │ │ ├── in pro-orthology relationship with │ │ │ │ │ └── in semi-orthology relationship with │ │ │ │ ├── in isoorthology relationship with │ │ │ │ └── in many to many orthology relationship with │ │ │ ├── in paralogy relationship with │ │ │ │ ├── in between-species paralogy relationship with │ │ │ │ ├── in in-paralogy relationship with │ │ │ │ ├── in ohnology relationship with │ │ │ │ │ └── in homoeology relationship with │ │ │ │ ├── in out-paralogy relationship with │ │ │ │ ├── in plerology relationship with │ │ │ │ ├── in tandem paralogy relationship with │ │ │ │ └── in within-species paralogy relationship with │ │ │ ├── in plesiomorphy relationship with │ │ │ ├── in regulogy relationship with │ │ │ └── in xenology relationship with │ │ │ ├── in paraxenology relationship with │ │ │ ├── in pseudoparalogy relationship with │ │ │ └── in synology relationship with │ │ └── in structural homology relationship with │ │ ├── in homotopy relationship with │ │ ├── in non functional homology relationship with │ │ ├── in partial homology relationship with │ │ ├── in protein structural homology relationship with │ │ └── in syntenic homology relationship with │ │ ├── in syntenic orthology relationship with │ │ └── in syntenic paralogy relationship with │ └── in homoplasy relationship with │ ├── in convergence relationship with │ │ └── in mimicry relationship with │ ├── in parallelism relationship with │ │ └── in latent homology relationship with │ └── in reversal relationship with ├── in_response_to ├── indirectly_supplies ├── innervated_by ├── innervates ├── intended plan process type ├── intended to realize ├── interacts with │ ├── biotically interacts with │ │ ├── participates in a abiotic-biotic interaction with │ │ └── participates in a biotic-biotic interaction with │ │ ├── allelopath of │ │ ├── has vector │ │ ├── is killed by │ │ ├── is vector for │ │ ├── kills │ │ ├── symbiotically interacts with │ │ │ ├── commensually interacts with │ │ │ ├── epiphyte of │ │ │ ├── has epiphyte │ │ │ ├── has host │ │ │ │ ├── hyperparasite of │ │ │ │ └── pathogen of │ │ │ ├── host of │ │ │ │ ├── has pathogen │ │ │ │ └── hyperparasitized by │ │ │ ├── interacts with via parasite-host interaction │ │ │ │ ├── parasite of │ │ │ │ │ ├── ectoparasite of │ │ │ │ │ ├── endoparasite of │ │ │ │ │ │ ├── intercellular endoparasite of │ │ │ │ │ │ └── intracellular endoparasite of │ │ │ │ │ ├── facultative parasite of │ │ │ │ │ ├── hemiparasite of │ │ │ │ │ ├── kleptoparasite of │ │ │ │ │ ├── lays eggs in │ │ │ │ │ ├── mesoparasite of │ │ │ │ │ ├── obligate parasite of │ │ │ │ │ ├── parasitoid of │ │ │ │ │ ├── root parasite of │ │ │ │ │ └── stem parasite of │ │ │ │ └── parasitized by │ │ │ │ ├── has ectoparasite │ │ │ │ ├── has eggs laid in by │ │ │ │ ├── has endoparasite │ │ │ │ │ ├── has intercellular endoparasite │ │ │ │ │ └── has intracellular endoparasite │ │ │ │ ├── has mesoparasite │ │ │ │ ├── has parasitoid │ │ │ │ └── kleptoparasitized by │ │ │ └── mutualistically interacts with │ │ │ ├── pollinated by │ │ │ └── pollinates │ │ ├── trophically interacts with │ │ │ ├── acquires nutrients from │ │ │ ├── eats │ │ │ ├── is eaten by │ │ │ ├── preyed upon by │ │ │ ├── preys on │ │ │ └── provides nutrients for │ │ ├── visited by │ │ │ ├── has eggs laid on by │ │ │ └── has flowers visited by │ │ └── visits │ │ ├── lays eggs on │ │ └── visits flowers of │ ├── genetically interacts with │ └── molecularly interacts with │ ├── directly regulates activity of │ │ ├── directly negatively regulates activity of │ │ │ ├── is antagonist of │ │ │ ├── is inverse agonist of │ │ │ └── represses expression of │ │ └── directly positively regulates activity of │ │ ├── increases expression of │ │ └── is agonist of │ ├── myristoylates │ ├── phosphorylates │ └── ubiquitinates ├── ipsilateral to ├── is about ├── is about │ ├── denotes │ ├── is duration of │ ├── is quality measurement of │ ├── is quality specification of │ ├── mentions │ ├── quality datum of │ └── specifies value of ├── is carrier of ├── is concretized as ├── is concretized as ├── is conjugate acid of ├── is conjugate base of ├── is decrease of ├── is enantiomer of ├── is increase of ├── is member of organization ├── is or was part of ├── is quality measured as ├── is substituent group from ├── is synthetic protein mutant of ├── is tautomer of ├── is_a ├── is_about ├── is_consecutive_sequence_of ├── is_manufactured_by ├── is_proxy_for ├── is_supported_by_data ├── lacks_part ├── lacks_plasma_membrane_part ├── lateral to ├── lateral_to ├── left of │ └── immediately left of ├── located in ├── located_in ├── located_in ├── location of ├── lost ├── maximally_overlaps ├── medial_to ├── mentioned by ├── mereotopologically related to │ ├── 2D boundary of │ ├── attached_to_part_of │ ├── coincident with │ ├── colocalizes with │ ├── connected_to │ │ ├── attached_to │ │ │ ├── has muscle insertion │ │ │ └── has muscle origin │ │ ├── connecting branch of │ │ ├── distributary of │ │ │ ├── anabranch of │ │ │ └── proper distributary of │ │ ├── drains │ │ ├── electrically_synapsed_to │ │ ├── extends_fibers_into │ │ ├── receives_input_from │ │ │ └── synapsed by │ │ │ ├── receives_synaptic_input_from_neuron │ │ │ ├── synapsed_by_via_type_III_bouton │ │ │ ├── synapsed_by_via_type_II_bouton │ │ │ ├── synapsed_by_via_type_Ib_bouton │ │ │ └── synapsed_by_via_type_Is_bouton │ │ ├── sends output to │ │ │ └── synapsed to │ │ │ ├── sends_synaptic_output_to_cell │ │ │ ├── synapsed_via_type_III_bouton_to │ │ │ ├── synapsed_via_type_II_bouton_to │ │ │ ├── synapsed_via_type_Ib_bouton_to │ │ │ └── synapsed_via_type_Is_bouton_to │ │ ├── supplies │ │ └── tributary of │ │ └── proper tributary of │ ├── connects │ ├── continuous_with │ │ ├── encircled by │ │ │ └── encircled via conjunctiva │ │ └── encircles │ │ └── encircles via conjunctiva │ ├── has 2D boundary │ ├── in branching relationship with │ │ ├── branching part of │ │ ├── has branching part │ │ ├── has connecting branch │ │ └── main stem of │ ├── in register with │ ├── overlaps │ │ ├── conduit for │ │ ├── contributes to morphology of │ │ ├── fasciculates_with │ │ ├── has dendrite location │ │ │ └── has_sensory_dendrite_in │ │ ├── has part │ │ │ ├── composed_primarily_of │ │ │ ├── has active ingredient │ │ │ ├── has category label │ │ │ ├── has component │ │ │ │ └── has component process │ │ │ │ └── has component activity │ │ │ │ └── has effector activity │ │ │ ├── has coordinate unit label │ │ │ ├── has grain │ │ │ ├── has measurement datum │ │ │ ├── has measurement unit label │ │ │ ├── has member │ │ │ ├── has plasma membrane part │ │ │ │ ├── has high plasma membrane amount │ │ │ │ └── has low plasma membrane amount │ │ │ ├── has skeleton │ │ │ ├── has time stamp │ │ │ ├── has value specification │ │ │ ├── has visible part │ │ │ └── provides_service_consumer_with │ │ ├── has synaptic terminal in │ │ │ ├── has postsynaptic terminal in │ │ │ │ └── dendrite synapsed in │ │ │ ├── has presynaptic terminal in │ │ │ │ └── axon synapses in │ │ │ └── has_synaptic_IO_in │ │ │ ├── has_synaptic_IO_throughout │ │ │ ├── receives_synaptic_input_in_region │ │ │ │ └── receives_synaptic_input_throughout │ │ │ └── sends_synaptic_output_to_region │ │ │ └── sends_synaptic_output_throughout │ │ ├── has synaptic terminal of │ │ ├── has_fasciculating_neuron_projection │ │ ├── has_soma_location │ │ ├── overlaps sequence of │ │ ├── part of │ │ │ ├── active ingredient in │ │ │ ├── bounding layer of │ │ │ ├── in anterior side of │ │ │ │ └── anteriormost part of │ │ │ ├── in central side of │ │ │ ├── in deep part of │ │ │ ├── in distal side of │ │ │ │ └── distalmost part of │ │ │ ├── in dorsal side of │ │ │ │ └── dorsalmost part of │ │ │ ├── in lateral side of │ │ │ │ ├── in left side of │ │ │ │ ├── in right side of │ │ │ │ ├── in_innermost_side_of │ │ │ │ ├── in_outermost_side_of │ │ │ │ └── lateralmost part of │ │ │ ├── in medial side of │ │ │ │ └── medialmost part of │ │ │ ├── in posterior side of │ │ │ ├── in proximal side of │ │ │ │ └── proximalmost part of │ │ │ ├── in superficial part of │ │ │ ├── in ventral side of │ │ │ ├── intersects midsagittal plane of │ │ │ ├── is grain of │ │ │ ├── layer part of │ │ │ ├── lumen of │ │ │ │ └── luminal space of │ │ │ ├── member of │ │ │ ├── postaxialmost part of │ │ │ ├── preaxialmost part of │ │ │ ├── skeleton of │ │ │ ├── subcluster of │ │ │ ├── trunk_part_of │ │ │ └── visible part of │ │ ├── partially_overlaps │ │ └── spatially coextensive with │ └── spatially disjoint from │ └── adjacent to │ ├── surrounded by │ └── surrounds ├── morphology ├── myristoylated by ├── objective_achieved_by ├── obsolete actively participates in ├── obsolete alters location of ├── obsolete correlates_with ├── obsolete decreased_in_magnitude_relative_to ├── obsolete determined by ├── obsolete determined by part of ├── obsolete different_in_magnitude_relative_to ├── obsolete directly activates ├── obsolete directly inhibits ├── obsolete directly_associated_with ├── obsolete downstream in neural circuit with ├── obsolete has active participant ├── obsolete has direct output ├── obsolete has indirect input ├── obsolete has indirect output ├── obsolete has intermediate ├── obsolete has member of ├── obsolete has_cross_section ├── obsolete has_dividend_entity ├── obsolete has_dividend_quality ├── obsolete has_divisor_entity ├── obsolete has_divisor_quality ├── obsolete has_function_in ├── obsolete has_function_in_part_of ├── obsolete has_high_plasma_membrane_amount ├── obsolete has_low_plasma_membrane_amount ├── obsolete has_ratio_quality ├── obsolete has_relative_magnitude ├── obsolete in neural circuit with ├── obsolete increased_in_magnitude_relative_to ├── obsolete inversely_associated_with ├── obsolete is_magnitude_of ├── obsolete is_measurement_of ├── obsolete is_unit_of ├── obsolete preceded by ├── obsolete realized_by ├── obsolete reciprocal_of ├── obsolete related via dependence to ├── obsolete releases_neurotransmitter ├── obsolete results_in_assembly_of ├── obsolete results_in_connection_of ├── obsolete results_in_disassembly_of ├── obsolete results_in_organization_of ├── obsolete results_in_remodeling_of ├── obsolete results_in_transport_through ├── obsolete secretes_hormone ├── obsolete similar_in_magnitude_relative_to ├── obsolete singly_occurring_form_of ├── obsolete surrounded_by ├── obsolete surrounds ├── obsolete towards ├── obsolete upstream in neural circuit with ├── occurs in ├── occurs in ├── occurs_at ├── opposite to │ └── contralateral to ├── oral to ├── orthogonal to ├── output_of ├── overlaps ├── parallel to ├── part of ├── part of ├── part of progression of disease ├── part_of ├── part_of │ ├── integral_part_of │ └── member_of ├── part_of ├── partially_surrounded_by ├── participates in │ ├── input of │ ├── involved in │ ├── is_specified_input_of │ ├── is_specified_output_of │ ├── output of │ │ └── formed as result of │ └── partner in │ ├── subject participant in │ └── target participant in ├── participates in │ ├── is specified input of │ └── is specified output of ├── passes through ├── phenotype of ├── position_of ├── postaxial to ├── posterior to │ ├── anteriorly connected to │ └── immediately posterior to ├── posterior_to │ └── posterolateral_to ├── posterodorsal to ├── posteroventral to ├── preaxial to ├── preceded_by ├── precedes ├── predisposes towards ├── processed_from ├── processed_into ├── produced by ├── produces ├── protects ├── provisions ├── proximal to │ ├── distally connected to │ └── immediately proximal to ├── qualifier ├── quality is specified as ├── realized in ├── realized in ├── realizes ├── realizes ├── reciprocal of ├── recombined_from ├── recombined_to ├── regulates transport of ├── related via evidence or inference to │ ├── has evidence │ ├── is evidence for │ └── is evidence with support from ├── related via localization to │ ├── results in transport along │ └── results in transport to from or in │ ├── has target end location │ └── has target start location ├── relation between physical entity and a process or stage │ ├── existence ends during or before │ │ ├── existence ends at start of │ │ └── existence ends during │ │ └── existence ends with │ ├── existence overlaps │ └── existence starts during or after │ ├── existence starts at end of │ └── existence starts during │ ├── existence starts and ends during │ └── existence starts with ├── releases neurotransmitter ├── results from ├── results in ├── results in distribution of ├── results in expansion of ├── results in proliferation of ├── results in transformation into ├── results_in_fusion_of ├── right of │ └── immediately right of ├── sequence_of ├── sequentially related to │ ├── bounds sequence of │ │ └── has subsequence │ │ ├── has end sequence │ │ ├── has start sequence │ │ └── is consecutive sequence of │ ├── does not overlap sequence of │ │ ├── is downstream of sequence of │ │ ├── is upstream of sequence of │ │ └── sequentially adjacent to │ │ ├── is immediately downstream of sequence of │ │ └── is immediately upstream of sequence of │ ├── is bound by sequence of │ │ └── is subsequence of │ │ ├── is end sequence of │ │ └── is start sequence of │ └── is sequentially aligned with ├── serotype member of ├── similar in magnitude relative to ├── similar_to │ └── homologous_to │ ├── non_functional_homolog_of │ ├── orthologous_to │ └── paralogous_to ├── site_of ├── started_by ├── starts ├── starts axis ├── starts_at ├── subdivision of ├── superficial to │ └── immediately superficial to ├── surface of ├── synapsed by ├── temporally related to │ ├── before or simultaneous with │ │ ├── before │ │ └── simultaneous with │ ├── during which ends │ ├── during which starts │ │ └── encompasses │ ├── ends │ ├── ends after │ │ └── preceded by │ │ ├── causally downstream of │ │ └── immediately preceded by │ │ ├── immediately causally downstream of │ │ └── process is result of │ ├── ends during │ ├── ends with │ ├── precedes │ │ ├── causally upstream of │ │ │ ├── causally upstream of, negative effect │ │ │ │ └── removes input for │ │ │ ├── causally upstream of, positive effect │ │ │ │ └── constitutively upstream of │ │ │ ├── indirectly causally upstream of │ │ │ │ └── indirectly regulates │ │ │ └── regulates │ │ │ ├── negatively regulates │ │ │ │ └── indirectly negatively regulates │ │ │ └── positively regulates │ │ │ └── indirectly positively regulates │ │ └── immediately precedes │ │ └── immediately causally upstream of │ │ ├── directly regulates │ │ │ ├── directly negatively regulates │ │ │ └── directly positively regulates │ │ └── provides input for │ ├── starts │ ├── starts before │ ├── starts during │ │ └── happens during │ │ └── substage_of │ └── starts with ├── therapeutic uses ├── trans_spliced_from ├── trans_spliced_to ├── transcribed_from ├── transcribed_to ├── transitively anteriorly connected to ├── transitively distally connected to ├── transitively proximally connected to ├── transitively_connected to ├── translates_to ├── translation_of ├── used_in ├── uses ├── variant_of ├── ventral to │ └── immediately ventral to ├── ventral_to └── vicinity of ```

Now to my questions:

  1. What is the root node of the ubergraph property ontology? I tried a few SPARQL queries and it seems there is none, but would it not be useful to have one?
  2. What is the most elegant way to get a similar object like I showed in the last collapsible?
  3. I think about 50% of the nodes are children of the root. Are you working on a smart scheme to introduce more clustering?
balhoff commented 1 year ago

Hi, there is no explicit root node of the property hierarchy. Ubergraph is dependent on what the source ontology authors have stated in their ontologies, so the simple answer is that we just reflect the axioms that are provided. But I don't think adding a root property above the existing ones would add a useful feature. Currently you can see if there is any property between two classes using a property variable, although it is true that you can't use variables in SPARQL property paths.

I think there are a few issues with your hierarchy algorithm:

OAK has some nice features for visualizing ontology graphs. I'm not sure how well it works for property hierarchies, but you may be able to pretend the terms are classes well enough to get a visualization.

One way to reduce the properties directly under the root would be to filter out obsolete properties (these will never have a parent). You can use owl:deprecated false. Otherwise adding hierarchy would involve working with the source ontologies, such as OBO Relation Ontology.

cmungall commented 1 year ago

OAK has decent RBox support: https://github.com/INCATools/ontology-access-kit/pull/466

however, this works best with the sqlite backend. It shouldn't be so hard to extend to ubergraph.

raven44099 commented 1 year ago

Thanks, @balhoff your comments all make sense. Especially the explanation of owl:topObjectProperty and owl:deprecated false helped me a lot! Anyhow, I am not bent on using my previous algorithm, so I thought to use now OAK to retrieve the set of ubergraph owl:OjectProperty:

!pip install oaklib
from oaklib.implementations import UbergraphImplementation
oi  =  UbergraphImplementation()
ubergraph_predicates = oi.relationships(predicates=['rdfs:subPropertyOf']) #is generator object

for i, rel in enumerate(ubergraph_predicates):
  print(rel)

Regarding the statement:

[...] properties have multiple superproperties [...]

I would be interested to find more information about this. Doesn't this mean the property hierarchy is not a ontology?

raven44099 commented 1 year ago

Many thanks to @cmungall, too, for all the interlinks and recognition. I'd like to improve the code, however, I have not sufficient experience at this point. With such amazing support this seems to change soon.

balhoff commented 1 year ago

Regarding the statement:

[...] properties have multiple superproperties [...]

I would be interested to find more information about this. Doesn't this mean the property hierarchy is not a ontology?

It's normal for classes and properties in OWL to have multiple parents. @cmungall wrote a blog post about inheritance here: https://douroucouli.wordpress.com/2019/05/10/ontotip-single-inheritance-principle-considered-dangerous/

raven44099 commented 1 year ago

It's normal for classes and properties in OWL to have multiple parents. @cmungall wrote a blog post about inheritance here: https://douroucouli.wordpress.com/2019/05/10/ontotip-single-inheritance-principle-considered-dangerous/

This reference blog explains it to the point! Many thanks!

raven44099 commented 1 year ago

Using:

from oaklib.utilities.obograph_utils import graph_to_image, default_stylemap_path
from IPython.display import Image

stylemap        = default_stylemap_path()
ubergraph_graph = oi.relationships_to_graph(ubergraph_predicates)
graph_to_image(ubergraph_graph, stylemap=stylemap, imgfile='xx.png')

Image('xx.png')

I get: ubergraph_graph_DS

This graph is amazing and would be great to work with if I could change the resolution! Moreover, a legend would be useful (even though I can look it up here: /src/oaklib/conf/obograph-style.json). Strangely, there is currently no result when I search graph_to_image() in the docs, I can only find it on github.

Further comments: I receive 1260 relations, even more than with the initial algorithm, which was said to contain depricated relations. In a next step I want to remove them, but .obsoletes() returns me the entities. I would appreciate an insider comment on this matter.

balhoff commented 1 year ago

@raven44099 have you tried requesting a PDF as your imgfile name? I have no idea if that works.

raven44099 commented 1 year ago

@raven44099 have you tried requesting a PDF as your imgfile name? I have no idea if that works.

@balhoff Unfortunately running this (graph_to_image(ubergraph_graph, stylemap=stylemap, imgfile='xx.pdf')) creates a PDF not possible to view in the browser or Foxit PDF Viewer.

For completeness of my last comment, there were many errors printed when running ubergraph_graph = oi.relationships_to_graph(ubergraph_predicates). But like that, the png was created.

output

``` WARNING:root:Not a curie: so#SOFA WARNING:root:Not a curie: mi#RESID-name WARNING:root:Not a curie: ecto#mrex WARNING:root:CURIE should not contain double colons: ['uberon/core#BRAIN', 'NAME', 'ABV'] WARNING:root:CURIE should not contain double colons: ['fbbt#high', 'level', 'annotation', 'qc'] WARNING:root:Not a curie: FBcv#camcur WARNING:root:Not a curie: mi#UniMod-label WARNING:root:Not a curie: envo#envoCmecs WARNING:root:CURIE should not contain double colons: ['fbcv#do', 'not', 'annotate'] WARNING:root:CURIE should not contain double colons: ['wbphenotype#phenotype', 'slim', 'wb'] WARNING:root:CURIE should not contain double colons: ['go#chebi', 'ph7', '3'] WARNING:root:Not a curie: mi#UniMod-description WARNING:root:CURIE should not contain double colons: ['uberon/core#sexually', 'homologous', 'to'] WARNING:root:CURIE should not contain double colons: ['mondo#n', 'of', 'one'] WARNING:root:Not a curie: uberon/core#cumbo WARNING:root:Not a curie: zfa#PLURAL WARNING:root:Not a curie: fbbt#cur WARNING:root:Not a curie: fbbt#FlyTed WARNING:root:CURIE should not contain double colons: ['go#syngo', 'official', 'label'] WARNING:root:Not a curie: uberon#PLURAL WARNING:root:Not a curie: ncbitaxon#acronym WARNING:root:CURIE should not contain double colons: ['eco#valid', 'with', 'biological', 'process'] WARNING:root:CURIE should not contain double colons: ['uberon/core#transitively', 'proximally', 'connected', 'to'] WARNING:root:CURIE should not contain double colons: ['eco#valid', 'with', 'transcript'] WARNING:root:CURIE should not contain double colons: ['fbbt#BRAIN', 'NAME', 'ABV'] WARNING:root:CURIE should not contain double colons: ['mondo#implicit', 'genetic', 'in', 'ordo'] WARNING:root:CURIE should not contain double colons: ['eco#valid', 'with', 'protein', 'complex'] WARNING:root:Not a curie: ncbitaxon#misnomer WARNING:root:Not a curie: envo#envoOmics WARNING:root:CURIE should not contain double colons: ['fbbt#syngo', 'official', 'label'] WARNING:root:Not a curie: envo#PLURAL WARNING:root:Not a curie: envo#envoPolar WARNING:root:Not a curie: uberon/core#SENSU WARNING:root:Not a curie: mi#PSI-MOD-short WARNING:root:Not a curie: envo#envoEmpo WARNING:root:CURIE should not contain double colons: ['fypo#qc', 'do', 'not', 'annotate'] WARNING:root:CURIE should not contain double colons: ['fbbt#TL', 'lineage', 'clone'] WARNING:root:CURIE should not contain double colons: ['mondo#do', 'inheritance', 'inconsistent'] WARNING:root:Not a curie: fbbt#BrainName WARNING:root:CURIE should not contain double colons: ['fbcv#do', 'not', 'manually', 'annotate'] WARNING:root:CURIE should not contain double colons: ['valid', 'for', 'go', 'gp2term'] WARNING:root:Not a curie: mi#PSI-MI-alternate WARNING:root:CURIE should not contain double colons: ['uberon/core#defined', 'by', 'ordinal', 'series'] WARNING:root:CURIE should not contain double colons: ['mondo#ordo', 'biological', 'anomaly'] WARNING:root:Not a curie: hp#abbreviation WARNING:root:Not a curie: chebi#INN WARNING:root:Not a curie: so#BS WARNING:root:CURIE should not contain double colons: ['so#complete', 'evidence', 'for', 'feature'] WARNING:root:Not a curie: mi#UniProt-feature WARNING:root:Not a curie: fbcv#cur WARNING:root:Not a curie: ncbitaxon#misspelling WARNING:root:Not a curie: mondo#metaclass WARNING:root:Not a curie: mondo#clingen WARNING:root:Not a curie: fbbt#FORMULA WARNING:root:Not a curie: fbcv#EmbDevSlim WARNING:root:Not a curie: fbcv#FORMULA WARNING:root:Not a curie: envo#envoAtmo WARNING:root:Not a curie: envo#envoNceas WARNING:root:Not a curie: fbbt#SMILES WARNING:root:Not a curie: fbbt#INN WARNING:root:CURIE should not contain double colons: ['uberon/core#trunk', 'part', 'of'] WARNING:root:CURIE should not contain double colons: ['fbbt#gocheck', 'do', 'not', 'manually', 'annotate'] WARNING:root:Not a curie: ncbitaxon#teleomorph WARNING:root:CURIE should not contain double colons: ['valid', 'for', 'gocam'] WARNING:root:CURIE should not contain double colons: ['fbbt#mf', 'needs', 'review'] WARNING:root:CURIE should not contain double colons: ['uberon/core#human', 'reference', 'atlas'] WARNING:root:CURIE should not contain double colons: ['mondo#ordo', 'inheritance', 'inconsistent'] WARNING:root:Not a curie: t17991863 WARNING:root:Not a curie: so#VAR WARNING:root:CURIE should not contain double colons: ['uberon/core#in', 'innermost', 'side', 'of'] WARNING:root:Not a curie: mi#DeltaMass-label WARNING:root:Not a curie: uberon/core#DUBIOUS WARNING:root:CURIE should not contain double colons: ['mondo#disease', 'has', 'major', 'feature'] WARNING:root:CURIE should not contain double colons: ['mondo#ordo', 'clinical', 'situation'] WARNING:root:CURIE should not contain double colons: ['uberon/core#transitively', 'distally', 'connected', 'to'] WARNING:root:Not a curie: bspo#vertebrate WARNING:root:CURIE should not contain double colons: ['mondo#ordo', 'etiological', 'subtype'] WARNING:root:Not a curie: so#AGR WARNING:root:Not a curie: envo#envoMeo WARNING:root:CURIE should not contain double colons: ['mondo#ordo', 'clinical', 'subtype'] WARNING:root:CURIE should not contain double colons: ['fbbt#olfactory', 'system', 'draft'] WARNING:root:CURIE should not contain double colons: ['fbdv#gocheck', 'do', 'not', 'manually', 'annotate'] WARNING:root:Not a curie: mi#RESID-misnomer WARNING:root:CURIE should not contain double colons: ['uberon/core#posteriorly', 'connected', 'to'] WARNING:root:Not a curie: fbcv#SMILES WARNING:root:CURIE should not contain double colons: ['mondo#ordo', 'clinical', 'syndrome'] WARNING:root:CURIE should not contain double colons: ['mondo#ordo', 'histopathological', 'subtype'] WARNING:root:CURIE should not contain double colons: ['eco#valid', 'with', 'cellular', 'component'] WARNING:root:Not a curie: uberon#LATIN WARNING:root:CURIE should not contain double colons: ['mondo#ordo', 'malformation', 'syndrome'] WARNING:root:Not a curie: uberon/core#LATIN WARNING:root:CURIE should not contain double colons: ['fbbt#expressionslim', 'flybase', 'ribbon'] WARNING:root:Not a curie: ro/subsets#ro-eco WARNING:root:CURIE should not contain double colons: ['mondo#ordo', 'group', 'of', 'disorders'] WARNING:root:Not a curie: fbcv#deprecated WARNING:root:Not a curie: uberon/core#INCONSISTENT WARNING:root:Not a curie: mondo#EXCLUDE WARNING:root:Not a curie: fbcv#camcur WARNING:root:Not a curie: mondo#MISSPELLING WARNING:root:CURIE should not contain double colons: ['uberon/core#distally', 'connected', 'to'] WARNING:root:CURIE should not contain double colons: ['valid', 'for', 'go', 'ontology'] WARNING:root:CURIE should not contain double colons: ['uberon/core#defined', 'by', 'cytoarchitecture'] WARNING:root:CURIE should not contain double colons: ['cl#added', 'for', 'HCA'] WARNING:root:Not a curie: mi#PSI-MOD-alternate WARNING:root:CURIE should not contain double colons: ['fbdv#gocheck', 'do', 'not', 'annotate'] WARNING:root:CURIE should not contain double colons: ['ubprop#', 'upper', 'level'] WARNING:root:CURIE should not contain double colons: ['mondo#not', 'a', 'disease'] WARNING:root:CURIE should not contain double colons: ['uberon/core#proximally', 'connected', 'to'] WARNING:root:Not a curie: so#aa3 WARNING:root:Not a curie: uberon/core#ABBREVIATION WARNING:root:CURIE should not contain double colons: ['mondo#ordo', 'morphological', 'anomaly'] WARNING:root:CURIE should not contain double colons: ['uberon/core#inconsistent', 'with', 'fma'] WARNING:root:CURIE should not contain double colons: ['uberon/core#in', 'outermost', 'side', 'of'] WARNING:root:Not a curie: so#aa1 WARNING:root:Not a curie: fbbt#EmbDevSlim WARNING:root:Not a curie: mi#Drugable WARNING:root:Not a curie: cl#abbreviation WARNING:root:CURIE should not contain double colons: ['ncbitaxon#genbank', 'common', 'name'] WARNING:root:Not a curie: fbbt#InChIKey WARNING:root:Not a curie: uberon/core#MISSPELLING WARNING:root:Not a curie: mondo#DUBIOUS WARNING:root:Not a curie: so#dbsnp WARNING:root:CURIE should not contain double colons: ['go#gocheck', 'do', 'not', 'manually', 'annotate'] WARNING:root:Not a curie: fbbt#deprecated WARNING:root:Not a curie: ncbitaxon#synonym WARNING:root:Not a curie: so#dbvar WARNING:root:Not a curie: uberon/core#DEVELOPMENTAL WARNING:root:CURIE should not contain double colons: ['so#non', 'functional', 'homolog', 'of'] WARNING:root:CURIE should not contain double colons: ['uberon/core#added', 'for', 'HCA'] WARNING:root:CURIE should not contain double colons: ['so#partial', 'evidence', 'for', 'feature'] WARNING:root:Not a curie: envo#envoMarine WARNING:root:Not a curie: ncbitaxon#anamorph WARNING:root:CURIE should not contain double colons: ['uberon/core#unverified', 'taxonomic', 'grouping'] WARNING:root:CURIE should not contain double colons: ['fbcv#common', 'tool', 'use'] WARNING:root:CURIE should not contain double colons: ['go#gocheck', 'do', 'not', 'annotate'] WARNING:root:Not a curie: mp-edit#IMPC WARNING:root:Not a curie: uberon/core#DEPRECATED WARNING:root:Not a curie: envo#envoANZSoil WARNING:root:Not a curie: t13502079 WARNING:root:CURIE should not contain double colons: ['fypo#qc', 'do', 'not', 'manually', 'annotate'] WARNING:root:Not a curie: mondo#predisposition WARNING:root:CURIE should not contain double colons: ['go#goslim', 'flybase', 'ribbon'] WARNING:root:CURIE should not contain double colons: ['fbcv#BRAIN', 'NAME', 'ABV'] WARNING:root:Not a curie: uberon/core#PLURAL WARNING:root:Not a curie: envo#nlcd2011 WARNING:root:Not a curie: mi#UniMod-interim WARNING:root:Not a curie: bspo#human WARNING:root:Not a curie: envo#envoEOVs WARNING:root:CURIE should not contain double colons: ['uberon/core#extends', 'fibers', 'into'] WARNING:root:Not a curie: fbcv#FlyTed WARNING:root:Not a curie: mondo#AMBIGUOUS WARNING:root:CURIE should not contain double colons: ['eco#valid', 'with', 'protein'] WARNING:root:Not a curie: uberon/core#HOMOLOGY WARNING:root:Not a curie: so#RNAMOD WARNING:root:Not a curie: mondo#rare WARNING:root:CURIE should not contain double colons: ['fbbt#gocheck', 'do', 'not', 'annotate'] WARNING:root:CURIE should not contain double colons: ['so#has', 'integral', 'part'] WARNING:root:Not a curie: so#DBVAR WARNING:root:Not a curie: mondo#ABBREVIATION WARNING:root:Not a curie: envo#wwfBiome WARNING:root:Not a curie: envo#envoCesab WARNING:root:Not a curie: hp#layperson WARNING:root:Not a curie: so#biosapiens WARNING:root:CURIE should not contain double colons: ['eco#valid', 'with', 'chemical', 'entity'] WARNING:root:CURIE should not contain double colons: ['eco#valid', 'with', 'gene'] WARNING:root:Not a curie: mondo#speculative WARNING:root:Not a curie: mi#RESID-systematic WARNING:root:CURIE should not contain double colons: ['so#evidence', 'for', 'feature'] WARNING:root:Not a curie: fbbt#InChI WARNING:root:Not a curie: envo#envoPlastics WARNING:root:Not a curie: uberon/core#SYSTEMATIC WARNING:root:Not a curie: mondo#DEPRECATED WARNING:root:CURIE should not contain double colons: ['uberon/core#anteriorly', 'connected', 'to'] WARNING:root:CURIE should not contain double colons: ['so#Alliance', 'of', 'Genome', 'Resources'] WARNING:root:CURIE should not contain double colons: ['so#integral', 'part', 'of'] WARNING:root:Not a curie: envo#envoAstro WARNING:root:Not a curie: fbcv#InChIKey WARNING:root:CURIE should not contain double colons: ['eco#valid', 'with', 'molecular', 'function'] WARNING:root:Not a curie: fbcv#InChI WARNING:root:Not a curie: so#AAMOD WARNING:root:Not a curie: fbcv#INN WARNING:root:Not a curie: mi#RESID-alternate WARNING:root:CURIE should not contain double colons: ['uberon/core#transitively', 'anteriorly', 'connected', 'to'] WARNING:root:CURIE should not contain double colons: ['mondo#ordo', 'subtype', 'of', 'a', 'disorder'] WARNING:root:Not a curie: mi#UniMod-alternate WARNING:root:CURIE should not contain double colons: ['uberon/core#layer', 'part', 'of'] WARNING:root:Not a curie: envo#ro-eco WARNING:root:Not a curie: mi#PSI-MS-label WARNING:root:Not a curie: mi#PSI-MI-short WARNING:root:Not a curie: fbcv#RD WARNING:root:Not a curie: fbbt#RD WARNING:root:CURIE should not contain double colons: ['valid', 'for', 'go', 'annotation', 'extension'] WARNING:root:Not a curie: envo#EnvO-Lite-GSC ```

balhoff commented 1 year ago

@raven44099 I would suggest continuing in an issue over at the OAK repo, since I'm not a regular OAK user and you might get better support that way.

raven44099 commented 1 year ago

Ok, thanks a lot for your help and discussion! 💯

cmungall commented 1 year ago

I'm actually going to push this once back here briefly

I think the reason this previously worked was because OAK queries the http://reasoner.renci.org/nonredundant graph

I believe this used to include the RBox and this query would yield results

SELECT ?s ?p ?o  WHERE { GRAPH <http://reasoner.renci.org/nonredundant> { <http://purl.obolibrary.org/obo/BFO_0000050> ?p ?o } }

it's possible something changed in OAK about how the graph is retrieved however - but in any case, shouldn't the RBox be in the r and nr graphs?

raven44099 commented 1 year ago

I'm not a SPARQL expert, but BFO_0000050 is part_of and not owl:subPropertyOf. Moreover, I thought owl:subPropertyOf should be between ?p and ?o and not before.

I'm not sure how the code GRAPH <http://reasoner.renci.org/nonredundant> plays into the query, so using the function defined above (1st collapsible in issue opener), my SPARQL suggestion would be:

api_link = "https://ubergraph.apps.renci.org/sparql"
new_query = """
SELECT ?s ?p ?o  WHERE {   ?s rdfs:subPropertyOf ?o . }
"""
ret = query_SPARQL_api(new_query, api_link)

Anyway, I think it's not that relevant under this issue, since using oaklib is cleaner code.