Skip to content

Commit 0dce24f

Browse files
committed
refractor: minor updates
1 parent 159d86e commit 0dce24f

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/wotis/respec_doc_generator.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,15 @@ def get_assignment(slot_name: str, class_def: object, slot_def: object) -> str:
2020
"""
2121

2222
slot_usage = class_def.slot_usage.get(slot_name) if class_def.slot_usage else None
23-
24-
# Check 'required' property on slot or slot_usage
2523
if slot_def.required or (slot_usage and slot_usage.required):
2624
return 'mandatory'
2725

28-
# Check for minimum_value requirement (cardinality 1..* etc.)
26+
# Check (cardinality 1..* etc.)
2927
min_value = slot_def.minimum_value
3028
if slot_usage and slot_usage.minimum_value is not None:
3129
min_value = slot_usage.minimum_value
32-
3330
if min_value is not None and min_value > 0:
3431
return 'mandatory'
35-
36-
# Default to optional for all others
3732
return 'optional'
3833

3934

@@ -87,13 +82,9 @@ def generate_respec_spec(input_path: Path, respec_template_path: Path, final_spe
8782
return
8883

8984
slot_data = []
90-
9185
for slot_name in class_def.slots:
9286
slot_def = linkml_schema_view.get_slot(slot_name)
93-
9487
description = slot_def.description or ""
95-
96-
# Determine the Type text for the table, based on STTL
9788
if slot_name == '@context':
9889
range_text = 'anyURI or Array'
9990
elif slot_name == '@type':

0 commit comments

Comments
 (0)