linkml.utils.schemautils — linkml documentation

# Source code for linkml.utils.schemautils

    import logging
    import os
    from collections import OrderedDict
    from typing import Union, TextIO, Optional, Set, List, cast, Dict, Mapping, Tuple, Iterator
    from urllib.parse import urlparse

    from jsonasobj2 import values
    from linkml_runtime.linkml_model.meta import SchemaDefinition, SlotDefinition, SlotDefinitionName, ClassDefinition, \
        ClassDefinitionName, TypeDefinitionName, TypeDefinition, ElementName, EnumDefinition, EnumDefinitionName
    from linkml_runtime.utils.context_utils import parse_import_map
    from linkml_runtime.utils.formatutils import underscore, camelcase, sfx, mangled_attribute_name
    from linkml_runtime.utils.metamodelcore import Bool
    from linkml_runtime.utils.namespaces import Namespaces
    from linkml_runtime.utils.yamlutils import TypedNode

    from linkml.utils.mergeutils import merge_schemas, merge_slots, merge_classes, slot_usage_name
    from linkml.utils.rawloader import load_raw_schema
    from linkml.utils.schemasynopsis import SchemaSynopsis

    def demerge_schema(schema: SchemaDefinition) -> SchemaDefinition:
        new_schema = schema.copy()