lutaml-store 0.2.2 → 0.3.0

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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +22 -13
  3. data/README.adoc +56 -0
  4. data/docs/astro.config.mjs +12 -0
  5. data/docs/package-lock.json +6098 -0
  6. data/docs/package.json +18 -0
  7. data/docs/public/favicon.svg +1 -0
  8. data/docs/public/lutaml-logo_logo-full-dark.svg +1 -0
  9. data/docs/public/lutaml-logo_logo-full-light.svg +1 -0
  10. data/docs/src/layouts/Base.astro +44 -0
  11. data/docs/src/layouts/Docs.astro +41 -0
  12. data/docs/src/pages/adapters.md +46 -0
  13. data/docs/src/pages/architecture.md +68 -0
  14. data/docs/src/pages/cloud-contract.md +48 -0
  15. data/docs/src/pages/formats.md +54 -0
  16. data/docs/src/pages/http-cache.md +43 -0
  17. data/docs/src/pages/index.md +82 -0
  18. data/docs/src/pages/quick-start.md +109 -0
  19. data/docs/src/pages/sources.md +83 -0
  20. data/docs/src/pages/stores.md +110 -0
  21. data/docs/src/styles/global.css +10 -0
  22. data/lib/lutaml/store/adapter/base.rb +28 -0
  23. data/lib/lutaml/store/adapter/memory.rb +213 -121
  24. data/lib/lutaml/store/adapter/sqlite.rb +181 -7
  25. data/lib/lutaml/store/database_store.rb +302 -49
  26. data/lib/lutaml/store/format.rb +13 -0
  27. data/lib/lutaml/store/manifest.rb +85 -0
  28. data/lib/lutaml/store/mirror.rb +94 -0
  29. data/lib/lutaml/store/predicate.rb +248 -0
  30. data/lib/lutaml/store/query.rb +259 -0
  31. data/lib/lutaml/store/repository.rb +178 -0
  32. data/lib/lutaml/store/source/base.rb +137 -0
  33. data/lib/lutaml/store/source/directory.rb +49 -0
  34. data/lib/lutaml/store/source/https.rb +109 -0
  35. data/lib/lutaml/store/source/rest.rb +61 -0
  36. data/lib/lutaml/store/source/zip.rb +52 -0
  37. data/lib/lutaml/store/source.rb +55 -0
  38. data/lib/lutaml/store/version.rb +1 -1
  39. data/lib/lutaml/store.rb +7 -0
  40. metadata +40 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4917f68f56456a19670424157dd5001d243b9bd6d97618f445d306a7998e2a9f
4
- data.tar.gz: 7076d765cf18cc91bfa9cf252bb0117ea8870c915bf1e7421648d9490de7e6a5
3
+ metadata.gz: 34e9babf679b2654a563c89d68552afd0b2d98d5725656eb9baa2f1a878a80f4
4
+ data.tar.gz: 599409d62bfe96b0e57147f620aef55ea88abe40b5183bdfb02511d3a91ea281
5
5
  SHA512:
6
- metadata.gz: 897f40bf4972373587528a80afcc44ab2b0c159f2bba63a97f39cb997eff97d3633d7e34cabeb0dac37e1b337781f0aef60b9ffaae2b3a3426d5624b35fb7950
7
- data.tar.gz: 1b79b56672ace97f0b6e57715b1b56b7f4638b1d426db57b8f57c5ed21eb461a7fd2ff4181f57afaa094d85c9b7da37f9e3d4771c04afecfcef0c268e86ddcd7
6
+ metadata.gz: 77f4022441c6b6ab2f63b5106a2ca3bba16abab82bf75adbe8569ec73a0eb6cd824891920e5571e7a2f7b39c9d56ac5bd2824418f24aa8577abf893645941062
7
+ data.tar.gz: dbe7804392b8b32135c77f3766b6976a8111a357b40bfdad563906d59205a0305dfd3f467b371ba423859a6ebbb8a7fa8d8baef905875a6097478763ed2d6b43
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-06-05 09:38:49 UTC using RuboCop version 1.87.0.
3
+ # on 2026-06-10 09:02:53 UTC using RuboCop version 1.87.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -11,54 +11,63 @@ Gemspec/RequiredRubyVersion:
11
11
  Exclude:
12
12
  - 'lutaml-store.gemspec'
13
13
 
14
- # Offense count: 29
14
+ # Offense count: 38
15
15
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
16
16
  Metrics/AbcSize:
17
17
  Max: 112
18
18
 
19
- # Offense count: 57
19
+ # Offense count: 63
20
20
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
21
21
  # AllowedMethods: refine
22
22
  Metrics/BlockLength:
23
23
  Max: 387
24
24
 
25
- # Offense count: 16
25
+ # Offense count: 17
26
26
  # Configuration parameters: CountComments, CountAsOne.
27
27
  Metrics/ClassLength:
28
- Max: 379
28
+ Max: 516
29
29
 
30
- # Offense count: 9
30
+ # Offense count: 15
31
31
  # Configuration parameters: AllowedMethods, AllowedPatterns.
32
32
  Metrics/CyclomaticComplexity:
33
- Max: 12
33
+ Max: 13
34
34
 
35
- # Offense count: 79
35
+ # Offense count: 89
36
36
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
37
37
  Metrics/MethodLength:
38
38
  Max: 84
39
39
 
40
- # Offense count: 5
40
+ # Offense count: 6
41
41
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
42
42
  Metrics/ParameterLists:
43
43
  Max: 8
44
44
 
