diff --git a/cozo-core/src/runtime/tests.rs b/cozo-core/src/runtime/tests.rs index 8b75066e..29613162 100644 --- a/cozo-core/src/runtime/tests.rs +++ b/cozo-core/src/runtime/tests.rs @@ -139,8 +139,8 @@ fn test_classical() { .run_script( r#" parent[] <- [['joseph', 'jakob'], - ['jakob', 'issac'], - ['issac', 'abraham']] + ['jakob', 'isaac'], + ['isaac', 'abraham']] grandparent[gcld, gp] := parent[gcld, p], parent[p, gp] ?[who] := grandparent[who, 'abraham'] "#, diff --git a/cozo-lib-wasm/wasm-react-demo/src/App.js b/cozo-lib-wasm/wasm-react-demo/src/App.js index 1023ac8e..cd00ff2b 100644 --- a/cozo-lib-wasm/wasm-react-demo/src/App.js +++ b/cozo-lib-wasm/wasm-react-demo/src/App.js @@ -227,11 +227,17 @@ function App() {

Not sure what to run?

{ - setQueryText(`parent[] <- [['joseph', 'jakob'], - ['jakob', 'issac'], - ['issac', 'abraham']] -grandparent[gcld, gp] := parent[gcld, p], parent[p, gp] -?[who] := grandparent[who, 'abraham']`) + setQueryText(`parent[] <- [['abraham', 'isaac'], + ['isaac', 'jakob'], + ['jakob', 'joseph']] +grandparent[A, C] := parent[A, B], parent[B, C] +great_grandparent[A, D] := parent[A, B], parent[B, C], parent[C, D] + +# This is the output query +?[who] := great_grandparent['abraham', who] # => 'joseph' + +# Any position in the relation may be queried +# ?[who] := great_grandparent[who, 'joseph'] # => 'abraham'`) }}>Here is a classical example recursive example.