diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-07 23:26:50 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-07 23:26:50 -0300 |
| commit | 483089803a411920fea7696ea6b40c664cf3003a (patch) | |
| tree | 7ac682a41db96203fc1bd7d5e1ed6daa76c93c4e /lib/kernel/SubstantialRelation.ml | |
| parent | 4c0c69dc571577e9c3ae68830c042cfaada603ae (diff) | |
| download | RNT-483089803a411920fea7696ea6b40c664cf3003a.tar.gz RNT-483089803a411920fea7696ea6b40c664cf3003a.zip | |
ephemeral literal, relation heading, subs rel stored & lmdb 1GB map
Diffstat (limited to 'lib/kernel/SubstantialRelation.ml')
| -rw-r--r-- | lib/kernel/SubstantialRelation.ml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/kernel/SubstantialRelation.ml b/lib/kernel/SubstantialRelation.ml index 57bb79e..533893c 100644 --- a/lib/kernel/SubstantialRelation.ml +++ b/lib/kernel/SubstantialRelation.ml @@ -134,6 +134,22 @@ module Make (S : Abstract.Storage.STORAGE) = struct |> Result.map (fun description -> new substantial_relation connection relation description |> Protocols.Handle.make ) + let store tx description tuples = + let open Utilities.Result in + let* schematics = store_schema tx description in + let* _ = TupleSet.empty_under tx in + let* node = + TupleSet.with_batch tx (fun () -> + List.fold_left + (fun node tuple -> + let* node = node in + TupleSet.insert tx (Concepts.Tuple.hash tuple) tuple node ) + (Ok TupleSet.empty) tuples ) + in + let relation = {schematics; tuples= TupleSet.hash_of node} in + let* _ = SI.store_blob tx (encode relation) in + Ok relation + let instantiate connection ~schematics = let open Utilities.Result in let* relation = |
