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.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/docs.yml +98 -0
  3. data/.github/workflows/links.yml +100 -0
  4. data/.github/workflows/rake.yml +4 -0
  5. data/.github/workflows/release.yml +5 -0
  6. data/.github/workflows/validate_schemas.yml +1 -1
  7. data/.gitignore +3 -0
  8. data/.rubocop.yml +1 -1
  9. data/.rubocop_todo.yml +244 -39
  10. data/Gemfile +2 -1
  11. data/README.adoc +621 -54
  12. data/docs/Gemfile +12 -0
  13. data/docs/_config.yml +141 -0
  14. data/docs/_guides/changes/changes-format.adoc +778 -0
  15. data/docs/_guides/changes/importing-eengine.adoc +898 -0
  16. data/docs/_guides/changes/index.adoc +396 -0
  17. data/docs/_guides/changes/programmatic-usage.adoc +1038 -0
  18. data/docs/_guides/changes/validating-changes.adoc +681 -0
  19. data/docs/_guides/cli/benchmark-performance.adoc +834 -0
  20. data/docs/_guides/cli/coverage-analysis.adoc +921 -0
  21. data/docs/_guides/cli/format-schemas.adoc +547 -0
  22. data/docs/_guides/cli/index.adoc +8 -0
  23. data/docs/_guides/cli/managing-changes.adoc +927 -0
  24. data/docs/_guides/cli/validate-ascii.adoc +645 -0
  25. data/docs/_guides/cli/validate-schemas.adoc +534 -0
  26. data/docs/_guides/index.adoc +165 -0
  27. data/docs/_guides/ler/creating-packages.adoc +664 -0
  28. data/docs/_guides/ler/index.adoc +305 -0
  29. data/docs/_guides/ler/loading-packages.adoc +707 -0
  30. data/docs/_guides/ler/package-formats.adoc +748 -0
  31. data/docs/_guides/ler/querying-packages.adoc +826 -0
  32. data/docs/_guides/ler/validating-packages.adoc +750 -0
  33. data/docs/_guides/liquid/basic-templates.adoc +813 -0
  34. data/docs/_guides/liquid/documentation-generation.adoc +1042 -0
  35. data/docs/_guides/liquid/drops-reference.adoc +829 -0
  36. data/docs/_guides/liquid/filters-and-tags.adoc +912 -0
  37. data/docs/_guides/liquid/index.adoc +468 -0
  38. data/docs/_guides/manifests/creating-manifests.adoc +483 -0
  39. data/docs/_guides/manifests/index.adoc +307 -0
  40. data/docs/_guides/manifests/resolving-manifests.adoc +557 -0
  41. data/docs/_guides/manifests/validating-manifests.adoc +713 -0
  42. data/docs/_guides/ruby-api/formatting-schemas.adoc +605 -0
  43. data/docs/_guides/ruby-api/index.adoc +257 -0
  44. data/docs/_guides/ruby-api/parsing-files.adoc +421 -0
  45. data/docs/_guides/ruby-api/search-engine.adoc +609 -0
  46. data/docs/_guides/ruby-api/working-with-repository.adoc +577 -0
  47. data/docs/_pages/data-model.adoc +665 -0
  48. data/docs/_pages/express-language.adoc +506 -0
  49. data/docs/_pages/getting-started.adoc +414 -0
  50. data/docs/_pages/index.adoc +116 -0
  51. data/docs/_pages/introduction.adoc +256 -0
  52. data/docs/_pages/ler-packages.adoc +837 -0
  53. data/docs/_pages/parsers.adoc +683 -0
  54. data/docs/_pages/schema-manifests.adoc +431 -0
  55. data/docs/_references/index.adoc +228 -0
  56. data/docs/_tutorials/creating-ler-package.adoc +735 -0
  57. data/docs/_tutorials/documentation-coverage.adoc +795 -0
  58. data/docs/_tutorials/index.adoc +221 -0
  59. data/docs/_tutorials/liquid-templates.adoc +806 -0
  60. data/docs/_tutorials/parsing-your-first-schema.adoc +522 -0
  61. data/docs/_tutorials/querying-schemas.adoc +751 -0
  62. data/docs/_tutorials/working-with-multiple-schemas.adoc +676 -0
  63. data/docs/index.adoc +242 -0
  64. data/docs/lychee.toml +84 -0
  65. data/examples/demo_ler_usage.sh +86 -0
  66. data/examples/ler/README.md +111 -0
  67. data/examples/ler/simple_example.ler +0 -0
  68. data/examples/ler/simple_schema.exp +33 -0
  69. data/examples/ler_build.rb +75 -0
  70. data/examples/ler_cli.rb +79 -0
  71. data/examples/ler_demo_complete.rb +276 -0
  72. data/examples/ler_query.rb +91 -0
  73. data/examples/ler_query_examples.rb +305 -0
  74. data/examples/ler_stats.rb +81 -0
  75. data/examples/phase3_demo.rb +159 -0
  76. data/examples/query_demo_simple.rb +131 -0
  77. data/expressir.gemspec +2 -0
  78. data/lib/expressir/cli.rb +12 -4
  79. data/lib/expressir/commands/manifest.rb +427 -0
  80. data/lib/expressir/commands/package.rb +1274 -0
  81. data/lib/expressir/commands/validate.rb +70 -37
  82. data/lib/expressir/commands/validate_ascii.rb +607 -0
  83. data/lib/expressir/commands/validate_load.rb +88 -0
  84. data/lib/expressir/express/formatter.rb +5 -1
  85. data/lib/expressir/express/formatters/remark_item_formatter.rb +25 -0
  86. data/lib/expressir/express/parser.rb +33 -0
  87. data/lib/expressir/manifest/resolver.rb +213 -0
  88. data/lib/expressir/manifest/validator.rb +195 -0
  89. data/lib/expressir/model/declarations/entity.rb +6 -0
  90. data/lib/expressir/model/dependency_resolver.rb +270 -0
  91. data/lib/expressir/model/indexes/entity_index.rb +103 -0
  92. data/lib/expressir/model/indexes/reference_index.rb +148 -0
  93. data/lib/expressir/model/indexes/type_index.rb +149 -0
  94. data/lib/expressir/model/interface_validator.rb +384 -0
  95. data/lib/expressir/model/repository.rb +400 -5
  96. data/lib/expressir/model/repository_validator.rb +295 -0
  97. data/lib/expressir/model/search_engine.rb +525 -0
  98. data/lib/expressir/model.rb +4 -94
  99. data/lib/expressir/package/builder.rb +200 -0
  100. data/lib/expressir/package/metadata.rb +81 -0
  101. data/lib/expressir/package/reader.rb +165 -0
  102. data/lib/expressir/schema_manifest.rb +11 -1
  103. data/lib/expressir/version.rb +1 -1
  104. data/lib/expressir.rb +15 -2
  105. metadata +114 -4
  106. data/docs/benchmarking.adoc +0 -107
  107. data/docs/liquid_drops.adoc +0 -1547
