Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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'],