The way I view this point is that you query what you create. In other words, you should create a graph structure to suite the kinds of queries you plan to make. So if you are going to come back to the graph later on and have no idea how to find a starting point for the traversal, then be sure to have relationships from the reference node into some key point on your graph, so you can traverse from the reference node.
In my opinion traversing from the reference node is a very good model, and therefore building a graph linked to the reference node is also a good model. In my work, I typically have projects composed of datasets composed of complex graphs of data. So I generally have a tree structure rooted at the reference node: ref->project(s)->dataset(s)->data-graph, etc. Then I can always find what I want later on with a simple traversal, without needing lucene and without having to know any node-id in advance. Lucene is good for very flat structures, where you have a lot of similar data and want to later on find parts of that data based on a key or property. You can build an index tree yourself, of course, but few both too. On Mon, Jul 5, 2010 at 8:42 PM, Toni Menzel <[email protected]> wrote: > Hi Boban, > > aside from using an indexing service to grab certain information from > neo4j (as Paddy mentioned correctly) you certainly should get yourself > learning about traversal concepts.Traversing does not mean just > iterating over "elements over a single node" but traversing the whole > graph (if you want to) : hence the naming "traverse". > So, from the way you ask about stuff in you mail, i think its worth > understand that unique concept of graph database. Directly falling > back to the index service does not really embrace why you are a graph > db at all. > As a starter, looking at the javadoc of Node.traverse or its neo4j > 1.1.0-SNAPSHOT successor TraversalDescription and friends helps a lot > already. > > If you cannot succeed that way, read for common misconceptions like that > one [1] > Also try to adopt some design best practices when creating the graph [2] > > cheers, > Toni > [1] http://wiki.neo4j.org/content/Neo_Mistakes#Unbalanced_graph > [2] http://wiki.neo4j.org/content/Design_Guide > > > On Mon, Jul 5, 2010 at 4:19 PM, Boban Erakovic <[email protected]> > wrote: > > Greetings, I have some misunderstanding about neo4j. > > Once, when I store some nodes and relations into database, how can I > query > > it? > > So I store information 5 days ago, and now I want to query? As much as I > > saw, I am using : > > > > Traverser traverser = node.traverse(....); > > > > So I need a node to in order to iterate over database. > > In every example, iteration over data is perform in the same code within > > where we had create already some nodes and relation, and then just reuse > > created node to communicate to database. > > But how to perform querying if have NO any node. I just want to get some > > data from database??? > > I tried getReferenceNode() method, of EmbeddedGraphDatabase class, but it > is > > not correct. > > So, how can I just get data from database? > > Thanks in advance! > > _______________________________________________ > > Neo4j mailing list > > [email protected] > > https://lists.neo4j.org/mailman/listinfo/user > > > > > > -- > Toni Menzel > Independent Software Developer > Professional Profile: http://okidokiteam.com > [email protected] > http://www.ops4j.org - New Energy for OSS Communities - Open > Participation Software. > _______________________________________________ > Neo4j mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

