def belspec_yaml2json(yaml_fn: str, json_fn: str) -> str:
try:<EOL><INDENT>spec_dict = yaml.load(open(yaml_fn, "<STR_LIT:r>").read(), Loader=yaml.SafeLoader)<EOL>spec_dict["<STR_LIT>"] = {}<EOL>spec_dict["<STR_LIT>"]["<STR_LIT>"] = spec_dict["<STR_LIT:version>"].replace("<STR_LIT:.>", "<STR_LIT:_>")<EOL>spec_dict["<STR_LIT>"]["<STR_LIT>"] = yaml_fn.replace("<STR_LIT>", "<STR_LIT>")<EOL>add_relations(spec_dict)<EOL>add_functions(spec_dict)<EOL>add_namespaces(spec_dict)<EOL>enhance_function_signatures(spec_dict)<EOL>add_function_signature_help(spec_dict)<EOL>with open(json_fn, "<STR_LIT:w>") as f:<EOL><INDENT>json.dump(spec_dict, f)<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>log.error(<EOL>"<STR_LIT>".format(<EOL>yaml_fn<EOL>)<EOL>)<EOL>sys.exit()<EOL><DEDENT>return spec_dict["<STR_LIT:version>"]<EOL>
Enhance BEL specification and save as JSON file

    Load all BEL Specification YAML files and convert to JSON files
    after enhancing them.  Also create a bel_versions.json file with
    all available BEL versions for fast loading.

    Args:
        yaml_fn: original YAML version of BEL Spec
        json_fn: enhanced JSON version of BEL Spec
    Returns:
        str: version of BEL Spec