expressir 2.1.30 → 2.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/docs.yml +98 -0
- data/.github/workflows/links.yml +100 -0
- data/.github/workflows/rake.yml +4 -0
- data/.github/workflows/release.yml +5 -0
- data/.github/workflows/validate_schemas.yml +1 -1
- data/.gitignore +3 -0
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +244 -39
- data/Gemfile +2 -1
- data/README.adoc +621 -54
- data/docs/Gemfile +12 -0
- data/docs/_config.yml +141 -0
- data/docs/_guides/changes/changes-format.adoc +778 -0
- data/docs/_guides/changes/importing-eengine.adoc +898 -0
- data/docs/_guides/changes/index.adoc +396 -0
- data/docs/_guides/changes/programmatic-usage.adoc +1038 -0
- data/docs/_guides/changes/validating-changes.adoc +681 -0
- data/docs/_guides/cli/benchmark-performance.adoc +834 -0
- data/docs/_guides/cli/coverage-analysis.adoc +921 -0
- data/docs/_guides/cli/format-schemas.adoc +547 -0
- data/docs/_guides/cli/index.adoc +8 -0
- data/docs/_guides/cli/managing-changes.adoc +927 -0
- data/docs/_guides/cli/validate-ascii.adoc +645 -0
- data/docs/_guides/cli/validate-schemas.adoc +534 -0
- data/docs/_guides/index.adoc +165 -0
- data/docs/_guides/ler/creating-packages.adoc +664 -0
- data/docs/_guides/ler/index.adoc +305 -0
- data/docs/_guides/ler/loading-packages.adoc +707 -0
- data/docs/_guides/ler/package-formats.adoc +748 -0
- data/docs/_guides/ler/querying-packages.adoc +826 -0
- data/docs/_guides/ler/validating-packages.adoc +750 -0
- data/docs/_guides/liquid/basic-templates.adoc +813 -0
- data/docs/_guides/liquid/documentation-generation.adoc +1042 -0
- data/docs/_guides/liquid/drops-reference.adoc +829 -0
- data/docs/_guides/liquid/filters-and-tags.adoc +912 -0
- data/docs/_guides/liquid/index.adoc +468 -0
- data/docs/_guides/manifests/creating-manifests.adoc +483 -0
- data/docs/_guides/manifests/index.adoc +307 -0
- data/docs/_guides/manifests/resolving-manifests.adoc +557 -0
- data/docs/_guides/manifests/validating-manifests.adoc +713 -0
- data/docs/_guides/ruby-api/formatting-schemas.adoc +605 -0
- data/docs/_guides/ruby-api/index.adoc +257 -0
- data/docs/_guides/ruby-api/parsing-files.adoc +421 -0
- data/docs/_guides/ruby-api/search-engine.adoc +609 -0
- data/docs/_guides/ruby-api/working-with-repository.adoc +577 -0
- data/docs/_pages/data-model.adoc +665 -0
- data/docs/_pages/express-language.adoc +506 -0
- data/docs/_pages/getting-started.adoc +414 -0
- data/docs/_pages/index.adoc +116 -0
- data/docs/_pages/introduction.adoc +256 -0
- data/docs/_pages/ler-packages.adoc +837 -0
- data/docs/_pages/parsers.adoc +683 -0
- data/docs/_pages/schema-manifests.adoc +431 -0
- data/docs/_references/index.adoc +228 -0
- data/docs/_tutorials/creating-ler-package.adoc +735 -0
- data/docs/_tutorials/documentation-coverage.adoc +795 -0
- data/docs/_tutorials/index.adoc +221 -0
- data/docs/_tutorials/liquid-templates.adoc +806 -0
- data/docs/_tutorials/parsing-your-first-schema.adoc +522 -0
- data/docs/_tutorials/querying-schemas.adoc +751 -0
- data/docs/_tutorials/working-with-multiple-schemas.adoc +676 -0
- data/docs/index.adoc +242 -0
- data/docs/lychee.toml +84 -0
- data/examples/demo_ler_usage.sh +86 -0
- data/examples/ler/README.md +111 -0
- data/examples/ler/simple_example.ler +0 -0
- data/examples/ler/simple_schema.exp +33 -0
- data/examples/ler_build.rb +75 -0
- data/examples/ler_cli.rb +79 -0
- data/examples/ler_demo_complete.rb +276 -0
- data/examples/ler_query.rb +91 -0
- data/examples/ler_query_examples.rb +305 -0
- data/examples/ler_stats.rb +81 -0
- data/examples/phase3_demo.rb +159 -0
- data/examples/query_demo_simple.rb +131 -0
- data/expressir.gemspec +2 -0
- data/lib/expressir/cli.rb +12 -4
- data/lib/expressir/commands/manifest.rb +427 -0
- data/lib/expressir/commands/package.rb +1274 -0
- data/lib/expressir/commands/validate.rb +70 -37
- data/lib/expressir/commands/validate_ascii.rb +607 -0
- data/lib/expressir/commands/validate_load.rb +88 -0
- data/lib/expressir/express/formatter.rb +5 -1
- data/lib/expressir/express/formatters/remark_item_formatter.rb +25 -0
- data/lib/expressir/express/parser.rb +33 -0
- data/lib/expressir/manifest/resolver.rb +213 -0
- data/lib/expressir/manifest/validator.rb +195 -0
- data/lib/expressir/model/declarations/entity.rb +6 -0
- data/lib/expressir/model/dependency_resolver.rb +270 -0
- data/lib/expressir/model/indexes/entity_index.rb +103 -0
- data/lib/expressir/model/indexes/reference_index.rb +148 -0
- data/lib/expressir/model/indexes/type_index.rb +149 -0
- data/lib/expressir/model/interface_validator.rb +384 -0
- data/lib/expressir/model/repository.rb +400 -5
- data/lib/expressir/model/repository_validator.rb +295 -0
- data/lib/expressir/model/search_engine.rb +525 -0
- data/lib/expressir/model.rb +4 -94
- data/lib/expressir/package/builder.rb +200 -0
- data/lib/expressir/package/metadata.rb +81 -0
- data/lib/expressir/package/reader.rb +165 -0
- data/lib/expressir/schema_manifest.rb +11 -1
- data/lib/expressir/version.rb +1 -1
- data/lib/expressir.rb +15 -2
- metadata +114 -4
- data/docs/benchmarking.adoc +0 -107
- data/docs/liquid_drops.adoc +0 -1547
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Schema Manifests
|
|
3
|
+
nav_order: 6
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
= EXPRESS Schema Manifests
|
|
7
|
+
|
|
8
|
+
== General
|
|
9
|
+
|
|
10
|
+
The EXPRESS schema manifest is a file format defined by ELF at https://www.expresslang.org/docs[EXPRESS schema manifest specification].
|
|
11
|
+
|
|
12
|
+
Expressir provides a `SchemaManifest` class for managing collections of EXPRESS schema files. This is particularly useful when working with multiple related schemas or when you need to organize schema files in a structured way.
|
|
13
|
+
|
|
14
|
+
The `SchemaManifest` class allows you to:
|
|
15
|
+
|
|
16
|
+
* Load schema file lists from YAML manifest files
|
|
17
|
+
* Manage schema metadata and paths
|
|
18
|
+
* Programmatically create and manipulate schema collections
|
|
19
|
+
* Save manifest configurations to files
|
|
20
|
+
* Validate manifests for completeness and referential integrity
|
|
21
|
+
* Resolve all dependencies from root schemas
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
== File format
|
|
25
|
+
|
|
26
|
+
The schema manifest uses a structured YAML format:
|
|
27
|
+
|
|
28
|
+
[source,yaml]
|
|
29
|
+
----
|
|
30
|
+
schemas:
|
|
31
|
+
action_schema:
|
|
32
|
+
path: schemas/resources/action_schema/action_schema.exp
|
|
33
|
+
approval_schema:
|
|
34
|
+
path: schemas/resources/approval_schema/approval_schema.exp
|
|
35
|
+
date_time_schema:
|
|
36
|
+
path: schemas/resources/date_time_schema/date_time_schema.exp
|
|
37
|
+
----
|
|
38
|
+
|
|
39
|
+
Each schema entry in the manifest can have the following attributes:
|
|
40
|
+
|
|
41
|
+
`path`:: (Required) The file path to the EXPRESS schema file
|
|
42
|
+
`id`:: (Optional) A unique identifier for the schema
|
|
43
|
+
`container_path`:: (Optional) Container path information
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
[example]
|
|
47
|
+
.Example project structure with schema manifest
|
|
48
|
+
====
|
|
49
|
+
[source]
|
|
50
|
+
----
|
|
51
|
+
project/
|
|
52
|
+
├── schemas.yml # Schema manifest
|
|
53
|
+
└── schemas/
|
|
54
|
+
├── core/
|
|
55
|
+
│ ├── action_schema.exp
|
|
56
|
+
│ └── approval_schema.exp
|
|
57
|
+
└── extensions/
|
|
58
|
+
└── date_time_schema.exp
|
|
59
|
+
----
|
|
60
|
+
|
|
61
|
+
.schemas.yml
|
|
62
|
+
[source,yaml]
|
|
63
|
+
----
|
|
64
|
+
schemas:
|
|
65
|
+
action_schema:
|
|
66
|
+
path: schemas/core/action_schema/action_schema.exp
|
|
67
|
+
approval_schema:
|
|
68
|
+
path: schemas/core/approval_schema/approval_schema.exp
|
|
69
|
+
date_time_schema:
|
|
70
|
+
path: schemas/extensions/date_time_schema/date_time_schema.exp
|
|
71
|
+
----
|
|
72
|
+
====
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
== Commands for schema manifests
|
|
76
|
+
|
|
77
|
+
=== Creating a manifest from a root schema
|
|
78
|
+
|
|
79
|
+
The `manifest create` command generates a schema manifest YAML file by resolving all referenced schemas starting from a specified root schema file.
|
|
80
|
+
|
|
81
|
+
.`manifest create` - Generate schema manifest
|
|
82
|
+
[source,sh]
|
|
83
|
+
----
|
|
84
|
+
Usage:
|
|
85
|
+
expressir manifest create ROOT_SCHEMA [MORE_SCHEMAS...] -o, --output=OUTPUT
|
|
86
|
+
|
|
87
|
+
Options:
|
|
88
|
+
-o, --output=OUTPUT # Output YAML file path
|
|
89
|
+
[--base-dirs=BASE_DIRS] # Comma-separated base directories for schema resolution
|
|
90
|
+
[--verbose], [--no-verbose], [--skip-verbose] # Show detailed output
|
|
91
|
+
# Default: false
|
|
92
|
+
|
|
93
|
+
Description:
|
|
94
|
+
Generate a YAML manifest of all schemas required for packaging.
|
|
95
|
+
|
|
96
|
+
The manifest uses the existing SchemaManifest format:
|
|
97
|
+
schemas:
|
|
98
|
+
schema_id:
|
|
99
|
+
path: /path/to/schema.exp
|
|
100
|
+
|
|
101
|
+
Workflow:
|
|
102
|
+
1. Create manifest from root schema
|
|
103
|
+
2. Edit manifest to add paths for schemas with null paths
|
|
104
|
+
3. Validate manifest
|
|
105
|
+
4. Build package using manifest
|
|
106
|
+
|
|
107
|
+
Example:
|
|
108
|
+
expressir manifest create schemas/activity/mim.exp \
|
|
109
|
+
-o activity_manifest.yaml \
|
|
110
|
+
--base-dirs /path/to/schemas
|
|
111
|
+
----
|
|
112
|
+
|
|
113
|
+
Options:
|
|
114
|
+
|
|
115
|
+
`--output, -o FILE`:: (Required) Output YAML file path
|
|
116
|
+
|
|
117
|
+
`--base-dirs DIRS`:: Comma-separated search directories. It searches for the following paths when resolving schemas:
|
|
118
|
+
schema files named according to schema ID::: `<SCHEMA_ID>.exp`
|
|
119
|
+
schema files named in the STEP module pattern::: `<LOWERCASE_SCHEMA_WO_MIMARM>/{mim,arm}.exp`
|
|
120
|
+
|
|
121
|
+
`--verbose`:: Show detailed output
|
|
122
|
+
|
|
123
|
+
.Creating a manifest from a root schema
|
|
124
|
+
[example]
|
|
125
|
+
====
|
|
126
|
+
The following command creates a manifest starting from the `schemas/modules/activity/mim.exp` root schema, searching for referenced schemas in the `schemas/` base directory.
|
|
127
|
+
|
|
128
|
+
[source,sh]
|
|
129
|
+
----
|
|
130
|
+
expressir manifest create \
|
|
131
|
+
-o manifest.yaml \
|
|
132
|
+
--base-dirs schemas/ \
|
|
133
|
+
--verbose \
|
|
134
|
+
schemas/modules/activity/mim.exp
|
|
135
|
+
|
|
136
|
+
Creating manifest from 1 root schema(s)...
|
|
137
|
+
Base directories:
|
|
138
|
+
- schemas/
|
|
139
|
+
Resolving dependencies...
|
|
140
|
+
USE FROM action_schema (in Activity_mim): ✓ action_schema.exp
|
|
141
|
+
REFERENCE FROM basic_attribute_schema (in action_schema): ✓ basic_attribute_schema.exp
|
|
142
|
+
REFERENCE FROM support_resource_schema (in basic_attribute_schema): ✓ support_resource_schema.exp
|
|
143
|
+
REFERENCE FROM support_resource_schema (in action_schema): ✓ support_resource_schema.exp
|
|
144
|
+
USE FROM Activity_method_mim (in Activity_mim): ✗ not found
|
|
145
|
+
USE FROM basic_attribute_schema (in Activity_mim): ✓ basic_attribute_schema.exp
|
|
146
|
+
...
|
|
147
|
+
REFERENCE FROM support_resource_schema (in management_resources_schema): ✓ support_resource_schema.exp
|
|
148
|
+
✓ Manifest created: manifest.yaml
|
|
149
|
+
Resolved schemas: 41
|
|
150
|
+
|
|
151
|
+
⚠ Unresolved schemas (1):
|
|
152
|
+
- Activity_method_mim
|
|
153
|
+
|
|
154
|
+
Please edit manifest.yaml and set 'path:' for unresolved schemas
|
|
155
|
+
Then validate with: expressir manifest validate manifest.yaml
|
|
156
|
+
----
|
|
157
|
+
====
|
|
158
|
+
|
|
159
|
+
In the case of unresolved schemas, the created manifest will include entries without the `path:` field. The manifest can then be edited manually to add the correct paths.
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
=== Resolving schemas from a manifest
|
|
163
|
+
|
|
164
|
+
A schema manifest can be used as input to resolve and load all referenced schemas into a new manifest.
|
|
165
|
+
|
|
166
|
+
[source,sh]
|
|
167
|
+
----
|
|
168
|
+
expressir manifest resolve MANIFEST -o, --output=OUTPUT
|
|
169
|
+
----
|
|
170
|
+
|
|
171
|
+
[source,sh]
|
|
172
|
+
----
|
|
173
|
+
Usage:
|
|
174
|
+
expressir manifest resolve MANIFEST -o, --output=OUTPUT
|
|
175
|
+
|
|
176
|
+
Options:
|
|
177
|
+
-o, --output=OUTPUT # Output file path for resolved manifest
|
|
178
|
+
[--base-dirs=BASE_DIRS] # Comma-separated base directories for schema search
|
|
179
|
+
[--verbose], [--no-verbose], [--skip-verbose] # Show detailed resolution progress
|
|
180
|
+
# Default: false
|
|
181
|
+
|
|
182
|
+
Description:
|
|
183
|
+
Resolve missing or incomplete schema paths in a manifest file.
|
|
184
|
+
|
|
185
|
+
This command attempts to find file paths for schemas with missing or empty
|
|
186
|
+
paths by searching in base directories using naming patterns:
|
|
187
|
+
|
|
188
|
+
Supported patterns:
|
|
189
|
+
- Resource schemas: {schema_name}.exp
|
|
190
|
+
- Module ARM/MIM: {module_name}/{arm|mim}.exp
|
|
191
|
+
Example: Activity_method_mim -> activity_method/mim.exp
|
|
192
|
+
|
|
193
|
+
The resolved manifest is written to the output file, leaving the original
|
|
194
|
+
unchanged.
|
|
195
|
+
|
|
196
|
+
Use this command after 'expressir manifest validate --check-references' fails
|
|
197
|
+
to automatically resolve missing schema paths.
|
|
198
|
+
|
|
199
|
+
Examples:
|
|
200
|
+
# Resolve paths using manifest's existing base directories
|
|
201
|
+
expressir manifest resolve manifest.yaml -o resolved_manifest.yaml
|
|
202
|
+
|
|
203
|
+
# Resolve with explicit base directories
|
|
204
|
+
expressir manifest resolve manifest.yaml -o resolved.yaml \
|
|
205
|
+
--base-dirs /path/to/schemas,/another/path
|
|
206
|
+
|
|
207
|
+
# With verbose output
|
|
208
|
+
expressir manifest resolve manifest.yaml -o resolved.yaml --verbose
|
|
209
|
+
----
|
|
210
|
+
|
|
211
|
+
Options:
|
|
212
|
+
|
|
213
|
+
`--output, -o FILE`:: (Required) Output file path for resolved manifest
|
|
214
|
+
|
|
215
|
+
`--base-dirs DIRS`:: Comma-separated search directories. It searches for the following paths when resolving schemas:
|
|
216
|
+
schema files named according to schema ID::: `<SCHEMA_ID>.exp`
|
|
217
|
+
schema files named in the STEP module pattern::: `<LOWERCASE_SCHEMA_WO_MIMARM>/{mim,arm}.exp`
|
|
218
|
+
|
|
219
|
+
`--verbose`:: Show detailed resolution progress
|
|
220
|
+
|
|
221
|
+
.Fully resolving a schema manifest
|
|
222
|
+
[example]
|
|
223
|
+
====
|
|
224
|
+
The following command resolves all schemas in the `manifest.yaml` file and writes the fully resolved manifest to `resolved_manifest.yaml`.
|
|
225
|
+
|
|
226
|
+
[source,sh]
|
|
227
|
+
----
|
|
228
|
+
expressir manifest resolve manifest.yaml -o resolved_manifest.yaml --verbose
|
|
229
|
+
----
|
|
230
|
+
|
|
231
|
+
[source,sh]
|
|
232
|
+
----
|
|
233
|
+
Resolving schema paths in: manifest.yaml...
|
|
234
|
+
Using base directories:
|
|
235
|
+
- /Users/mulgogi/src/mn/iso-10303/schemas/
|
|
236
|
+
Attempting to resolve paths...
|
|
237
|
+
Resolving dependencies from 1 root schema(s)...
|
|
238
|
+
USE FROM action_schema (in Activity_mim): ✓ action_schema.exp
|
|
239
|
+
REFERENCE FROM basic_attribute_schema (in action_schema): ✓ basic_attribute_schema.exp
|
|
240
|
+
REFERENCE FROM support_resource_schema (in basic_attribute_schema): ✓ support_resource_schema.exp
|
|
241
|
+
REFERENCE FROM support_resource_schema (in action_schema): ✓ support_resource_schema.exp
|
|
242
|
+
USE FROM Activity_method_mim (in Activity_mim): ✗ not found
|
|
243
|
+
USE FROM basic_attribute_schema (in Activity_mim): ✓ basic_attribute_schema.exp
|
|
244
|
+
USE FROM management_resources_schema (in Activity_mim): ✓ management_resources_schema.exp
|
|
245
|
+
...
|
|
246
|
+
REFERENCE FROM support_resource_schema (in management_resources_schema): ✓ support_resource_schema.exp
|
|
247
|
+
✓ Manifest resolved: resolved.yaml
|
|
248
|
+
Total schemas: 42
|
|
249
|
+
Resolved schemas: 41
|
|
250
|
+
|
|
251
|
+
⚠ Unresolved schemas (1):
|
|
252
|
+
- Activity_method_mim
|
|
253
|
+
|
|
254
|
+
These schemas could not be found in the search directories.
|
|
255
|
+
You may need to:
|
|
256
|
+
1. Add more base directories with --base-dirs
|
|
257
|
+
2. Manually edit resolved.yaml and set their paths
|
|
258
|
+
----
|
|
259
|
+
====
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
=== Validating a manifest
|
|
263
|
+
|
|
264
|
+
A schema manifest can be validated to ensure all referenced schemas are fully resolvable and correctly defined.
|
|
265
|
+
|
|
266
|
+
.`manifest validate` - Validate manifest
|
|
267
|
+
[source,sh]
|
|
268
|
+
----
|
|
269
|
+
expressir manifest validate MANIFEST.yaml [OPTIONS]
|
|
270
|
+
----
|
|
271
|
+
|
|
272
|
+
[source,sh]
|
|
273
|
+
----
|
|
274
|
+
Usage:
|
|
275
|
+
expressir manifest validate MANIFEST
|
|
276
|
+
|
|
277
|
+
Options:
|
|
278
|
+
[--verbose], [--no-verbose], [--skip-verbose] # Show detailed validation results
|
|
279
|
+
# Default: false
|
|
280
|
+
[--check-references], [--no-check-references], [--skip-check-references] # Validate referential integrity using dependency resolver
|
|
281
|
+
# Default: false
|
|
282
|
+
|
|
283
|
+
Description:
|
|
284
|
+
Validate a schema manifest file.
|
|
285
|
+
|
|
286
|
+
Validation types:
|
|
287
|
+
- File existence: All schema paths exist on disk
|
|
288
|
+
- Path completeness: All schemas have paths specified (warnings)
|
|
289
|
+
- Schema names: Manifest IDs match actual schema names in files
|
|
290
|
+
- Referential integrity (--check-references): All USE/REFERENCE FROM resolve
|
|
291
|
+
|
|
292
|
+
Examples:
|
|
293
|
+
# Basic validation (file existence and path completeness)
|
|
294
|
+
expressir manifest validate activity_manifest.yaml
|
|
295
|
+
|
|
296
|
+
# With referential integrity checking
|
|
297
|
+
expressir manifest validate activity_manifest.yaml --check-references
|
|
298
|
+
|
|
299
|
+
# With verbose output
|
|
300
|
+
expressir manifest validate activity_manifest.yaml --check-references --verbose
|
|
301
|
+
----
|
|
302
|
+
|
|
303
|
+
Options:
|
|
304
|
+
|
|
305
|
+
`--verbose`:: Show detailed validation results
|
|
306
|
+
|
|
307
|
+
`--check-references`:: Validate referential integrity using dependency resolver
|
|
308
|
+
|
|
309
|
+
.Validating a manifest to ensure all dependencies are defined
|
|
310
|
+
[example]
|
|
311
|
+
====
|
|
312
|
+
Checking `REFERENCE FROM` and `USE FROM` references to ensure all dependencies are defined in EXPRESS schemas included in the manifest:
|
|
313
|
+
|
|
314
|
+
[source,sh]
|
|
315
|
+
----
|
|
316
|
+
$ expressir manifest validate manifest.yaml --check-references --verbose
|
|
317
|
+
|
|
318
|
+
Validating manifest: manifest.yaml...
|
|
319
|
+
Checking referential integrity...
|
|
320
|
+
Validating referential integrity for 42 schemas...
|
|
321
|
+
|
|
322
|
+
USE FROM action_schema (in Activity_method_mim): ✓ action_schema.exp
|
|
323
|
+
REFERENCE FROM basic_attribute_schema (in action_schema): ✓ basic_attribute_schema.exp
|
|
324
|
+
...
|
|
325
|
+
USE FROM action_schema (in Activity_mim): ✓ action_schema.exp
|
|
326
|
+
...
|
|
327
|
+
REFERENCE FROM support_resource_schema (in topology_schema): ✓ support_resource_schema.exp
|
|
328
|
+
✓ Manifest is valid
|
|
329
|
+
Total schemas: 42
|
|
330
|
+
Resolved schemas: 42
|
|
331
|
+
----
|
|
332
|
+
====
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
== Ruby API for schema manifests
|
|
336
|
+
|
|
337
|
+
=== Loading manifests
|
|
338
|
+
|
|
339
|
+
Load an existing schema manifest from a YAML file:
|
|
340
|
+
|
|
341
|
+
[source,ruby]
|
|
342
|
+
----
|
|
343
|
+
# Load manifest from file
|
|
344
|
+
manifest = Expressir::SchemaManifest.from_file("schemas.yml")
|
|
345
|
+
|
|
346
|
+
# Access schema entries
|
|
347
|
+
manifest.schemas.each do |schema_entry|
|
|
348
|
+
puts "Schema path: #{schema_entry.path}"
|
|
349
|
+
puts "Schema ID: #{schema_entry.id}" if schema_entry.id
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
# Get all schema file paths
|
|
353
|
+
schema_paths = manifest.schemas.map(&:path)
|
|
354
|
+
----
|
|
355
|
+
|
|
356
|
+
=== Creating manifests
|
|
357
|
+
|
|
358
|
+
Create a new schema manifest programmatically:
|
|
359
|
+
|
|
360
|
+
[source,ruby]
|
|
361
|
+
----
|
|
362
|
+
# Create an empty manifest
|
|
363
|
+
manifest = Expressir::SchemaManifest.new
|
|
364
|
+
|
|
365
|
+
# Add schema entries
|
|
366
|
+
manifest.schemas << Expressir::SchemaManifestEntry.new(
|
|
367
|
+
path: "schemas/action_schema.exp",
|
|
368
|
+
id: "action_schema"
|
|
369
|
+
)
|
|
370
|
+
|
|
371
|
+
manifest.schemas << Expressir::SchemaManifestEntry.new(
|
|
372
|
+
path: "schemas/approval_schema.exp"
|
|
373
|
+
)
|
|
374
|
+
|
|
375
|
+
# Set base path for the manifest
|
|
376
|
+
manifest.base_path = "/path/to/schemas"
|
|
377
|
+
----
|
|
378
|
+
|
|
379
|
+
=== Saving manifests
|
|
380
|
+
|
|
381
|
+
Save a manifest to a file:
|
|
382
|
+
|
|
383
|
+
[source,ruby]
|
|
384
|
+
----
|
|
385
|
+
# Save to a specific file
|
|
386
|
+
manifest.to_file("output_schemas.yml")
|
|
387
|
+
|
|
388
|
+
# Save to a path with automatic filename
|
|
389
|
+
manifest.save_to_path("/path/to/output/")
|
|
390
|
+
----
|
|
391
|
+
|
|
392
|
+
=== Concatenating manifests
|
|
393
|
+
|
|
394
|
+
Combine multiple manifests:
|
|
395
|
+
|
|
396
|
+
[source,ruby]
|
|
397
|
+
----
|
|
398
|
+
manifest1 = Expressir::SchemaManifest.from_file("schemas1.yml")
|
|
399
|
+
manifest2 = Expressir::SchemaManifest.from_file("schemas2.yml")
|
|
400
|
+
|
|
401
|
+
# Concatenate manifests
|
|
402
|
+
combined_manifest = manifest1.concat(manifest2)
|
|
403
|
+
|
|
404
|
+
# Or use the + operator
|
|
405
|
+
combined_manifest = manifest1 + manifest2
|
|
406
|
+
----
|
|
407
|
+
|
|
408
|
+
=== Using manifests with parsers
|
|
409
|
+
|
|
410
|
+
Parse all schemas from a manifest:
|
|
411
|
+
|
|
412
|
+
[source,ruby]
|
|
413
|
+
----
|
|
414
|
+
# Load manifest
|
|
415
|
+
manifest = Expressir::SchemaManifest.from_file("schemas.yml")
|
|
416
|
+
|
|
417
|
+
# Get schema file paths
|
|
418
|
+
schema_paths = manifest.schemas.map(&:path)
|
|
419
|
+
|
|
420
|
+
# Parse all schemas
|
|
421
|
+
repository = Expressir::Express::Parser.from_files(schema_paths)
|
|
422
|
+
|
|
423
|
+
# With progress tracking
|
|
424
|
+
repository = Expressir::Express::Parser.from_files(schema_paths) do |filename, schemas, error|
|
|
425
|
+
if error
|
|
426
|
+
puts "Error loading #{filename}: #{error.message}"
|
|
427
|
+
else
|
|
428
|
+
puts "Successfully loaded #{schemas.length} schemas from #{filename}"
|
|
429
|
+
end
|
|
430
|
+
end
|
|
431
|
+
----
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: References
|
|
3
|
+
has_children: true
|
|
4
|
+
nav_order: 5
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
= References
|
|
8
|
+
|
|
9
|
+
Comprehensive technical specifications and API documentation for Expressir. Use this section when you need complete, detailed information about specific features.
|
|
10
|
+
|
|
11
|
+
== About These References
|
|
12
|
+
|
|
13
|
+
The References section provides:
|
|
14
|
+
|
|
15
|
+
* Complete command-line interface (CLI) specification
|
|
16
|
+
* Full Ruby API documentation
|
|
17
|
+
* Detailed data model class references
|
|
18
|
+
* Liquid drops attribute listings
|
|
19
|
+
* File format specifications
|
|
20
|
+
* Configuration options
|
|
21
|
+
|
|
22
|
+
== Reference Documents
|
|
23
|
+
|
|
24
|
+
=== link:cli-commands.html[CLI Commands Reference]
|
|
25
|
+
|
|
26
|
+
Complete reference for all command-line tools.
|
|
27
|
+
|
|
28
|
+
*Includes:*
|
|
29
|
+
|
|
30
|
+
* Full command syntax
|
|
31
|
+
* All options and parameters
|
|
32
|
+
* Usage examples
|
|
33
|
+
* Exit codes and error messages
|
|
34
|
+
* Environment variables
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
=== link:ruby-api.html[Ruby API Reference]
|
|
39
|
+
|
|
40
|
+
Comprehensive API documentation for programmatic usage.
|
|
41
|
+
|
|
42
|
+
*Covers:*
|
|
43
|
+
|
|
44
|
+
* Parser classes and methods
|
|
45
|
+
* Repository API
|
|
46
|
+
* Model classes overview
|
|
47
|
+
* Utility functions
|
|
48
|
+
* Error handling
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
=== link:data-model/[Data Model Reference]
|
|
53
|
+
|
|
54
|
+
Detailed documentation of Expressir's Ruby data model classes.
|
|
55
|
+
|
|
56
|
+
*Sections:*
|
|
57
|
+
|
|
58
|
+
* link:data-model/declarations.html[Declarations] - Entities, types, functions, etc.
|
|
59
|
+
* link:data-model/data-types.html[Data Types] - Type system classes
|
|
60
|
+
* link:data-model/expressions.html[Expressions] - Expression classes
|
|
61
|
+
* link:data-model/statements.html[Statements] - Statement classes
|
|
62
|
+
* link:data-model/references.html[References] - Reference types
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
=== link:liquid-drops/[Liquid Drops Reference]
|
|
67
|
+
|
|
68
|
+
Complete attribute listings for Liquid template integration.
|
|
69
|
+
|
|
70
|
+
*Sections:*
|
|
71
|
+
|
|
72
|
+
* link:liquid-drops/identifier-drop.html[Identifier Drop] - Common identifier attributes
|
|
73
|
+
* link:liquid-drops/declaration-drops.html[Declaration Drops] - Schema declarations
|
|
74
|
+
* link:liquid-drops/data-type-drops.html[Data Type Drops] - Type system drops
|
|
75
|
+
* link:liquid-drops/expression-drops.html[Expression Drops] - Expression drops
|
|
76
|
+
* link:liquid-drops/statement-drops.html[Statement Drops] - Statement drops
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
=== link:ler-format.html[LER Format Specification]
|
|
81
|
+
|
|
82
|
+
Detailed specification of the LutaML EXPRESS Repository format.
|
|
83
|
+
|
|
84
|
+
*Covers:*
|
|
85
|
+
|
|
86
|
+
* Package structure
|
|
87
|
+
* Metadata format
|
|
88
|
+
* Index formats
|
|
89
|
+
* Serialization options
|
|
90
|
+
* Version compatibility
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
=== link:changes-format.html[EXPRESS Changes Format]
|
|
95
|
+
|
|
96
|
+
Specification for EXPRESS Changes YAML format.
|
|
97
|
+
|
|
98
|
+
*Includes:*
|
|
99
|
+
|
|
100
|
+
* File structure
|
|
101
|
+
* Schema change format
|
|
102
|
+
* Version change format
|
|
103
|
+
* Item change types
|
|
104
|
+
* Validation rules
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
=== link:schema-manifest.html[Schema Manifest Format]
|
|
109
|
+
|
|
110
|
+
Format specification for schema manifest files.
|
|
111
|
+
|
|
112
|
+
*Describes:*
|
|
113
|
+
|
|
114
|
+
* YAML structure
|
|
115
|
+
* Entry attributes
|
|
116
|
+
* Optional fields
|
|
117
|
+
* Usage patterns
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
=== link:benchmarking.html[Benchmarking Reference]
|
|
122
|
+
|
|
123
|
+
Complete benchmarking configuration reference.
|
|
124
|
+
|
|
125
|
+
*Details:*
|
|
126
|
+
|
|
127
|
+
* Environment variables
|
|
128
|
+
* Configuration options
|
|
129
|
+
* Output formats
|
|
130
|
+
* Performance metrics
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
=== link:configuration.html[Configuration Reference]
|
|
135
|
+
|
|
136
|
+
All configuration options for Expressir.
|
|
137
|
+
|
|
138
|
+
*Includes:*
|
|
139
|
+
|
|
140
|
+
* Global configuration
|
|
141
|
+
* Environment variables
|
|
142
|
+
* Programmatic configuration
|
|
143
|
+
* Default values
|
|
144
|
+
|
|
145
|
+
== Using These References
|
|
146
|
+
|
|
147
|
+
=== Quick Lookup
|
|
148
|
+
|
|
149
|
+
Use these references when you need to:
|
|
150
|
+
|
|
151
|
+
* Find the exact syntax for a CLI command
|
|
152
|
+
* Look up a specific API method signature
|
|
153
|
+
* Check which attributes are available in a Liquid drop
|
|
154
|
+
* Understand a file format specification
|
|
155
|
+
* Configure environment variables
|
|
156
|
+
|
|
157
|
+
=== Navigation Tips
|
|
158
|
+
|
|
159
|
+
* Use the built-in search to find specific terms
|
|
160
|
+
* Click on section headings to get direct links
|
|
161
|
+
* Use the table of contents on each page
|
|
162
|
+
* Reference pages link to related documentation
|
|
163
|
+
|
|
164
|
+
=== API Documentation Conventions
|
|
165
|
+
|
|
166
|
+
*Method signatures* use this format:
|
|
167
|
+
|
|
168
|
+
[source,ruby]
|
|
169
|
+
----
|
|
170
|
+
method_name(required_param, optional: 'default') → return_type
|
|
171
|
+
----
|
|
172
|
+
|
|
173
|
+
*Parameters* are documented with:
|
|
174
|
+
|
|
175
|
+
* Name and type
|
|
176
|
+
* Whether required or optional
|
|
177
|
+
* Default value (if optional)
|
|
178
|
+
* Description of purpose
|
|
179
|
+
|
|
180
|
+
*Return values* specify:
|
|
181
|
+
|
|
182
|
+
* Type returned
|
|
183
|
+
* Possible values
|
|
184
|
+
* Nil conditions
|
|
185
|
+
|
|
186
|
+
=== Example Usage
|
|
187
|
+
|
|
188
|
+
Suppose you want to use the `from_file` parser method:
|
|
189
|
+
|
|
190
|
+
. Navigate to link:ruby-api.html[Ruby API Reference]
|
|
191
|
+
. Find the Parser section
|
|
192
|
+
. Look up `from_file` method
|
|
193
|
+
. Read the method signature and parameters
|
|
194
|
+
. Check the examples
|
|
195
|
+
. Try it in your code
|
|
196
|
+
|
|
197
|
+
== Related Documentation
|
|
198
|
+
|
|
199
|
+
*For learning:*
|
|
200
|
+
|
|
201
|
+
* Start with link:../../[Core Topics] to understand concepts
|
|
202
|
+
* Try link:../../tutorials/[Tutorials] for hands-on practice
|
|
203
|
+
|
|
204
|
+
*For tasks:*
|
|
205
|
+
|
|
206
|
+
* Use link:../../guides/[Guides] for step-by-step instructions
|
|
207
|
+
* Return here for detailed specifications
|
|
208
|
+
|
|
209
|
+
== Contributing
|
|
210
|
+
|
|
211
|
+
Help improve these references:
|
|
212
|
+
|
|
213
|
+
* Report missing or incorrect information
|
|
214
|
+
* Suggest additional examples
|
|
215
|
+
* Clarify confusing descriptions
|
|
216
|
+
* Add missing API methods
|
|
217
|
+
|
|
218
|
+
See the https://github.com/lutaml/expressir/blob/main/CONTRIBUTING.md[Contributing Guide] for details.
|
|
219
|
+
|
|
220
|
+
== Versioning
|
|
221
|
+
|
|
222
|
+
These references document Expressir version **latest**.
|
|
223
|
+
|
|
224
|
+
For version-specific documentation:
|
|
225
|
+
|
|
226
|
+
* Check the gem version: `gem list expressir`
|
|
227
|
+
* Visit https://rubygems.org/gems/expressir[RubyGems] for older versions
|
|
228
|
+
* See the https://github.com/lutaml/expressir/blob/main/CHANGELOG.md[CHANGELOG] for version differences
|