mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
graph: improved type naming
This commit is contained in:
parent
39933ca848
commit
233b61199d
@ -28,6 +28,7 @@
|
||||
+* this .
|
||||
def ~(. (default-agent this %|) bowl)
|
||||
grp ~(. group bowl)
|
||||
gra ~(. graph bowl)
|
||||
::
|
||||
++ on-init on-init:def
|
||||
++ on-save !>(~)
|
||||
@ -88,9 +89,10 @@
|
||||
?> (can-join:grp resource src.bowl)
|
||||
?~ path
|
||||
:: new subscribe
|
||||
=/ =graph:store (get-graph:graph resource)
|
||||
=/ [=graph:store mark=(unit mark:store)]
|
||||
(get-graph:gra resource)
|
||||
!> ^- update:store
|
||||
[%0 now.bowl [%add-graph resource graph ~]]
|
||||
[%0 now.bowl [%add-graph resource graph mark]]
|
||||
:: resubscribe
|
||||
::
|
||||
:: TODO: use action-log
|
||||
|
@ -77,9 +77,6 @@
|
||||
%archive-graph (archive-graph +.q.update)
|
||||
%unarchive-graph (unarchive-graph +.q.update)
|
||||
%run-updates (run-updates +.q.update)
|
||||
::
|
||||
:: NOTE: cannot send these updates as pokes
|
||||
::
|
||||
%keys ~|('cannot send %keys as poke' !!)
|
||||
%tags ~|('cannot send %tags as poke' !!)
|
||||
%tag-queries ~|('cannot send %tag-queries as poke' !!)
|
||||
@ -95,7 +92,6 @@
|
||||
graphs (~(put by graphs) resource [graph mark])
|
||||
update-logs (~(put by update-logs) resource (gas:orm-log ~ ~))
|
||||
==
|
||||
^- (list card)
|
||||
%- zing
|
||||
:~ (give [/updates /keys ~] [%add-graph resource graph mark])
|
||||
?~ mark ~
|
||||
@ -437,23 +433,26 @@
|
||||
[%x %graph @ @ ~]
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
=/ =term i.t.t.t.path
|
||||
=/ graph=(unit [graph:store *]) (~(get by graphs) [ship term])
|
||||
?~ graph ~
|
||||
``noun+!>(-.u.graph)
|
||||
=/ result=(unit marked-graph:store)
|
||||
(~(get by graphs) [ship term])
|
||||
?~ result ~
|
||||
``noun+!>(u.result)
|
||||
::
|
||||
[%x %graph-subset @ @ @ @ ~]
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
=/ =term i.t.t.t.path
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
=/ =term i.t.t.t.path
|
||||
=/ start=(unit atom:store) (rush i.t.t.t.t.path dem:ag)
|
||||
=/ end=(unit atom:store) (rush i.t.t.t.t.t.path dem:ag)
|
||||
=/ graph=(unit [graph:store *]) (~(get by graphs) [ship term])
|
||||
=/ graph=(unit marked-graph:store)
|
||||
(~(get by graphs) [ship term])
|
||||
?~ graph ~
|
||||
``noun+!>(`graph:store`(subset:orm -.u.graph start end))
|
||||
``noun+!>(`graph:store`(subset:orm p.u.graph start end))
|
||||
::
|
||||
[%x %node @ @ @ *]
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
=/ =term i.t.t.t.path
|
||||
=/ =index:store (turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
=/ =term i.t.t.t.path
|
||||
=/ =index:store
|
||||
(turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||
=/ node=(unit node:store) (get-node ship term index)
|
||||
?~ node ~
|
||||
``noun+!>(u.node)
|
||||
@ -461,15 +460,17 @@
|
||||
[%x %post @ @ @ *]
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
=/ =term i.t.t.t.path
|
||||
=/ =index:store (turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||
=/ =index:store
|
||||
(turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||
=/ node=(unit node:store) (get-node ship term index)
|
||||
?~ node ~
|
||||
``noun+!>(post.u.node)
|
||||
::
|
||||
[%x %node-children @ @ @ *]
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
=/ =term i.t.t.t.path
|
||||
=/ =index:store (turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
=/ =term i.t.t.t.path
|
||||
=/ =index:store
|
||||
(turn t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||
=/ node=(unit node:store) (get-node ship term index)
|
||||
?~ node ~
|
||||
?- -.children.u.node
|
||||
@ -478,11 +479,12 @@
|
||||
==
|
||||
::
|
||||
[%x %node-children-subset @ @ @ @ @ *]
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
=/ =term i.t.t.t.path
|
||||
=/ =ship (slav %p i.t.t.path)
|
||||
=/ =term i.t.t.t.path
|
||||
=/ start=(unit atom:store) (rush i.t.t.t.t.path dem:ag)
|
||||
=/ end=(unit atom:store) (rush i.t.t.t.t.t.path dem:ag)
|
||||
=/ =index:store (turn t.t.t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||
=/ =index:store
|
||||
(turn t.t.t.t.t.t.path |=(=cord (slav %ud cord)))
|
||||
=/ node=(unit node:store) (get-node ship term index)
|
||||
?~ node ~
|
||||
?- -.children.u.node
|
||||
@ -511,10 +513,11 @@
|
||||
++ get-node
|
||||
|= [=ship =term =index:store]
|
||||
^- (unit node:store)
|
||||
=/ parent-graph=(unit [graph:store *]) (~(get by graphs) [ship term])
|
||||
=/ parent-graph=(unit marked-graph:store)
|
||||
(~(get by graphs) [ship term])
|
||||
?~ parent-graph ~
|
||||
=/ node=(unit node:store) ~
|
||||
=/ =graph:store -.u.parent-graph
|
||||
=/ =graph:store p.u.parent-graph
|
||||
|-
|
||||
?~ index
|
||||
node
|
||||
|
@ -1,7 +1,7 @@
|
||||
/+ view=graph-view
|
||||
/+ store=graph-store
|
||||
/+ sigs=signatures
|
||||
/+ grph=graph
|
||||
/+ graph
|
||||
/+ default-agent
|
||||
/+ dbug
|
||||
~% %graph-view-top ..is ~
|
||||
@ -26,7 +26,7 @@
|
||||
|_ =bowl:gall
|
||||
+* this .
|
||||
def ~(. (default-agent this %|) bowl)
|
||||
gra ~(. grph bowl)
|
||||
gra ~(. graph bowl)
|
||||
::
|
||||
++ on-init
|
||||
^- (quip card _this)
|
||||
|
@ -13,8 +13,9 @@
|
||||
::
|
||||
++ get-graph
|
||||
|= res=resource
|
||||
^- graph:store
|
||||
(scry-for graph:store /graph/(scot %p entity.res)/[name.res])
|
||||
^- marked-graph:store
|
||||
%+ scry-for marked-graph:store
|
||||
/graph/(scot %p entity.res)/[name.res]
|
||||
::
|
||||
++ peek-log
|
||||
|= res=resource
|
||||
|
@ -8,13 +8,17 @@
|
||||
?> (check-balance:((ordered-map key value) ord) b)
|
||||
b
|
||||
::
|
||||
+$ mark term
|
||||
+$ graph ((mop atom node) gth)
|
||||
+$ node [=post children=internal-graph]
|
||||
+$ graphs (map resource [p=graph q=(unit mark)])
|
||||
+$ tag-queries (jug term resource)
|
||||
+$ update-log ((mop time logged-update) gth)
|
||||
+$ update-logs (map resource update-log)
|
||||
+$ mark term
|
||||
+$ graph ((mop atom node) gth)
|
||||
+$ marked-graph [p=graph q=(unit mark)]
|
||||
::
|
||||
+$ node [=post children=internal-graph]
|
||||
+$ graphs (map resource marked-graph)
|
||||
::
|
||||
+$ tag-queries (jug term resource)
|
||||
::
|
||||
+$ update-log ((mop time logged-update) gth)
|
||||
+$ update-logs (map resource update-log)
|
||||
::
|
||||
+$ internal-graph
|
||||
$~ [%empty ~]
|
||||
|
Loading…
Reference in New Issue
Block a user