semantic-db: change 2apply to bi@
parent
4d2cb451f3
commit
e8abcf8d85
|
@ -54,10 +54,10 @@ test-db [
|
|||
"charlie" create-node "charlie" set
|
||||
"gertrude" create-node "gertrude" set
|
||||
[ ] [ "bob" get "adam" get has-parent ] unit-test
|
||||
{ { "bob" "eve" } { "fran" "eve" } { "gertrude" "bob" } { "fran" "bob" } { "charlie" "fran" } } [ first2 [ get ] 2apply has-parent ] each
|
||||
{ { "bob" "eve" } { "fran" "eve" } { "gertrude" "bob" } { "fran" "bob" } { "charlie" "fran" } } [ first2 [ get ] bi@ has-parent ] each
|
||||
[ { "bob" "fran" } ] [ "eve" get has-parent-relation children [ node-content ] map ] unit-test
|
||||
[ { "adam" "eve" } ] [ "bob" get has-parent-relation parents [ node-content ] map ] unit-test
|
||||
[ "fran" { "charlie" } ] [ "fran" get has-parent-relation get-node-hierarchy dup node>> node-content swap children>> [ node>> node-content ] map ] unit-test
|
||||
[ "fran" { "charlie" } ] [ "fran" get has-parent-relation get-node-tree-s dup node>> node-content swap children>> [ node>> node-content ] map ] unit-test
|
||||
[ { "adam" "eve" } ] [ "charlie" get has-parent-relation get-root-nodes [ node-content ] map natural-sort >array ] unit-test
|
||||
[ { } ] [ "charlie" get dup "fran" get !has-parent has-parent-relation parents [ node-content ] map ] unit-test
|
||||
[ { "adam" "eve" } ] [ has-parent-relation ultimate-objects node-results [ node-content ] map ] unit-test
|
||||
|
|
|
@ -110,7 +110,7 @@ arc "arc"
|
|||
[ node-result ] map ;
|
||||
|
||||
: subjects-with-cor ( content object relation -- sql-results )
|
||||
[ id>> ] 2apply
|
||||
[ id>> ] bi@
|
||||
[
|
||||
":relation" INTEGER param ,
|
||||
":object" INTEGER param ,
|
||||
|
@ -119,7 +119,7 @@ arc "arc"
|
|||
"select n.id, n.content from node n, arc a where n.content = :content and n.id = a.subject and a.relation = :relation and a.object = :object" results ;
|
||||
|
||||
: objects-with-csr ( content subject relation -- sql-results )
|
||||
[ id>> ] 2apply
|
||||
[ id>> ] bi@
|
||||
[
|
||||
":relation" INTEGER param ,
|
||||
":subject" INTEGER param ,
|
||||
|
|
Loading…
Reference in New Issue