Skip to content

v0.3.2: GraphQL, temporal/Allen, RDF list, CSV/IO, range queries, API… - #58

Merged
thanos merged 5 commits into
mainfrom
v0.3.2/graphql-temporal-csv
Jun 26, 2026
Merged

thanos merged 5 commits into
mainfrom
v0.3.2/graphql-temporal-csv

Conversation

@thanos

@thanos thanos commented Jun 26, 2026 •

Copy link
Copy Markdown
Collaborator

… gaps

New WOQL operators (33):

  • Range queries (8): triple_slice, quad_slice, triple_slice_rev, quad_slice_rev, triple_next, quad_next, triple_previous, quad_previous
  • Temporal/Allen (19): interval, interval_start_duration, interval_duration_end, interval_relation, interval_relation_typed, date_duration, day_after, day_before, weekday, weekday_sunday_start, iso_week, month_start_date, month_end_date, month_start_dates, month_end_dates, in_range, sequence, range_min, range_max
  • CSV/IO (6): get, put, woql_as, file, remote, post

New modules:

  • TerminusDB.GraphQL: query/3, mutate/3, introspect/2 (net-new, ahead of Python)
  • TerminusDB.WOQL.RDFList: 17 RDF list manipulation functions
  • TerminusDB.Prefix: prefix CRUD (get, add, update, upsert, delete, all)
  • TerminusDB.Patch: struct with from_json, to_json, update, before, copy
  • TerminusDB.Triples: turtle API (get, update, insert)
  • TerminusDB.Remote: clone, fetch, push, pull
  • TerminusDB.Benchmark: benchmarking helpers + 5 benchee suites

Extended modules:

  • Branch: squash/2, reset/3
  • Database: optimize/2
  • Commit: document_history/3
  • Diff: diff_object/2, diff_version/2, patch/2, patch_resource/2, apply/3
  • WOQL: execute_stream/3 (streaming via PrefaceRecord/Binding/PostscriptRecord)

ADRs: 0009 (GraphQL), 0010 (temporal/Allen), 0011 (RDF list), 0012 (CSV/IO), 0013 (patch/apply)

Guides: graphql-guide, temporal-allen-guide, csv-import-guide, rdf-list-guide

Tests: 631 unit + 52 integration, 155 doctests, 9 properties, 93.4% coverage

thanos added 5 commits June 26, 2026 11:25
… gaps

New WOQL operators (33):
- Range queries (8): triple_slice, quad_slice, triple_slice_rev,
  quad_slice_rev, triple_next, quad_next, triple_previous, quad_previous
- Temporal/Allen (19): interval, interval_start_duration,
  interval_duration_end, interval_relation, interval_relation_typed,
  date_duration, day_after, day_before, weekday, weekday_sunday_start,
  iso_week, month_start_date, month_end_date, month_start_dates,
  month_end_dates, in_range, sequence, range_min, range_max
- CSV/IO (6): get, put, woql_as, file, remote, post

New modules:
- TerminusDB.GraphQL: query/3, mutate/3, introspect/2 (net-new, ahead of Python)
- TerminusDB.WOQL.RDFList: 17 RDF list manipulation functions
- TerminusDB.Prefix: prefix CRUD (get, add, update, upsert, delete, all)
- TerminusDB.Patch: struct with from_json, to_json, update, before, copy
- TerminusDB.Triples: turtle API (get, update, insert)
- TerminusDB.Remote: clone, fetch, push, pull
- TerminusDB.Benchmark: benchmarking helpers + 5 benchee suites

Extended modules:
- Branch: squash/2, reset/3
- Database: optimize/2
- Commit: document_history/3
- Diff: diff_object/2, diff_version/2, patch/2, patch_resource/2, apply/3
- WOQL: execute_stream/3 (streaming via PrefaceRecord/Binding/PostscriptRecord)

ADRs: 0009 (GraphQL), 0010 (temporal/Allen), 0011 (RDF list),
0012 (CSV/IO), 0013 (patch/apply)

Guides: graphql-guide, temporal-allen-guide, csv-import-guide, rdf-list-guide

Tests: 631 unit + 52 integration, 155 doctests, 9 properties, 93.4% coverage