@@ -0,0 +1,305 @@
1
+ ---
2
+ title: LER Packages
3
+ nav_order: 3
4
+ has_children: true
5
+ ---
6
+
7
+ = LER Packages
8
+
9
+ == Purpose
10
+
11
+ LER (Lutaml EXPRESS Repository) packages provide a binary format for
12
+ distributing EXPRESS schemas as self-contained, optimized files. LER packages
13
+ offer faster loading times, smaller file sizes, and built-in indexes for
14
+ efficient querying.
15
+
16
+ == What is a LER package?
17
+
18
+ A LER package (`.ler` file) is a ZIP archive containing:
19
+
20
+ * Serialized EXPRESS schemas (in Marshal, JSON, or YAML format)
21
+ * Pre-built indexes for fast entity and type lookups
22
+ * Schema manifest describing all included schemas
23
+ * Metadata about the package and its contents
24
+ * Optional original EXPRESS source files
25
+
26
+ == Benefits of LER packages
27
+
28
+ === Performance improvements
29
+
30
+ Faster loading:: Parsing EXPRESS schemas is CPU-intensive. LER packages contain
31
+ pre-parsed model objects that load instantly.
32
+ +
33
+ .Loading time comparison
34
+ [example]
35
+ ====
36
+ * Parsing 100 EXPRESS files: ~45 seconds
37
+ * Loading equivalent LER package: ~2 seconds
38
+ * **Speed improvement: ~22x faster**
39
+ ====
40
+
41
+ Pre-built indexes:: Entity and type indexes are included, eliminating the need
42
+ to build them on load.
43
+
44
+ === Size reduction
45
+
46
+ Binary serialization:: Marshal format provides compact binary serialization,
47
+ typically 40-60% smaller than source EXPRESS files.
48
+
49
+ Compressed storage:: ZIP compression further reduces file size by 60-80%.
50
+
51
+ .Size comparison example
52
+ [example]
53
+ ====
54
+ * Source EXPRESS files: 15 MB
55
+ * Uncompressed LER (Marshal): 6 MB
56
+ * Compressed LER package: 1.2 MB
57
+ * **Size reduction: 92% smaller**
58
+ ====
59
+
60
+ === Reliability improvements
61
+
62
+ Single file distribution:: All schemas in one file eliminates missing
63
+ dependencies.
64
+
65
+ Resolved references:: All `USE FROM` and `REFERENCE FROM` statements are
66
+ pre-resolved.
67
+
68
+ Validated content:: Packages can be validated before distribution to ensure
69
+ completeness.
70
+
71
+ == Package structure
72
+
73
+ A typical LER package contains:
74
+
75
+ [source]
76
+ ----
77
+ example.ler (ZIP archive)
78
+ ├── metadata.yaml # Package metadata and configuration
79
+ ├── manifest.yaml # Schema manifest with file list
80
+ ├── repository.marshal # Serialized repository (binary)
81
+ ├── entity_index.marshal # Pre-built entity index
82
+ ├── type_index.marshal # Pre-built type index
83
+ ├── reference_index.marshal # Pre-built reference index
84
+ └── express_files/ # Optional EXPRESS source files
85
+ ├── schema1.exp
86
+ ├── schema2.exp
87
+ └── schema3.exp
88
+ ----
89
+
90
+ == When to use LER packages
91
+
92
+ === Production deployments
93
+
94
+ Use LER packages when:
95
+
96
+ * Deploying applications that load schemas repeatedly
97
+ * Distributing schema sets to end users
98
+ * Building services that need fast startup times
99
+ * Working with large schema collections (50+ files)
100
+
101
+ === Development workflows
102
+
103
+ Continue using EXPRESS files when:
104
+
105
+ * Actively developing schemas
106
+ * Making frequent changes
107
+ * Debugging schema content
108
+ * Working with version control systems
109
+
110
+ === Hybrid approach
111
+
112
+ Many projects use both:
113
+
114
+ 1. Develop with EXPRESS files under version control
115
+ 2. Build LER packages for testing and production
116
+ 3. Automate package creation in CI/CD pipelines
117
+
118
+ == Package modes
119
+
120
+ === Resolution modes
121
+
122
+ `resolved` (default):: All references between schemas are resolved and stored
123
+ in the package. Recommended for most use cases.
124
+
125
+ `bare`:: Schemas stored without reference resolution. Requires reference
126
+ resolution on load. Rarely used.
127
+
128
+ === Express bundling modes
129
+
130
+ `include_all` (default):: Includes original EXPRESS files in the package.
131
+ Useful for documentation and debugging.
132
+
133
+ `allow_external`:: Allows schemas to reference external EXPRESS files not
134
+ included in the package. Requires external files at load time.
135
+
136
+ === Serialization formats
137
+
138
+ `marshal` (default):: Ruby's native binary serialization. Fastest loading,
139
+ most compact, but Ruby-specific.
140
+
141
+ `yaml`:: Human-readable YAML format. Slower loading, larger files, but
142
+ portable and debuggable.
143
+
144
+ `json`:: JSON format. Similar to YAML but with wider tool support.
145
+
146
+ == Common workflows
147
+
148
+ === Development to production
149
+
150
+ [source]
151
+ ----
152
+ 1. Develop schemas in EXPRESS format
153
+ 2. Test changes locally
154
+ 3. Validate schemas
155
+ 4. Build LER package
156
+ 5. Deploy package to production
157
+ ----
158
+
159
+ === Continuous integration
160
+
161
+ [source]
162
+ ----
163
+ on: push
164
+ - Parse all schemas
165
+ - Run tests
166
+ - Validate coverage
167
+ - Build LER package
168
+ - Publish as artifact
169
+ ----
170
+
171
+ === Distribution workflow
172
+
173
+ [source]
174
+ ----
175
+ 1. Build comprehensive LER package
176
+ 2. Test package integrity
177
+ 3. Generate documentation
178
+ 4. Publish to distribution channel
179
+ 5. Users download and use package
180
+ ----
181
+
182
+ == Package operations
183
+
184
+ The following operations are available for LER packages:
185
+
186
+ Building:: link:creating-packages.html[Create packages from schemas]
187
+ Loading:: link:loading-packages.html[Load packages into applications]
188
+ Querying:: link:querying-packages.html[Search and filter package contents]
189
+ Validating:: link:validating-packages.html[Verify package integrity]
190
+ Formats:: link:package-formats.html[Choose serialization formats]
191
+
192
+ == Performance considerations
193
+
194
+ === Memory usage
195
+
196
+ LER packages load the entire repository into memory:
197
+
198
+ * Small packages (<100 schemas): Negligible impact
199
+ * Medium packages (100-500 schemas): 50-200 MB RAM
200
+ * Large packages (>500 schemas): 200-500 MB RAM
201
+
202
+ Consider memory constraints when building packages for resource-limited
203
+ environments.
204
+
205
+ === Load time factors
206
+
207
+ Factors affecting load time:
208
+
209
+ * Serialization format (Marshal > YAML > JSON for speed)
210
+ * Package size (number of schemas and entities)
211
+ * Disk I/O speed
212
+ * Whether indexes are pre-built
213
+
214
+ === Build time optimization
215
+
216
+ Building packages is slower than loading them:
217
+
218
+ * Parse time: Same as normal parsing
219
+ * Serialization time: Depends on format
220
+ * Index building time: Linear with schema count
221
+ * Compression time: Depends on ZIP algorithm
222
+
223
+ Build packages in CI/CD rather than on-demand.
224
+
225
+ == CLI vs API usage
226
+
227
+ === Command-line interface
228
+
229
+ Best for:
230
+
231
+ * One-off operations
232
+ * Scripts and automation
233
+ * Interactive exploration
234
+ * CI/CD pipelines
235
+
236
+ .Example commands
237
+ [example]
238
+ ====
239
+ [source,bash]
240
+ ----
241
+ # Build package
242
+ expressir package build schemas/ output.ler
243
+
244
+ # Query package
245
+ expressir package list output.ler --type entity
246
+
247
+ # Validate package
248
+ expressir package validate output.ler --strict
249
+ ----
250
+ ====
251
+
252
+ === Ruby API
253
+
254
+ Best for:
255
+
256
+ * Application integration
257
+ * Programmatic workflows
258
+ * Custom processing
259
+ * Building tools
260
+
261
+ .Example code
262
+ [example]
263
+ ====
264
+ [source,ruby]
265
+ ----
266
+ # Build package
267
+ repository.export_to_package("output.ler")
268
+
269
+ # Load package
270
+ repository = Expressir::Model::Repository.from_package("output.ler")
271
+
272
+ # Query package
273
+ entities = repository.list_entities
274
+ ----
275
+ ====
276
+
277
+ == Next steps
278
+
279
+ Explore detailed guides for working with LER packages:
280
+
281
+ * link:creating-packages.html[Creating Packages] - Build LER packages
282
+ * link:loading-packages.html[Loading Packages] - Load and use packages
283
+ * link:querying-packages.html[Querying Packages] - Search package contents
284
+ * link:validating-packages.html[Validating Packages] - Verify package integrity
285
+ * link:package-formats.html[Package Formats] - Choose serialization formats
286
+
287
+ == Summary
288
+
289
+ LER packages provide significant performance and usability benefits:
290
+
291
+ * 20-30x faster loading than parsing EXPRESS files
292
+ * 80-95% smaller than source files
293
+ * Self-contained with resolved dependencies
294
+ * Pre-built indexes for efficient querying
295
+ * Multiple serialization format options
296
+ * Suitable for production deployments
297
+
298
+ Key takeaways:
299
+
300
+ * Use LER packages for production and distribution
301
+ * Develop with EXPRESS files, deploy with LER packages
302
+ * Marshal format offers best performance
303
+ * Include EXPRESS files for debugging capability
304
+ * Validate packages before deployment
305
+ * Automate package creation in CI/CD pipelines