How to use the ontobio.ontol.Ontology function in ontobio

To help you get started, we’ve selected a few ontobio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RTXteam / RTX / code / kg2 / build-kg2.py View on Github external
def get_nodes_dict_from_ontology_dict(ont_dict: dict,
                                      map_curie_to_biolink_category: dict,
                                      category_label_to_iri_mapper: callable):
    ontology = ont_dict['ontology']
    assert type(ontology) == ontobio.ontol.Ontology
    ontology_iri = ont_dict['id']
    assert ontology_iri.startswith('http:')
    ontology_curie_id = shorten_iri_to_curie(ontology_iri)

    ret_dict = {ontology_curie_id: {
        'id':  ontology_curie_id,
        'iri': ontology_iri,
        'full name': ont_dict['title'],
        'name': ont_dict['title'],
        'category': category_label_to_iri_mapper('data source'),
        'category label': 'data source',
        'description': ont_dict['description'],
        'synonyms': None,
        'xrefs': None,
        'creation date': None,
        'update date': ont_dict['file last modified timestamp'],

ontobio

Library for working with OBO Library Ontologies and associations

BSD-3-Clause
Latest version published 9 days ago

Package Health Score

72 / 100
Full package analysis