Re: [Neo4j] [SPAM] Re: [SPAM] Re: [SPAM] Re: Reference node pains.
Given that Neo4j has a pretty powerful indexing system with Lucene, why can't users create their own reference node(s) and index them in their application? Like (in pseudo): Graph g = new Graph() Node n = g.newNode() g.putIndex(n,reference) //later... Node refNode = g.getIndex(reference) I've used Neo4j a lot less than any of you so maybe I don't appreciate something here, but to me this reference node concept does seem like an artifact that provides little added value, and was a source of frustration during my thesis. Just my 2 cents. Cheers, Alex On Wed, Dec 15, 2010 at 5:31 PM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Thought about that too, and while it's always node zero today, but who knows what happens in some future rev with sharding, etc...I'd prefer it to be opaque to the how. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Marko Rodriguez Sent: Wednesday, December 15, 2010 11:26 AM To: Neo4j user discussions Subject: [SPAM] Re: [Neo4j] [SPAM] Re: [SPAM] Re: Reference node pains. Hi, One reason: how to you obtain that reference node later? Seems to me you'd need to write some code to save the node id, index it, etc... If the reference node (=the first node created) is always Vertex Id 0 as Johan stated in a previous email as being the case, then you simply do: Graph.getNodeById(0); You can, of course, create your own method: public Node getReferenceNode() { return graph.getNodeById(0); } I don't understand why, for those that don't want a reference node, simply don't call getReferenceNode() (assuming the lazy creation logic is added). ;-) ...assuming lazy creation logic. (which is smart). Another argument could be the inverse of my previous email: // I like the concept of a reference node Graph graph = new Neo4j(); And for those that don't: // I don't like the concept of a reference node Graph graph = new Neo4j(); graph.removeNode(graph.getReferenceNode() || graph.getNodeById(0)) See ya, Marko. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] [SPAM] Re: [SPAM] Re: [SPAM] Re: Reference node pains.
I think that the idea proposed by Emil, with multiple named reference nodes, is similar, and implies the use of an index to find the reference by name. However, I can also see that use of the lucene index for this implies that lucene, which is a 3rd party component, becomes a compulsory part of the neo4j-kernel, which might not be ideal. The other alternative is to use similar name lookup schemes that Neo4j already has hard-coded into the relationship type index and the property name index. As with relationship types, it probably makes sense to assume a limited number of possible reference nodes. I think relationship types are limited to 64k? Seems like a reasonable limit for reference nodes too. A question I have for the kernel guys, how does the current name lookup perform? Is it as fast as lucene, does it scale well (ie. work as fast if you use 10 relationship type or 10k relationship types)? Does it simply load the entire table into a big java hashmap? P.S. 64k ought to be enough for anyone. :-) (don't quote mehttp://www.computerworld.com/s/article/9101699/The_640K_quote_won_t_go_away_but_did_Gates_really_say_it_...) On Fri, Dec 17, 2010 at 12:29 PM, Alex Averbuch alex.averb...@gmail.comwrote: Given that Neo4j has a pretty powerful indexing system with Lucene, why can't users create their own reference node(s) and index them in their application? Like (in pseudo): Graph g = new Graph() Node n = g.newNode() g.putIndex(n,reference) //later... Node refNode = g.getIndex(reference) I've used Neo4j a lot less than any of you so maybe I don't appreciate something here, but to me this reference node concept does seem like an artifact that provides little added value, and was a source of frustration during my thesis. Just my 2 cents. Cheers, Alex On Wed, Dec 15, 2010 at 5:31 PM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Thought about that too, and while it's always node zero today, but who knows what happens in some future rev with sharding, etc...I'd prefer it to be opaque to the how. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Marko Rodriguez Sent: Wednesday, December 15, 2010 11:26 AM To: Neo4j user discussions Subject: [SPAM] Re: [Neo4j] [SPAM] Re: [SPAM] Re: Reference node pains. Hi, One reason: how to you obtain that reference node later? Seems to me you'd need to write some code to save the node id, index it, etc... If the reference node (=the first node created) is always Vertex Id 0 as Johan stated in a previous email as being the case, then you simply do: Graph.getNodeById(0); You can, of course, create your own method: public Node getReferenceNode() { return graph.getNodeById(0); } I don't understand why, for those that don't want a reference node, simply don't call getReferenceNode() (assuming the lazy creation logic is added). ;-) ...assuming lazy creation logic. (which is smart). Another argument could be the inverse of my previous email: // I like the concept of a reference node Graph graph = new Neo4j(); And for those that don't: // I don't like the concept of a reference node Graph graph = new Neo4j(); graph.removeNode(graph.getReferenceNode() || graph.getNodeById(0)) See ya, Marko. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] [SPAM] Re: [SPAM] Re: [SPAM] Re: Reference node pains.
1) I mentioned Lucene in my last comment but it doesn't need to be Lucene... just an IndexService implementation. 2) Are the performance requirements of looking up a reference node any different from those of looking up some other node? If it's a common operation it will be cached, if it's not a common operation it's probably not very important. On Fri, Dec 17, 2010 at 2:15 PM, Craig Taverner cr...@amanzi.com wrote: I think that the idea proposed by Emil, with multiple named reference nodes, is similar, and implies the use of an index to find the reference by name. However, I can also see that use of the lucene index for this implies that lucene, which is a 3rd party component, becomes a compulsory part of the neo4j-kernel, which might not be ideal. The other alternative is to use similar name lookup schemes that Neo4j already has hard-coded into the relationship type index and the property name index. As with relationship types, it probably makes sense to assume a limited number of possible reference nodes. I think relationship types are limited to 64k? Seems like a reasonable limit for reference nodes too. A question I have for the kernel guys, how does the current name lookup perform? Is it as fast as lucene, does it scale well (ie. work as fast if you use 10 relationship type or 10k relationship types)? Does it simply load the entire table into a big java hashmap? P.S. 64k ought to be enough for anyone. :-) (don't quote me http://www.computerworld.com/s/article/9101699/The_640K_quote_won_t_go_away_but_did_Gates_really_say_it_ ...) On Fri, Dec 17, 2010 at 12:29 PM, Alex Averbuch alex.averb...@gmail.com wrote: Given that Neo4j has a pretty powerful indexing system with Lucene, why can't users create their own reference node(s) and index them in their application? Like (in pseudo): Graph g = new Graph() Node n = g.newNode() g.putIndex(n,reference) //later... Node refNode = g.getIndex(reference) I've used Neo4j a lot less than any of you so maybe I don't appreciate something here, but to me this reference node concept does seem like an artifact that provides little added value, and was a source of frustration during my thesis. Just my 2 cents. Cheers, Alex On Wed, Dec 15, 2010 at 5:31 PM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Thought about that too, and while it's always node zero today, but who knows what happens in some future rev with sharding, etc...I'd prefer it to be opaque to the how. -Original Message- From: user-boun...@lists.neo4j.org [mailto: user-boun...@lists.neo4j.org] On Behalf Of Marko Rodriguez Sent: Wednesday, December 15, 2010 11:26 AM To: Neo4j user discussions Subject: [SPAM] Re: [Neo4j] [SPAM] Re: [SPAM] Re: Reference node pains. Hi, One reason: how to you obtain that reference node later? Seems to me you'd need to write some code to save the node id, index it, etc... If the reference node (=the first node created) is always Vertex Id 0 as Johan stated in a previous email as being the case, then you simply do: Graph.getNodeById(0); You can, of course, create your own method: public Node getReferenceNode() { return graph.getNodeById(0); } I don't understand why, for those that don't want a reference node, simply don't call getReferenceNode() (assuming the lazy creation logic is added). ;-) ...assuming lazy creation logic. (which is smart). Another argument could be the inverse of my previous email: // I like the concept of a reference node Graph graph = new Neo4j(); And for those that don't: // I don't like the concept of a reference node Graph graph = new Neo4j(); graph.removeNode(graph.getReferenceNode() || graph.getNodeById(0)) See ya, Marko. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] [SPAM] Re: [SPAM] Re: [SPAM] Re: Reference node pains.
Thought about that too, and while it's always node zero today, but who knows what happens in some future rev with sharding, etc...I'd prefer it to be opaque to the how. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Marko Rodriguez Sent: Wednesday, December 15, 2010 11:26 AM To: Neo4j user discussions Subject: [SPAM] Re: [Neo4j] [SPAM] Re: [SPAM] Re: Reference node pains. Hi, One reason: how to you obtain that reference node later? Seems to me you'd need to write some code to save the node id, index it, etc... If the reference node (=the first node created) is always Vertex Id 0 as Johan stated in a previous email as being the case, then you simply do: Graph.getNodeById(0); You can, of course, create your own method: public Node getReferenceNode() { return graph.getNodeById(0); } I don't understand why, for those that don't want a reference node, simply don't call getReferenceNode() (assuming the lazy creation logic is added). ;-) ...assuming lazy creation logic. (which is smart). Another argument could be the inverse of my previous email: // I like the concept of a reference node Graph graph = new Neo4j(); And for those that don't: // I don't like the concept of a reference node Graph graph = new Neo4j(); graph.removeNode(graph.getReferenceNode() || graph.getNodeById(0)) See ya, Marko. ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user