geneontology / obographs

Basic and Advanced OBO Graphs: specification and reference implementation
63 stars 12 forks source link

Better annotate which graph is the "main" one when converting an OWL file #83

Open cthoyt opened 2 years ago

cthoyt commented 2 years ago

When I use ROBOT’s convert function to turn an ontology into OBO Graph JSON (which in turn is based on the code in this repository), how do I know which graph is the “main” graph?

E.g., I did robot convert -I http://www.bioassayontology.org/bao/bao_complete.owl -o test.json then the following in Python script to look at each graph’s URI (which is called an ID in the OBO Graph JSON schema)

import json
with open("test.json) as file:
    data = json.load(file)
for graph in data["graphs"]:
    print(graph["id"])

and got:

http://bioassayontology.org/bao/external/BAO_CHEBI_import.owl
http://www.bioassayontology.org/bao/bao+external.owl
http://www.bioassayontology.org/bao/bao_complete.owl
http://www.bioassayontology.org/bao/bao_core.owl
http://www.bioassayontology.org/bao/bao_metadata.owl
http://www.bioassayontology.org/bao/bao_module_biology.owl
http://www.bioassayontology.org/bao/bao_module_properties.owl
http://www.bioassayontology.org/bao/bao_module_vocabularies.owl
http://www.bioassayontology.org/bao/bao_vocabulary_assay.owl
http://www.bioassayontology.org/bao/bao_vocabulary_assaykit.owl
http://www.bioassayontology.org/bao/bao_vocabulary_biology.owl
http://www.bioassayontology.org/bao/bao_vocabulary_computational.owl
http://www.bioassayontology.org/bao/bao_vocabulary_detection.owl
http://www.bioassayontology.org/bao/bao_vocabulary_format.owl
http://www.bioassayontology.org/bao/bao_vocabulary_function.owl
http://www.bioassayontology.org/bao/bao_vocabulary_instrument.owl
http://www.bioassayontology.org/bao/bao_vocabulary_materialentity.owl
http://www.bioassayontology.org/bao/bao_vocabulary_method.owl
http://www.bioassayontology.org/bao/bao_vocabulary_organization.owl
http://www.bioassayontology.org/bao/bao_vocabulary_people.owl
http://www.bioassayontology.org/bao/bao_vocabulary_phenotype.owl
http://www.bioassayontology.org/bao/bao_vocabulary_properties.owl
http://www.bioassayontology.org/bao/bao_vocabulary_quality.owl
http://www.bioassayontology.org/bao/bao_vocabulary_result.owl
http://www.bioassayontology.org/bao/bao_vocabulary_ro.owl
http://www.bioassayontology.org/bao/bao_vocabulary_role.owl
http://www.bioassayontology.org/bao/bao_vocabulary_screenedentity.owl
http://www.bioassayontology.org/bao/bao_vocabulary_software.owl
http://www.bioassayontology.org/bao/bao_vocabulary_unit.owl
http://www.bioassayontology.org/bao/external/BAO_CLO_import.owl
http://www.bioassayontology.org/bao/external/BAO_DOID_import.owl
http://www.bioassayontology.org/bao/external/BAO_EFO_import.owl
http://www.bioassayontology.org/bao/external/BAO_ERO_import.owl
http://www.bioassayontology.org/bao/external/BAO_GO_import.owl
http://www.bioassayontology.org/bao/external/BAO_NCBITaxon_import.owl
http://www.bioassayontology.org/bao/external/BAO_NCIT_import.owl
http://www.bioassayontology.org/bao/external/BAO_PATO_import.owl
http://www.bioassayontology.org/bao/external/BAO_UBERON_import.owl
http://www.bioassayontology.org/bao/external/bao_UO_import.owl

From inspection, it’s obvious that some of these aren’t the main one, but is there a programatic way? I also know this isn’t an OBO Foundry ontology, but this also happens in a few (let me go back through and find some examples)

@cmungall said:

it looks like the json doesn’t include the owl:import triples. This isn’t a robot issue though ... I believe it’s just missing in the java code that generates it