45
- # Offense count: 4
45
+ # Offense count: 8
46
46
  # Configuration parameters: AllowedMethods, AllowedPatterns.
47
47
  Metrics/PerceivedComplexity:
48
- Max: 12
48
+ Max: 14
49
49
 
50
50
  # Offense count: 1
51
51
  Naming/AccessorMethodName:
52
52
  Exclude:
53
53
  - 'lib/lutaml/store/adapter/sqlite.rb'
54
54
 
55
- # Offense count: 3
55
+ # Offense count: 1
56
+ # This cop supports unsafe autocorrection (--autocorrect-all).
57
+ # Configuration parameters: EnforcedStyleForLeadingUnderscores.
58
+ # SupportedStylesForLeadingUnderscores: disallowed, required, optional
59
+ Naming/MemoizedInstanceVariableName:
60
+ Exclude:
61
+ - 'lib/lutaml/store/query.rb'
62
+
63
+ # Offense count: 4
56
64
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
57
65
  # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
58
66
  Naming/MethodParameterName:
59
67
  Exclude:
60
68
  - 'demo/vcard_models.rb'
61
69
  - 'demo/vcard_store_demo.rb'
70
+ - 'lib/lutaml/store/adapter/sqlite.rb'
62
71
 
63
72
  # Offense count: 1
64
73
  # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
@@ -84,7 +93,7 @@ Security/MarshalLoad:
84
93
  Exclude:
85
94
  - 'lib/lutaml/store/format/marshal_format.rb'
86
95
 
87
- # Offense count: 36
96
+ # Offense count: 51
88
97
  # Configuration parameters: AllowedConstants.
89
98
  Style/Documentation:
90
99
  Enabled: false
data/README.adoc CHANGED
@@ -17,8 +17,64 @@ It offers a unified interface for storing and retrieving complex model
17
17
  hierarchies, batch file I/O with multiple serialization formats, HTTP-aware
18
18
  caching, and package-based persistence with ZIP and directory transports.
19
19
 
20
+ It also provides **read-only Sources** for working with data repositories that
21
+ live outside your process — GitHub Pages, any static host, a REST API, a local
22
+ package directory, or a `.zip` distribution — through one facade that never
23
+ guesses which layer answered.
24
+
25
+ == Quick start: read a LutaML data repository
26
+
27
+ The same read API whether the data lives in the cloud, a local package, or a
28
+ downloaded `.zip` — backends are configured, never guessed:
29
+
30
+ [source,ruby]
31
+ ----
32
+ require "lutaml/store"
33
+
34
+ # From a cloud API (api.relaton.org is the reference implementation)
35
+ repo = Lutaml::Store::Repository.new(
36
+ source: Lutaml::Store::Source.for(:rest,
37
+ base_url: "https://api.relaton.org", collection: "ietf"),
38
+ cache: Lutaml::Store::Source.for(:directory, path: "~/.cache/relaton/ietf"),
39
+ )
40
+
41
+ # From a local GCR-style package — identical read API
42
+ repo = Lutaml::Store::Repository.new(
43
+ source: Lutaml::Store::Source.for(:directory, path: "~/gcr/relaton/ietf"),
44
+ )
45
+
46
+ # From a downloaded .zip distribution — same API
47
+ repo = Lutaml::Store::Repository.new(
48
+ source: Lutaml::Store::Source.for(:zip, path: "ietf.zip"),
49
+ )
50
+
51
+ # Read
52
+ repo.read("RFC 7231") # => bytes
53
+ repo.exist?("RFC 7231") # => true
54
+ repo.keys # => ["RFC 7231", ...]
55
+ repo.manifest # => Lutaml::Store::Manifest
56
+
57
+ # Parse into your model — the model class is declared, never inferred
58
+ repo.get("RFC 7231", MyModel)
59
+
60
+ # Search by metadata fields
61
+ repo.search(docid: "RFC 7231")
62
+
63
+ # Pull the whole collection into a local GCR-style package
64
+ repo.pull!(into: "~/gcr/relaton", collection: "ietf")
65
+
66
+ # Offline mode: never touch the source, serve from the local package only
67
+ offline = Lutaml::Store::Repository.new(source: repo.source, cache: repo.cache, mode: :offline)
68
+ offline.read("RFC 7231") # served from the cache, no network
69
+
70
+
71
+
20
72
  == Features
21
73
 
74
+ * **Repository** — the uniform facade: one read API over any source (cloud, local, zip), explicit cache, online/offline modes
75
+ * **Source** (read-only) — Directory, Zip, Https (ETag/304), Rest (the lutaml cloud store API); 404 = NotFoundError, transport = BackendError
76
+ * **Manifest** — the enumeration SSOT: keys, sha256 digests, opaque shard metadata
77
+ * **Mirror** — pull any source into a GCR-style package (incremental, digest-verified); pack to a distributable .zip
22
78
  * **DatabaseStore** — high-level CRUD with model registry, polymorphism, composites
23
79
  * **PackageStore** — structured multi-model packages with ZIP and directory transport
24
80
  * **BasicStore** — low-level key-value store with optional cache, events, monitoring
@@ -0,0 +1,12 @@
1
+ import { defineConfig } from "astro/config";
2
+ import vue from "@astrojs/vue";
3
+ import tailwindcss from "@tailwindcss/vite";
4
+
5
+ export default defineConfig({
6
+ site: "https://lutaml.github.io",
7
+ base: "/lutaml-store",
8
+ integrations: [vue()],
9
+ vite: {
10
+ plugins: [tailwindcss()],
11
+ },
12
+ });