-closed #32 Implement GraphQL thin wrapper | TerminusDB.GraphQL module
-closed #33 Implement Temporal/Allen WOQL
-closed #34 Implement RDF list library
-closed #35 Implement CSV/IO
-closed #36 Implement Range queries
-closed #37 Implement Prefix management
-closed #38 Implement Squash/Reset/Optimize
-closed #39 Implement Patch class + apply
-closed #40 Implement Document history
-closed #41 Implement Triples (turtle) API
-closed #42 Implement WOQL result streaming
-closed #43 Implement Clone/Fetch/Push/Pull
-closed #44 Implement Benchmarks
-closed #46 Implement  integration tests for Temporal/Allen
-closed #47 Implement  integration tests for Range queries
-closed #48 Implement  integration tests for CSV/IO
-closed #49 Implement  integration tests for RDF list library
-closed #50 Implement  integration tests for GraphQL
-closed #51 Implement  integration tests for Prefix management
-closed #52 Implement  integration tests for Triples (turtle)
-closed #53 Implement  integration tests for Patch + apply
-closed #54 Implement  integration tests for Squash/Reset/Optimize
-closed #55 Implement  integration tests for Document history
-closed #56 Implement  integration tests for WOQL streaming
-closed #57 Implement  integration tests for Clone/Fetch/Push/Pull
…rror handling

Critical (C1-C3):
- closed #59 C1: rdflist_nth variable-index crashed (v.dec missing from localize vars);
  added :dec/:first2/:rest2/:next2 vars, eval(minus) for decrement, unrolled
  recursion one level to avoid infinite Elixir recursion
- closed #60 C2: rdflist_slice silently ignored end_val; rewrote with proper start/end
  bounds using cell navigation + collect
- closed #61 C3: rdflist_swap was a no-op (read-only); added rdflist_cell_at helper and
  delete_triple/add_triple write operations for both cells

closed #62 High (H1-H3):
- H1: rdflist_drop operated on list head not cell at position; split into
  drop(0) head case and drop(n>0) with cell navigation + parent relink
- H2: woql_stream binary-body path used Enum.map (eager); replaced with
  Stream.map for lazy evaluation
- H3: woql_stream used Jason.decode!/1 (crash on malformed JSON); replaced
  with safe Jason.decode/1 returning {:stream_decode_error, ...}

closed #63 Medium (M1-M6):
- M1+M6: graphql_path and prefix_base_path raised on missing DB; refactored
  to return {:error, %Error{reason: :config}} matching execute/3 pattern
- M3: rdflist_push changed from /2 to /3 with new_head_var parameter;
  updated guide, doctest, and tests
- M4: rdflist_clear deletes wrapped inside opt(and_([triple, delete])) blocks
  to guard against unbound variables from failed optional binds
- M5: Documented Patch.before/update asymmetry in docstrings

closed #64 Low (L1-L5):
- L1: False positive — encode_data_list IS called by range_min/max encoders
- L2: Added encode_arithmetic clause for non-variable binary strings
- L3: Fixed guide overview.md insert_document/1 → /2, update_document/1 → /2
- L4: Benchmark.seed_database returns {config, db_name} for cleanup
- L5: Added structural AST assertions to RDFList tests (swap checks for
  AddTriple+DeleteTriple, drop checks for DeleteTriple, nth0 variable-index
  checks for RDFList_dec, slice checks no rdf:rest*, clear checks Optional)

also closed #65, closed #66, closd #67
…vebook.livemd:

1. Missing email field — Dave (line 196) and Eve (line 246) inserts were missing the required email field that the schema defines. Added "email" => "dave@example.com" and "email" => "eve@example.com".
2. Error struct alias — alias TerminusDB.Error doesn't work in .exs script context with Mix.install because the struct isn't available at compile time. Replaced %Error{...} pattern matching with %{...} map pattern matching.
3. Raising variant crashes before cleanup — Database.create!/3 on the duplicate DB crashed the process before the cleanup section. Wrapped in try/rescue to catch the expected error and continue.
4. Database creation without delete guard — Added if Database.exists? guard to delete any existing livebook_demo database before creating, preventing failures on re-runs.
5. Version bump — Mix.install version updated from ~> 0.1.0 to ~> 0.3.2 in the .livemd.
6. Unused variable warnings — Prefixed _updated_person and _frame to suppress harmless warnings.
…e branch (inserting "from-main"), so both branches have diverged from the common ancestor. This avoids the fast-forward edge case that triggers the 500.

2. Retry on 500 — The rebase endpoint in TerminusDB 12.0.6 intermittently returns 500 ("Unexpected failure in request handler"). The test now retries up to 3 times on 500 errors, passing through other errors immediately.
3. Stronger assertions — Verifies both "from-feature" and "from-main" are present after merge, confirming the rebase correctly applied both branches' commits.
@thanos
thanos merged commit 65dc11f into main Jun 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant