GenomicsStandardsConsortium / mixs

Minimum Information about any (X) Sequence” (MIxS) specification
https://w3id.org/mixs
Creative Commons Zero v1.0 Universal
33 stars 20 forks source link

remove unhelpful `slot_usage`s #752

Closed turbomam closed 5 months ago

turbomam commented 5 months ago

remove slot_usage assertions if they

Haven't chose an implementation yet

cc @mslarae13

turbomam commented 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")
turbomam commented 5 months ago

And then did find & replace in PyCharm to undo the more verbose forms that the schema fixer introduced: