[Neo] How to efficiently query in Neo4J?

2010-04-07 Thread Alastair James
Hi there... I am looking at moving a website to a model based on Neo4J, however, I am having trouble seeing how to optimise the 'main query' type for Neo4J. Briefly, the site consists of posts, each tagged with various attributes, e.g. (its a travel site) location, theme, cost etc... Also the tag

[Neo] How to efficiently query in Neo4J?

2010-05-13 Thread daniel gatis
> > H... > I am guessing the most efficient way might be to have a two stage return evaluator. > E.g. The custom return evaluator class has a hash table of => pairs. Each time 'isReturnableNode' is called, it increments the count for that node id in the hash. If count >= return the no

[Neo] How to efficiently query in Neo4J?

2010-05-13 Thread daniel gatis
Sorry for bad identation. I wrote a n-stages return evaluator and its works fine. public class MainClass { public static void main(String[] args) { GraphDatabaseService graphDb = new EmbeddedReadOnlyGraphDatabase("/path/to/db"); Transaction tx = graphDb.beginTx(); try { No

Re: [Neo] How to efficiently query in Neo4J?

2010-04-07 Thread Max De Marzi Jr.
I've had similar issues and they way I've done it (which may not be the right way) is to run the first traversal and store the returned nodes. Then run the second traversal and return only if it is contained in the set of returned nodes in the first traversal. The traverses hit each node only onc

Re: [Neo] How to efficiently query in Neo4J?

2010-04-07 Thread Rick Bullotta
this PostNode in your results I'd love to know if there's a more effective way to do this as well! Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Alastair James Sent: Wednesday, April 07, 2010 10:54 AM To: Neo user d

Re: [Neo] How to efficiently query in Neo4J?

2010-04-07 Thread Alastair James
H... I am guessing the most efficient way might be to have a two stage return evaluator. E.g. The custom return evaluator class has a hash table of => pairs. Each time 'isReturnableNode' is called, it increments the count for that node id in the hash. If count >= return the node. Thus, if

Re: [Neo] How to efficiently query in Neo4J?

2010-04-07 Thread Craig Taverner
This is a very interesting discussion because I've been working on a solution I call a 'composite index' that, for some datasets, should return the correct results in one simple traverse, with no temporary memory used, but first my high level view of this: I think there are several types of soluti

Re: [Neo] How to efficiently query in Neo4J?

2010-04-07 Thread Alastair James
Excellent analysis Craig. I have been using what you tag the 'composite index' although in mysql. Its fast, but a pain to manage (as you need to keep the index up to date), so I would like to stay away from indexes *if possible*. >One concern is that it needs to keep a hash of all nodes that matc

Re: [Neo] How to efficiently query in Neo4J?

2010-04-07 Thread Craig Taverner
Hi Alastair, I have been using what you tag the 'composite index' although in mysql. Its > fast, but a pain to manage (as you need to keep the index up to date), so I > would like to stay away from indexes *if possible*. > I would think that you only need to take action when you add or modify a n

Re: [Neo] How to efficiently query in Neo4J?

2010-04-08 Thread rick . bullotta
ys optimal and that it is often worth the effor to explore domain-specific approaches. Does that make any sense? -------- Original Message ---- Subject: Re: [Neo] How to efficiently query in Neo4J? From: Craig Taverner Date: Wed, April 07, 2010 7:05 pm To: Neo user

Re: [Neo] How to efficiently query in Neo4J?

2010-04-08 Thread Michael Ludwig
Alastair James schrieb am 07.04.2010 um 15:53:50 (+0100) [[Neo] How to efficiently query in Neo4J?]: > Briefly, the site consists of posts, each tagged with various > attributes, e.g. (its a travel site) location, theme, cost etc... Also > the tags are hierarchical. So, for location we

Re: [Neo] How to efficiently query in Neo4J?

2010-04-08 Thread Max De Marzi Jr.
h, manages, knows, friends, etc). I treat the graph like a specialized index. Makes a lot more sense now, and I get the best of both worlds. On Thu, Apr 8, 2010 at 4:35 PM, Michael Ludwig wrote: > Alastair James schrieb am 07.04.2010 um 15:53:50 (+0100) > [[Neo] How to efficientl

Re: [Neo] How to efficiently query in Neo4J?

2010-04-08 Thread Michael Ludwig
Max De Marzi Jr. schrieb am 08.04.2010 um 16:48:18 (-0500) [Re: [Neo] How to efficiently query in Neo4J?]: > You know this is something that I think needs to be made clear... > using just the graph is not the right way to go unless you have a very > special application. > Some thing

Re: [Neo] How to efficiently query in Neo4J?

2010-04-08 Thread Alastair James
On 8 April 2010 11:43, wrote: > Just trying to make the point that sometime abstract or generic > traversal schemes aren't always optimal and that it is often worth the > effor to explore domain-specific approaches. > The message from this thread seems to be that a) the graph model is great

Re: [Neo] How to efficiently query in Neo4J?

2010-04-08 Thread rick . bullotta
ication challenges! ---- Original Message ---- Subject: Re: [Neo] How to efficiently query in Neo4J? From: Michael Ludwig Date: Thu, April 08, 2010 6:02 pm To: Neo user discussions Max De Marzi Jr. schrieb am 08.04.2010 um 16:48:18 (-0500) [Re: [Neo] How to effici

Re: [Neo] How to efficiently query in Neo4J?

2010-04-08 Thread Alastair James
Hi... On 8 April 2010 22:35, Michael Ludwig wrote: > After giving this some thought, it looks to me as if there is nothing > particularly graphy in your example. I know, most everything is a graph, > but here the data is more regular: Your hierarchical catalog of tags > immediately made me think

Re: [Neo] How to efficiently query in Neo4J?

2010-04-08 Thread Alastair James
ur data model. However, can I query it efficiently without domain specific hacks and extra layers of code?". Al > > > > Original Message > Subject: Re: [Neo] How to efficiently query in Neo4J? > From: Michael Ludwig > Date: Thu, April 08, 2010 6:02

Re: [Neo] How to efficiently query in Neo4J?

2010-04-08 Thread Michael Ludwig
rick.bullotta schrieb am 08.04.2010 um 15:16:11 (-0700) [Re: [Neo] How to efficiently query in Neo4J?]: > Factor in a wide range of SLAs needed for performance vs availability > vs affordability vs scalability vs adminstration costs, and the > equation gets a whole lot more complicated.

Re: [Neo] How to efficiently query in Neo4J?

2010-04-08 Thread Peter Neubauer
On Fri, Apr 9, 2010 at 12:33 AM, Michael Ludwig wrote: > rick.bullotta schrieb am 08.04.2010 um 15:16:11 (-0700) > [Re: [Neo] How to efficiently query in Neo4J?]: > >> Factor in a wide range of SLAs needed for performance vs availability >> vs affordability vs scalability vs a

Re: [Neo] How to efficiently query in Neo4J?

2010-04-09 Thread Alastair James
On 9 April 2010 07:50, Peter Neubauer wrote: > Marko and me tried to summarize what is working especially good with > Graph Databases and what not: > Yes, but in my mind, my use case is a *perfect* example of what should work well in a graph DB. It is an exact example of inforamtion organised by

Re: [Neo] How to efficiently query in Neo4J?

2010-04-09 Thread Max De Marzi Jr.
On first traversal, add a relationship to a "found node" to each node that would return, and check for this relationship on the second traversal? Maybe create a unique id, set a property or add a node property with the unique id on the first traversal, and check for this property on the second trav

Re: [Neo] How to efficiently query in Neo4J?

2010-04-09 Thread Alastair James
On 9 April 2010 14:21, Max De Marzi Jr. wrote: > On first traversal, add a relationship to a "found node" to each node that > would return, and check for this relationship on the second traversal? > Maybe create a unique id, set a property or add a node property with the > unique id on the first

Re: [Neo] How to efficiently query in Neo4J?

2010-04-09 Thread Michael Ludwig
Alastair James schrieb am 09.04.2010 um 14:04:37 (+0100) [Re: [Neo] How to efficiently query in Neo4J?]: > So, I suppose this question boils down to, is there an efficient way > to calculate the union of two traversals without retrieving all result > sets and performing the union in

Re: [Neo] How to efficiently query in Neo4J?

2010-04-09 Thread rick . bullotta
fast... Do you have any code that can create a dummy data set in Neo4J? If you do, I'd be willing to give it a try... Original Message Subject: Re: [Neo] How to efficiently query in Neo4J? From: Michael Ludwig Date: Fri, April 09, 2010 2:44 pm To:

Re: [Neo] How to efficiently query in Neo4J?

2010-04-10 Thread Robert Hritz
pth-first search and that's it. >Alastair James schrieb am 09.04.2010 um 14:04:37 (+0100) >[Re: [Neo] How to efficiently query in Neo4J?]: > >>* So, I suppose this question boils down to, is there an efficient way*>>* to >>calculate the union of two traversals without

Re: [Neo] How to efficiently query in Neo4J?

2010-05-14 Thread Tobias Ivarsson
What are you trying to achieve? I see no problem description, just a solution, and I don't understand what it is supposed to solve. Your first mail looks like it might be a response to some other mail, but in that case the first e-mail never made it to the list. Cheers, Tobias On Fri, May 14, 2

Re: [Neo] How to efficiently query in Neo4J?

2010-05-14 Thread daniel gatis
Sorry again. The problem was in this thread http://lists.neo4j.org/pipermail/user/2010-April/003342.html On Fri, May 14, 2010 at 6:47 AM, Tobias Ivarsson wrote: > What are you trying to achieve? > > I see no problem description, just a solution, and I don't understand what > it is supposed to sol