Re: Pilog faster than DB access?

2009-12-11 Thread cle
Hello Henrik, Henrik Sarvell wrote: > > I don't know exactly the circumstances of what you're trying to > achieve, ok, I will try to answer this in the next mail to Alex ... > but if I were you and needed to access by unique id I would > first use +Key in the relations: > > (rel id (+Key +Strin

Re: Pilog faster than DB access?

2009-12-11 Thread Henrik Sarvell
Sure, Pilog works fine if you have something more complex, but you get quite far with (db), (aux) and (collect). As far as src and tgt goes if they are not unique you can do for instance: (collect 'src '+Test "D" "D") Then you get all objects with D as src, I think you need to come up with someth

Re: Pilog faster than DB access?

2009-12-11 Thread cle
Alexander Burger wrote: > > Hi Cle, Hi Alex, > let me first correct some errors: > >> (pool test) > > This is a funny one. As the value of 'test' is a function > definition, you get a rather strange database file ;-) Ahhh ... this was a copy/paste error from the console into the mail. My DB fi

Re: Pilog faster than DB access?

2009-12-11 Thread Alexander Burger
Hi Cle, > > but if I were you and needed to access by unique id I would > > first use +Key in the relations: > > > > (rel id (+Key +String)) > > Ah, that makes sense! But it will only work for my id relation ... but I > will also access them by 'src' and 'tgt'. Please note that '+Key' will not c

Re: Pilog faster than DB access?

2009-12-11 Thread Alexander Burger
Hi Henrik, > Sure, Pilog works fine if you have something more complex, but you get > quite far with (db), (aux) and (collect). As far as src and tgt goes > if they are not unique you can do for instance: > > (collect 'src '+Test "D" "D") > > Then you get all objects with D as src, I think you ne

Re: Pilog faster than DB access?

2009-12-11 Thread Alexander Burger
Hi Cle, > Ahhh ... this was a copy/paste error from the console into the mail. My > DB file was named "test" :-) > ... > Ahhh not for me ... as I am working within another directory parallel to > picoLisp ;-) I see. This explains it ;-) > > If 'new' is called this way, it will not create databa

Re: Pilog faster than DB access?

2009-12-11 Thread cle
Henrik Sarvell wrote: > > Sure, Pilog works fine if you have something more complex, but you > get quite far with (db), (aux) and (collect). (...) > Then you get all objects with D as src, I think you need to come up > with something more complex in order to actually get to a reasonable > real-

Re: Pilog faster than DB access?

2009-12-11 Thread cle
Alexander Burger wrote: > > Hi Cle, Hi Alex, (...) >>> If 'new' is called this way, it will not create database objects >>> but >> >> ... :-O But ... but ... but ... URGHS! :-( I had looked especially >> into the "x.db" file and found my keys "1", "11" and "111" there. >> So I thought > > Righ

Re: Pilog faster than DB access?

2009-12-11 Thread Alexander Burger
Hi Cle, > Ok, here comes my story! Currently there is an application/tool written > ... ># (Edge id fromNode toNode) >(be edge ("ts1" "end#1" "points#1")) >(be edge ("ts2" "points#1" "points#2")) >(be edge ("ts3" "points#1" "points#2")) >(be edge ("ts4" "points#2" "end#2")) >

Re: Pilog faster than DB access?

2009-12-11 Thread Alexander Burger
Hi Cle, > Nice idea! Now I reformulated my Pilog rules for usage with database > like this: > >(be graph:walk (@Begin @Way) > (@E db 'id '+DB:Edge (-> @Begin)) > (@To get (-> @E) 'tgt) > (graph:walk @To (@Begin) @Way) >) > >(be graph:walk (@Node @Way @Way)) > >(be

Re: Pilog faster than DB access?

2009-12-11 Thread cle
Alexander Burger wrote: > Hi Cle, > > >> Nice idea! Now I reformulated my Pilog rules for usage with database >> like this: >> >>(be graph:walk (@Begin @Way) >> (@E db 'id '+DB:Edge (-> @Begin)) >> (@To get (-> @E) 'tgt) >> (graph:walk @To (@Begin) @Way) >>) >> >>(be

Re: Pilog faster than DB access?

2009-12-11 Thread Alexander Burger
Hi Cle, > To rephrase the chinese sentence once more: your solution was exactly > the same as I came up with my first attempt. But due to the fact, I use > '+String' for all fields, the Pilog 'db' clause did find the wrong > solutions. To handle that, I did introduce a 'equal' check then. But Rig