datalog: rose-ash demo programs (Phase 10 syntactic, 153/153)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 41s

New lib/datalog/demo.sx with three Datalog-as-query-language demos
over synthetic rose-ash data:

  Federation: (mutual A B), (reachable A B), (foaf A C) over a
              follows graph.
  Content:    (post-likes P N) via count aggregation, (popular P)
              for likes >= 3, (interesting Me P) joining follows
              + authored + popular.
  Permissions: (in-group A G) over transitive subgroup chains,
              (can-access A R).

10 tests run each program against in-memory EDB tuples loaded via
dl-program-data.

Wiring to PostgreSQL and exposing as a service endpoint (/internal
/datalog) is out of scope for this loop — both would require
edits outside lib/datalog/. Programs above document the EDB shape
a real loader would populate.
This commit is contained in:
2026-05-08 08:45:59 +00:00
parent 3cc760082c
commit de302fc236
6 changed files with 315 additions and 14 deletions

View File

@@ -13,6 +13,7 @@ PRELOADS=(
lib/datalog/strata.sx
lib/datalog/eval.sx
lib/datalog/api.sx
lib/datalog/demo.sx
)
SUITES=(
@@ -25,4 +26,5 @@ SUITES=(
"negation:lib/datalog/tests/negation.sx:(dl-negation-tests-run!)"
"aggregates:lib/datalog/tests/aggregates.sx:(dl-aggregates-tests-run!)"
"api:lib/datalog/tests/api.sx:(dl-api-tests-run!)"
"demo:lib/datalog/tests/demo.sx:(dl-demo-tests-run!)"
)