Closed turbomam closed 5 months ago
I wrote some minimal schema fixer code
import unittest
import os
from linkml_runtime.dumpers import yaml_dumper
from linkml.utils.schema_fixer import SchemaFixer
from linkml_runtime import SchemaView
ROOT = os.path.join(os.path.dirname(__file__), '..')
SCHEMA_DIR = os.path.join(ROOT, "src", "mixs", "schema")
SCHEMA_FILE = "mixs.yaml"
SCHEMA_PATH = os.path.join(SCHEMA_DIR, SCHEMA_FILE)
schema_view = SchemaView(SCHEMA_PATH)
schema_def = schema_view.schema
fixer = SchemaFixer()
fixer.remove_redundant_slot_usage(schema_def)
yaml_dumper.dump(schema_def, "mixs_no_redundant_slot_usage.yaml")
And then did find & replace in PyCharm to undo the more verbose forms that the schema fixer introduced:
name
text
from_schema
prefixes
annotations
settings
remove
slot_usage
assertions if theyHaven't chose an implementation yet
cc @mslarae13