Re: [rules-users] Noob question: graph searching, query, root node for a given node

2014-06-18 Thread Borris
Thanks Mark. I should probably focus on your observation that my graph is not in the working memory. Let me go and have a thank. Good food to prompt me to think! -- View this message in context: http://drools.46999.n3.nabble.com/Noob-question-graph-searching-query-root-node-for-a-given-node-tp4

Re: [rules-users] Noob question: graph searching, query, root node for a given node

2014-06-18 Thread Mark Proctor
It looks like your graph is not in the WM, so you can just iterate the references. Here is an example of how to do this. @Test public void testGraphIterationToFindLeafs() { String drl = "import " + Datum.class.getCanonicalName() + ";\n" + "import java.util.List;\n" +

Re: [rules-users] Noob question: graph searching, query, root node for a given node

2014-06-18 Thread Borris
I guess it's probably useful for me to add that there are multiple such graphs and key part of the operation is which graph a datum belongs to. -- View this message in context: http://drools.46999.n3.nabble.com/Noob-question-graph-searching-query-root-node-for-a-given-node-tp4030091p4030097.htm

Re: [rules-users] Noob question: graph searching, query, root node for a given node

2014-06-18 Thread Wolfgang Laun
Terms like "root" and "parent" are used with trees. You might call these nodes "nodes with indegree 0". -W On 18/06/2014, Borris wrote: > Good question. I'm supporting a graph rather than a tree, so theoretically > there could be more than one node that has no parents. But in my particular > use

Re: [rules-users] Noob question: graph searching, query, root node for a given node

2014-06-18 Thread Borris
Good question. I'm supporting a graph rather than a tree, so theoretically there could be more than one node that has no parents. But in my particular use case I am constraining the data so that there is never more than one root node. So how to find the root node (singular) from an arbitrary node

Re: [rules-users] Noob question: graph searching, query, root node for a given node

2014-06-18 Thread Mark Proctor
> 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 wrote: > I'm after a quick bit of help on how to do something that

[rules-users] Noob question: graph searching, query, root node for a given node

2014-06-18 Thread Borris
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 narrower: List end These are arranged in a graph. Root nodes have n