emmo-repo / CIF-ontology

Basic crystallography domain ontology based on EMMO and the CIF core dictionary.
Creative Commons Attribution 4.0 International
9 stars 4 forks source link

Extract extra metadata from a 'dic' object #170

Open CasperWA opened 1 year ago

CasperWA commented 1 year ago

Is there a way to extract metadata from the dic object like _dictionary_audit.version? onto.set_version(version="XXX")

Comment made by @jesper-friis about the Generator._add_metadata() method.

jamesrhester commented 11 months ago

The top level attributes in the dictionary are available by accessing the dictionary main block using the data block name. For cif_core this is CORE_DIC. So for example, if d is a CifDic:

>>> d["CORE_DIC"]["_dictionary.version"]
'3.2.0'