@@ -85,6 +85,40 @@ examples/output: src/mixs/schema/mixs.yaml
85
85
--output-directory $@ \
86
86
--schema $< > $@ /README.md
87
87
88
+ .PHONY : standardize-schema
89
+
90
+ # |\
91
+ # yamlfmt -in -conf .yamlfmt >
92
+
93
+ standardize-schema :
94
+ $(RUN ) python src/scripts/describe_enums_by_slots_using.py \
95
+ --schema_file src/mixs/schema/mixs.yaml \
96
+ --output_file src/mixs/schema/mixs_with_enum_descriptions.yaml
97
+ $(RUN) gen-linkml \
98
+ --format yaml \
99
+ --no-mergeimports \
100
+ --no-materialize-attributes \
101
+ --materialize-patterns src/mixs/schema/mixs_with_enum_descriptions.yaml |\
102
+ yq eval '(.. | select(has("from_schema")) | .from_schema) style="" | del(.. | select(has("from_schema")).from_schema)' |\
103
+ yq eval '.classes[] |= select(has("annotations")).annotations |= map_values(.value)' |\
104
+ yq eval '.prefixes |= map_values(.prefix_reference)' |\
105
+ yq eval '.settings |= map_values(.setting_value)' |\
106
+ yq eval '.slots[] |= select(has("annotations")).annotations |= map_values(.value)' |\
107
+ yq eval 'del(.classes.[].name)' |\
108
+ yq eval 'del(.classes.[].slot_usage.[].name)' |\
109
+ yq eval 'del(.enums.[].name)' |\
110
+ yq eval 'del(.enums.[].permissible_values.[].text)' |\
111
+ yq eval 'del(.slots.[].domain)' |\
112
+ yq eval 'del(.slots.[].name)' |\
113
+ yq eval 'del(.source_file)' |\
114
+ yq eval 'del(.subsets.[].name)' | cat > src/mixs/schema/mixs_standardized.yaml
115
+ mv src/mixs/schema/mixs_standardized.yaml src/mixs/schema/mixs.yaml
116
+ rm -rf src/mixs/schema/mixs_standardized.yaml src/mixs/schema/mixs_with_enum_descriptions.yaml
117
+
118
+ test1 :
119
+ echo $$ PATH
120
+ yamlfmt -conf .yamlfmt src/mixs/schema/mixs.yaml > src/mixs/schema/mixs_standardized.yam
121
+
88
122
# Test documentation locally
89
123
serve : mkd-serve
90
124
0 commit comments