I want a query that takes a datum and yields the root nodes for that
datum.
Do you mean root node or nodes? Surely there can only be one root? Or do you
mean you are looking for the leafs?
Mark
On 18 Jun 2014, at 13:31, Borris <borris(a)chaos.org.uk> wrote:
I'm after a quick bit of help on how to do something that I think
should be
easy but I can't work out how.
I have a Java-side class that essentially is something like
declare Datum
description: String
broader: List <Datum>
narrower: List <Datum>
end
These are arranged in a graph. Root nodes have no items in their broader
list. I want a query that takes a datum and yields the root nodes for that
datum. I think this should look something like
query rootDatumsFor( Datum datum, Datum result )
not Datum() from $datum.broader
or
rootDatumsFor( $datum.broader, $result )
end
but I then get confused. When there are no broader items, I am unclear how
to assign $datum to $result. And I'm not convinced I'm doing the recursion
correctly either.
If an experienced Drools author could spend a minute and show me how to do
this sensibly, I would be very grateful.
--
View this message in context:
http://drools.46999.n3.nabble.com/Noob-question-graph-searching-query-roo...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users