Making it lazily created seems the best approach, which won't break existing apps nor affect those apps that don't use it.
-----Original Message----- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Emil Eifrem Sent: Tuesday, December 14, 2010 9:56 AM To: Neo4j user discussions Subject: [SPAM] Re: [Neo4j] Reference node pains. Gang -- I've found that this is (as so frequently the case) a question of different types of stakeholders. * For folks that are getting into Neo4j from a more graph theoretical / algorithmic angle (for example, they might have found us through Gremlin and Tinkerpop) then the reference node is a bug, an odd escalated artifact that makes our graph less graph-y. [These are also the folks who think nodes are connected by *edges* or arcs, because that's how graph literature talks about it.] * For folks that are getting into Neo4j from a more industrial / software engineering angle (for example by hearing a talk at a conference like JavaOne) then the reference node is an intuitive and pragmatic way of attaching various subgraphs to an entry point into the graph. [These are also the folks who think nodes are connected through *relationships*, because in normal lingo you say "there's a relationship between these two entities."] Couple of options forward: (a) Keep it as it is. Pro with this is that it's worked and provided value in real systems forever. Con is that it's unintuitive and awkward for a segment of our user base. (b) Completely remove it. Pro with this is that it makes more sense to one user group. Con is that we will have to replace it with something that is as convenient (or more) as the reference node for the users who *do* use it. (c) Create the reference node lazily on invocation of getReferenceNode(). Pro with this is that we can cater to both use cases -- if you don't like the reference node, just don't invoke getReferenceNode(). Con is that it's non-intuitive: we do a mutating operation as part of an API that advertises itself through its name as read-only. (d) Codify the subreference pattern that we use so frequently, by supporting named subreference nodes, a'la getReferenceNode( "actors" ). Pro with this is that we have more powerful and explicit support for a pattern that has emerged as a defacto way of using Neo4j. Con is that it really is a special case of indexing and possibly of the metamodel as well. I'm not sure which approach is the better one but I do think we should address it once and for all and put this discussion to rest. Cheers, -EE On Tue, Dec 14, 2010 at 14:50, Rick Otten <rot...@windfish.net> wrote: > I vote for it being optional. > >> Hi Marko, >> >> On Fri, Dec 10, 2010 at 7:35 PM, Marko Rodriguez <okramma...@gmail.com> >> wrote: >>> Hello. >>> >>> I have one question and a comment: >>> >>> QUESTION: Is the reference node always id 0 on a newly created graph? >> >> Yes. >> >>> >>> COMMENT: By chance, will you guys remove the concept of a reference node >>> into the future. I've noticed this to be a pain in the side for people >>> moving between various graph systems. Going from Neo4j to iGraph to >>> TinkerPop to etc. The reference node, if the user is not conscious, >>> begins to build as data is migrated into and from Neo4j graphs. And what >>> ensues is a data bug. Perhaps a GraphDatabaseServer = new >>> GraphDatabaseService(String directory, boolean createReferenceNode). >>> ...? >> >> The reference node is very helpful in certain use-cases. The current >> implementation could however be improved. >> >> Would having the option to create a graph without the reference node >> solve the problems you are experiencing? >> >> -Johan >> >>> >>> Thanks, >>> Marko. >>> >>> http://markorodriguez.com >>> http://tinkerpop.com >>> >> _______________________________________________ >> Neo4j mailing list >> User@lists.neo4j.org >> https://lists.neo4j.org/mailman/listinfo/user >> > > > -- > Rick Otten > rot...@windfish.net > O=='=+ > > > _______________________________________________ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > -- Emil Eifrém, CEO [e...@neotechnology.com] Neo Technology, www.neotechnology.com Cell: +46 733 462 271 | US: 206 403 8808 http://blogs.neotechnology.com/emil http://twitter.com/emileifrem _______________________________________________ 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