obophenotype / ABA_Uberon

Ontologized versions of the ABA structureGraphs - with mappings to Uberon
0 stars 2 forks source link

Allen JSON structuregraph to OWL converter #9

Open dosumis opened 2 years ago

dosumis commented 2 years ago

Functional Spec:

JSON input

{
         "id": 567,
         "acronym": "CH",
         "name": "Cerebrum",
         "parent_structure_id": 8,
         "children": [
}

Other inputs:

ID prefix + mapping to base_iri, e.g. MBA

Each entry in the JSON becomes an OWL class:

"id": 567 --> id: MBA:567 ( = purl.obolibrary.org/obo/MBA_567) name --> rdfs:label "acronym": "CH" --> exact_synonym "parent_structure_id": 8, --> part_of some MBA:8

All classes get subClassOf: UBERON:0002616 # regional part of brain

Tech Spec: Python processes JSON from Allen -> Robot templates. Simple Makefile controls ROBOT template build.

dosumis commented 2 years ago

@cmungall - This is to rewrite the original JSON -> OBO scripts. Presumably PERL so not worth reviving or reviewing.

cmungall commented 2 years ago

We could use https://linkml.io/linkml-owl/ for this - may seem overkill but IMO it keeps everything very explicit and declarative

Do we want to keep our existing prefixes (and register them with bioregistry) or go with something like ABA:{someKindOfAtlasId}-{internalId}

Note we have an open issue about the correspondence or lack of correspondence between the IDs in this JSON and everything that is public on the Allen site: https://github.com/obophenotype/uberon/issues/1419 - do we also need some kind of annotation axioms in the ontology to make this all more transparent? In particular for HBA which seems to be the main issue

cmungall commented 2 years ago

I can also have Harshad implement this if you like

dosumis commented 2 years ago

re linkML approach - is the idea to use a schema mapping file that converts structureGraph JSON to OWL? Happy to go with that approach. I'm sure @hkir-dev would be interested to learn how & we should have more awareness/understanding of linkML in the group.

Note we have an open issue about the correspondence or lack of correspondence between the IDs in this JSON and everything that is public on the Allen site: https://github.com/obophenotype/uberon/issues/1419

I no longer believe this is a problem - see comment on ticket. Although we should check diffs once we have new conversions, and it would be good if we could find some programatic way to check whether URLs rolled with ids from the structuregraphs resolve on the corresponding atlases in the mapping table.

hkir-dev commented 2 years ago

Implementation completed using linkml-owl https://github.com/obophenotype/ABA_Uberon/pull/12 But I couldn't find an example about processing nested jsons, so needed to generate intermediate flat tsv tables.