Re: Pilog query across multiple classes

2019-11-23 Thread C K Kashyap
Cool ... I think I am getting a hang of it! Regards, Kashyap On Sat, Nov 23, 2019 at 10:04 AM Alexander Burger wrote: > On Sat, Nov 23, 2019 at 09:45:56AM -0800, C K Kashyap wrote: > > Quick follow up - I altered the tags like this - > > > > (class +Item +Entity) > > (rel ttl (+IdxFold +String))

Re: Pilog query across multiple classes

2019-11-23 Thread Alexander Burger
On Sat, Nov 23, 2019 at 09:45:56AM -0800, C K Kashyap wrote: > Quick follow up - I altered the tags like this - > > (class +Item +Entity) > (rel ttl (+IdxFold +String)) > (rel tgs (+List +Joint) itm (+Tag)) > (rel sts (+IdxFold +String)) > > (class +Tag +Entity) > (rel itm (+Joint) tgs (+Item)) >

Re: Pilog query across multiple classes

2019-11-23 Thread C K Kashyap
Got it. sorry I copied from the email. Quick follow up - I altered the tags like this - (class +Item +Entity) (rel ttl (+IdxFold +String)) (rel tgs (+List +Joint) itm (+Tag)) (rel sts (+IdxFold +String)) (class +Tag +Entity) (rel itm (+Joint) tgs (+Item)) (rel v (+Ref +Link) NIL +TagVal)

Re: Pilog query across multiple classes

2019-11-23 Thread Alexander Burger
On Sat, Nov 23, 2019 at 09:10:26AM -0800, C K Kashyap wrote: > Okay ... just to clarify. (collect 'nm '+Tag "BLUE" NIL T 'itm) is the > recommended way to get to all items for a given Tag. Well, yes, but this is the previous version which I wrote in a wrong way. To get all blue ones: (collect 'n

Re: Pilog query across multiple classes

2019-11-23 Thread C K Kashyap
Thanks Alex/Beneroth, Okay ... just to clarify. (collect 'nm '+Tag "BLUE" NIL T 'itm) is the recommended way to get to all items for a given Tag. I should perhaps use an indirection to +Tag class so that I do not repeat it every time. After some thinking it seems that perhaps I could just go with

Re: Pilog query across multiple classes

2019-11-23 Thread Alexander Burger
On Sat, Nov 23, 2019 at 05:11:15PM +0100, andr...@itship.ch wrote: > +Idx is for +String, actually a special variant of the general > non-unique index +Ref. Correct, makes sense only for strings, as it indexes substrings. > Now I'm currently unsure if +Ref and +Joint can be combined... might be

Re: Pilog query across multiple classes

2019-11-23 Thread andreas
Hi Kashyap Try: (rel tgs (+List +Ref +Joint) NIL itm (+Tag)) +Idx is for +String, actually a special variant of the general non-unique index +Ref. Be aware that the relation classes may have parameters - in same order as the prefix classes: (rel ( ... ) ... ) Now I'm currently unsure if +Ref

Re: Pilog query across multiple classes

2019-11-23 Thread Alexander Burger
On Sat, Nov 23, 2019 at 07:49:43AM -0800, C K Kashyap wrote: > How can I add +Idx to tgs? That should be possible right? No, it makes no sense to add an index to a +Joint. Because the object *is* already reachable via the joint's back link. What *does* make sense is (+Ref +Link), which is equival

Re: Pilog query across multiple classes

2019-11-23 Thread C K Kashyap
Thanks Alex, How can I add +Idx to tgs? That should be possible right? When I add +Idx to tgs, I get "tgs -- No Link" error. Regards, Kashyap On Fri, Nov 22, 2019 at 11:07 PM Alexander Burger wrote: > Hi Kashyap, > > > (collect 'tgs '+Item (db 'nm '+Tag "BLUE")) does not seem to work for > me -

Re: Pilog query across multiple classes

2019-11-22 Thread Alexander Burger
Hi Kashyap, > (collect 'tgs '+Item (db 'nm '+Tag "BLUE")) does not seem to work for me - Sorry, my fault! I did not test. > returns NIL. For that matter, even (collect 'tgs '+Item) returns NIL. I > wonder if its because 'tgs does not have +Idx in the relation > > (class +Item +Entity) > (rel t

Re: Pilog query across multiple classes

2019-11-22 Thread C K Kashyap
No problem Alex, (collect 'tgs '+Item (db 'nm '+Tag "BLUE")) does not seem to work for me - returns NIL. For that matter, even (collect 'tgs '+Item) returns NIL. I wonder if its because 'tgs does not have +Idx in the relation (class +Item +Entity) (rel ttl (+IdxFold +String)) (rel tgs (+List +J

Re: Pilog query across multiple classes

2019-11-21 Thread Alexander Burger
Hi Kashyap, sorry, I was busy! I did not find the time to install and deeply check all your code. > 1. Query all open items that have the given tag >> I think I have a workaround for my question 1 :) - if I use the status as >> an inline relation instead of a link that is. I think it makes no

Re: Pilog query across multiple classes

2019-11-21 Thread C K Kashyap
Okay - I've got the answer to the second question as well. I am not sure of the efficiency though - I essentially collect all items that have the tag RED and then collect all the items that have the BLUE and then do "sect" on the output lists. Is this reasonable? (setq L1 (mapcar '( (I) (get I 'i

Re: Pilog query across multiple classes

2019-11-21 Thread C K Kashyap
Hi Alex, I think I have a workaround for my question 1 :) - if I use the status as an inline relation instead of a link that is. I can use use "filter" in the select to get only items of a given state. I was wondering if there is a way to filter based on a Link relation though. My question 2 is sti

Re: Pilog query across multiple classes

2019-11-20 Thread C K Kashyap
Hi Alex, I have a couple of follow up Pilog questions.I've been doing some trial and error and I don't see it converging :) I have written a statndalone script for this so that you can easily tell me how to do it in it. In the script below, the entity relation defines three types - Item, Status an

Re: Pilog query across multiple classes

2019-11-05 Thread C K Kashyap
Thanks Alex, The concatenation of multiple collects is just what I need :) Regards, Kashyap On Tue, Nov 5, 2019 at 4:59 AM Alexander Burger wrote: > Hi Kashyap, > > > My ER model looks like this - > > (class +Task +Entity) > > (rel ttl (+IdxFold +String)) > > ... > > (rel upds (+List +Joint) tsk

Re: Pilog query across multiple classes

2019-11-05 Thread Alexander Burger
Hi Kashyap, > My ER model looks like this - > (class +Task +Entity) > (rel ttl (+IdxFold +String)) > ... > (rel upds (+List +Joint) tsk (+Update)) > ... > (class +Update +Entity) > (rel tsk (+Joint) upds (+Task) ) > (rel dsc (+Sn +IdxFold +String)) > ... > How can I select all the Tasks that have

Pilog query across multiple classes

2019-11-04 Thread C K Kashyap
Hi, My ER model looks like this - (class +Task +Entity) (rel nr (+Need +Key +Number)) (rel ttl (+IdxFold +String)) (rel sts (+Sn +IdxFold +String)) (rel tgs (+Sn +IdxFold +String)) (rel dt (+Need +Ref +Date)) (rel upds (+List +Joint) tsk (+Update)) (dm url> (Tab) (and (list "app/tsk.l"