You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note:** Artifacts are not committed to this PR to avoid merge conflicts. All artifacts will be automatically rebuilt and committed to `main` after merge.
98
-
99
98
100
-
99
+
- name: Upload artifacts for subsequent jobs
100
+
uses: actions/upload-artifact@v4
101
+
with:
102
+
name: build-artifacts
103
+
path: |
104
+
NF.jsonld
105
+
dist/NF.yaml
106
+
dist/NF.ttl
107
+
registered-json-schemas/*.json
108
+
retention-days: 1
109
+
110
+
analyze:
111
+
name: Analyze data model changes
112
+
needs: [build]
113
+
runs-on: ubuntu-latest
114
+
permissions:
115
+
pull-requests: write
116
+
117
+
steps:
118
+
- uses: actions/checkout@v4
119
+
with:
120
+
ref: ${{ github.event.pull_request.head.ref }}
121
+
fetch-depth: 0
122
+
123
+
- uses: actions/setup-python@v5
124
+
with:
125
+
python-version: '3.10.12'
126
+
127
+
- name: Install dependencies
128
+
run: |
129
+
pip install rdflib
130
+
131
+
- name: Get main branch pre-built NF.ttl for comparison
The data model uses **contextual enum subsets** to provide users with relevant, focused dropdown options rather than presenting large monolithic enumerations containing hundreds of values.
8
+
9
+
This pattern leverages LinkML's [slot_usage](https://linkml.io/linkml/schemas/slots.html#slot-usage) feature to refine slot definitions within specific class contexts.
10
+
11
+
### Design Pattern
12
+
13
+
**Enum Organization:**
14
+
- Large enums (assays, platforms, file formats) are split into domain-specific subsets
15
+
- Each subset groups semantically related values (e.g., sequencing assays vs. imaging assays)
16
+
- Base slot definitions (in `props.yaml`) use `any_of` to effectively define a union, accepting values from all relevant subsets
17
+
18
+
**Template Constraints:**
19
+
Templates apply `slot_usage` to restrict slots to contextually appropriate enum subsets:
20
+
21
+
```yaml
22
+
SequencingTemplate:
23
+
slot_usage:
24
+
assay:
25
+
range: SequencingAssayEnum
26
+
platform:
27
+
range: SequencingPlatformEnum
28
+
fileFormat:
29
+
range: SequencingFileFormatEnum
30
+
```
31
+
32
+
**Multiple Context Support:**
33
+
When templates span multiple contexts, use `any_of` in slot_usage to define a union of enum subsets:
34
+
35
+
```yaml
36
+
EpigenomicsAssayTemplate:
37
+
slot_usage:
38
+
platform:
39
+
any_of:
40
+
- range: SequencingPlatformEnum
41
+
- range: ArrayPlatformEnum
42
+
```
43
+
44
+
### Benefits
45
+
46
+
- **Better UX**: Users see only relevant options for their context
47
+
- **Performance**: Templates are smaller and faster to load with constrained enum ranges
48
+
- **Type Safety**: Templates enforce appropriate value constraints
49
+
- **Maintainability**: Logical grouping makes enums easier to extend
50
+
- **Backward Compatibility**: Generic templates remain flexible via `any_of`
51
+
52
+
### When to Use
53
+
54
+
- Create enum subsets when a general enum exceeds ~30-50 values
55
+
- Apply slot_usage when templates have clear domain context (sequencing, imaging, clinical, etc.)
56
+
- Use `any_of` for cross-domain templates or generic base templates
0 commit comments