Re: [Neo4j] OutOfMemory while populating large graph
Paul, I also would like to see automatic swapping/paging to disk as part of Neo4J, minimally when in bulk insert mode...and ideally in every usage scenario. I don't fully understand why the in-memory logs get so large and/or aren't backed by the on-disk log, or if they are, why they need to be kept in memory as well. Perhaps it isn't the transaction stuff that is taking up memory, but the graph itself? Can any of the Neo team help provide some insight? Thanks! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Paul A. Jackson Sent: Thursday, July 08, 2010 1:35 PM To: (User@lists.neo4j.org) Subject: [Neo4j] OutOfMemory while populating large graph I have seen people discuss committing transactions after some microbatch of a few hundred records, but I thought this was optional. I thought Neo4J would automatically write out to disk as memory became full. Well, I encountered an OOM and want to make sure that I understand the reason. Was my understanding incorrect, or is there a parameter that I need to set to some limit, or is the problem them I am indexing as I go. The stack trace, FWIW, is: Exception in thread main java.lang.OutOfMemoryError: Java heap space at java.util.HashMap.init(HashMap.java:209) at java.util.HashSet.init(HashSet.java:86) at org.neo4j.index.lucene.LuceneTransaction$TxCache.add(LuceneTransaction.java: 334) at org.neo4j.index.lucene.LuceneTransaction.insert(LuceneTransaction.java:93) at org.neo4j.index.lucene.LuceneTransaction.index(LuceneTransaction.java:59) at org.neo4j.index.lucene.LuceneXaConnection.index(LuceneXaConnection.java:94) at org.neo4j.index.lucene.LuceneIndexService.indexThisTx(LuceneIndexService.jav a:220) at org.neo4j.index.impl.GenericIndexService.index(GenericIndexService.java:54) at org.neo4j.index.lucene.LuceneIndexService.index(LuceneIndexService.java:209) at JiraLoader$JiraExtractor$Item.setNodeProperty(JiraLoader.java:321) at JiraLoader$JiraExtractor$Item.updateGraph(JiraLoader.java:240) Thanks, Paul Jackson ___ 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] Store binary data with byte []
Same question here (since we're storing blobs in Neo today). Also, the same question applies on clobs - if we store the data as a string (e.g. JSON format) instead of binary, is that better than byte[]? -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Atle Prange Sent: Tuesday, June 22, 2010 7:30 AM To: Neo4j user discussions Subject: Re: [Neo4j] Store binary data with byte [] Around what size of byte[] should i consider using some other storage means than neo4j? Could it be as easy as just storing the byte[] as a single file transparently? -atle On Tue, Jun 22, 2010 at 8:09 AM, Mattias Persson matt...@neotechnology.com wrote: Neo4j isn't optimized to store big data blobs, so storing binaries as byte[] properties isn't really recommended at the moment. There are discussions on ways to enable such a feature and I'm guessing it'll show up in later releases. 2010/6/22 go canal goca...@yahoo.com: Hello, Sorry, this maybe asked before - I saw byte [] is supported as property type. I assume I can use that to store binary data, like attachments. Is there any storage limit to it ? Will indexing/searching performance be affected ? Thanks, canal thanks, canal ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ 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] Lucene Index on Relationships
I think the combination of relationship type + relevant property value(s) is a more appropriate context for an index, as opposed to for all relationships in the graph. FWIW, we achieve this today with Neo directly using the concept of bucket nodes. Instead of having to create different relationship types for each range of values, as Craig has suggested, we achieve a similar result by a set of intermediate nodes that all have a relationship to a bucket collection node, and individual nodes are attached via a common relationship type to the appropriate bucket based on one or more values in the node. This gives us a fairly fast way to reduce the # of nodes quite quickly, without the need for an external index. Just a thought. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Monday, June 21, 2010 8:36 AM To: Neo4j user discussions Subject: Re: [Neo4j] Lucene Index on Relationships Hi, how do you guys expect indexing for relationships to work? Would it be an index just as for nodes... or per node? I often hear that it'd speed up traversals if a node has many, many neighbours. But if the relationship index would be for the entire graph (not per node) that wouldn't really help, would it? 2010/6/21 Craig Taverner cr...@amanzi.com: A side comment, since I think indexing relationships with lucene might be good, but think there might be alternatives for your current example. You said that the relationship property is a float from 0 to 1, so you cannot use relationship types, but actually, when you consider that any index is usually created by breaking data ranges (continuous or discrete) into fewer, more discrete ranges, you can use a relationship type to represent a range of floats. For example, if you have roughly even distribution of floats between 0 and 1, try divide that into 100 parts (0%-100%, or 0.01 to 1.00), and make a relationship type for each. This would certainly facilitate traversing relationships of specific float values (at least improve the performance dramatically, as in an index). Of course, this example focuses on traversing from a particular document. If you are searching for all relationships in the entire database with particular float values, then a separate index would be better. On Mon, Jun 21, 2010 at 2:11 PM, Marius Kubatz marius.kub...@udo.eduwrote: Hello guys, hello community! I'm currently evaluating neo4j for my thesis and have a wish :) I have already opened a ticket for this,( https://trac.neo4j.org/ticket/241 ) but I would like to hear what you guys think about it. Basically it just involves the ability to index Neo4j Relationships with Lucene Index. Neo4j works great on sparse graphs, but what happens when you have a very tight graph with several thousands of neighbors to one node? Additionally as soon as you store informations on Relationships you will get into trouble, because you will have to iterate through all those edges to find the properties you seek. If this sounds far fetched please take a look at this example where one might need properties on Relationships: One Document node is related to another Document node by a similarity function which is stored in the Relationships between those document nodes. Lets just say that we save a float between [0 - 1] on those relationships, which makes it impossible to create RelationshipTypes for every value. Using Index to fetch Relationships by their indexed properties would greatly speed up the process and increase the attractiveness of using properties on Relationships. I would love to have quick access to Relationship properties where I could add and implement fuzzy logic, probabilities, Bayesian networks, similarities, ranking ... and so on ... As said thank you for Relationship properties, they are great and already there, but what I miss is quick access to them. Thank you very much and best regards! Marius -- Programs must be written for people to read, and only incidentally for machines to execute. - Abelson Sussman, SICP, preface to the first edition ___ 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 -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ 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] Self-referencing relationships anyone?
I would like to check it out... ...and so would I... ...and so would I... ...and so would I... -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tobias Ivarsson Sent: Friday, June 18, 2010 7:24 AM To: Neo user discussions Subject: [Neo4j] Self-referencing relationships anyone? Hi all! I was playing around with adding support for relationships where the start node and end node are the same. I managed to come up with a nice litte patch that adds support for this to the current development version (trunk) of Neo4j. If anyone is feeling adventurous and want to try it out I would love to get feedback on this. Direct link to the patch: https://trac.neo4j.org/attachment/ticket/239/loopRelationships.patch Cheers, Tobias On Fri, Jun 18, 2010 at 1:17 PM, neo4j.org nore...@neo4j.org wrote: #239: Add support for relationships with same start node as end node -+-- Reporter: tobias | Owner: tobias Type: enhancement request | Status: new Priority: minor| Milestone: Component: kernel |Keywords: -+-- The attached patch applies against r4579. The unit tests in the patch all pass (as does all the previously existing unit tests), but more testing would be nice before committing this to trunk. -- Ticket URL: https://trac.neo4j.org/ticket/239 neo4j.org http://trac.neo4j.org/ The Neo4J.org Issue Tracker -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ 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] Node creation limit
Hi, Johan. In the scenario you describe below, if one attempts to open an existing Neo DB that has been created with a non-standard block size, will it be able to get that information from the DB itself or must you provide that information when you attempt via config parameters to open it? Thanks, Rick Original Message Subject: Re: [Neo4j] Node creation limit From: Johan Svensson [1]jo...@neotechnology.com Date: Tue, June 08, 2010 5:15 am To: Neo4j user discussions [2]u...@lists.neo4j.org I just added code in trunk so block size for string and array store can be configured when the store is created. This will be available in the 1.1 release but if you want to try it out now use 1.1-SNAPSHOT and create a new store like this: MapString,String config = new HashMapString, String(); config.put( string_block_size, 60 ); config.put( array_block_size, 300 ); // create a new store with string block size 60 and array block size 300 new EmbeddedGraphDatabase( path-to-db-that-do-not-exist, config ).shutdown(); The default value (120 bytes) was picked to fit common/avg size string/array properties in one block since it will be slower to load a property that is spread out on many blocks. Since datasets vary a lot in string size / array size and the like I think it is better to have it configurable at creation time. When tweaking these values remember that strings will consume twice the string length in bytes so a string block size of 60 will be able to fit a string of length 30 in a single block. Regarding scaling 1.0 and 1.1 releases have a limit of 4 billion records / store file so if you need to store 4 billion strings you have to make sure every string fits in a single block. This limit will be increased to 32 billion or more in the 1.2 release. -Johan On Mon, Jun 7, 2010 at 4:27 PM, Biren Gandhi [3]biren.gan...@gmail.com wrote: Similar issue on my side as well. Test data is ok, but production data (100 million+ objects, 200 relationships per object and 10 properties per object, with multi-million queries per day about search and traversal) would need clear disk sizing calculations due to iops and other hardware limits in a monolithic storage model. Has anyone been able to use neo4j succeessfully in scaling needs similar to mentioned avove? -b On Jun 7, 2010, at 4:45 AM, Craig Taverner [4]cr...@amanzi.com wrote: Is there a specific constrain on disk space? Normally disk space isn't a problem... it's cheap and there's usually loads of it. Actually for most of my use cases the disk space has been fine. Except for one data source, that surprised me by expanding from less than a gig of original binary data, to over 20GB database. While this too can be managed, it was just a sample, and so I have yet to see what the customers 'real data' will do to the database (several hundred times larger, I'm expecting). When we get to that point we will need to decide how to deal with it. Currently we 'solve' the issue by allowing the user to filter out data on import, so we don't store everything. This will not satisfy all users, however. ___ Neo4j mailing list [5]u...@lists.neo4j.org [6]https://lists.neo4j.org/mailman/listinfo/user References 1. mailto://jo...@neotechnology.com/ 2. mailto://user@lists.neo4j.org/ 3. mailto://biren.gan...@gmail.com/ 4. mailto://cr...@amanzi.com/ 5. mailto://User@lists.neo4j.org/ 6. https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Node creation limit
Disk space is cheap, yes, but of course there is a performance cost to read from it. More importantly, do the same record sizes apply to the in-memory representation of properties? If so, that might be an issue, since memory is a more precious commodity. If not, then doing a pre-load of much of the graph would help mitigate the disk space and I/O concerns. Can you confirm whether or not the in-memory structures use a fixed-record size model also? Original Message Subject: Re: [Neo4j] Node creation limit From: Mattias Persson [1]matt...@neotechnology.com Date: Mon, June 07, 2010 7:38 am To: Neo4j user discussions [2]u...@lists.neo4j.org 2010/6/7 Craig Taverner [3]cr...@amanzi.com: Seems that the string store is not optimal for the 'common' usage of properties for names or labels, which are typically 5 to 20 characters long, leading to about 5x (or more) space utilization than needed. By 'names or labels' I mean things like username, tags, categorizations, product names, etc. These seem like very common scenarios. You're quite right about that, however: Is there a specific constrain on disk space? Normally disk space isn't a problem... it's cheap and there's usually loads of it. I guess there is no simple way of optimizing for this? At an app level it is possible to pack a bunch of strings into a single property using, for example, JSON. But that only makes sense if the usage is always to work with them all as a unit. On Mon, Jun 7, 2010 at 10:32 AM, Johan Svensson [4]jo...@neotechnology.comwrote: Hi, These are the current record sizes in bytes that can be used to calculate the actual store size: nodestore: 9 relationshipstore: 33 propertystore: 25 stringstore: 133 arraystore: 133 All properties except strings and arrays will take a single propertystore record (25 bytes). A string or array property will use one record from the propertystore then as many blocks needed from the string/array store file (each block of 133 bytes can store 120 bytes of data). This means if all your strings are in 120 bytes multiples in size you will make very efficient use of the store file while if they are empty you will not make very good use of the space (exactly like a normal filesystem taking up space for empty files). -Johan On Fri, Jun 4, 2010 at 9:15 AM, Mattias Persson [5]matt...@neotechnology.com wrote: That formula is correct regarding nodes and relationships, yes. When properties comes into play another formula would, of course, have to be applied. Depending on property types and length of keys/string values it is different. It could be good though with a formula/tool to calculate that. 2010/6/4, Biren Gandhi [6]biren.gan...@gmail.com: In that case, what are the ways to estimate storage capacity numbers? Basic formula of nodes*9 + edges*33 doesn't seem like a practical one. On Wed, Jun 2, 2010 at 11:26 PM, Mattias Persson [7]matt...@neotechnology.comwrote: String properties are stored in blocks so even if you have tiny string values each property value will occupy a full block (30 or 60 bytes, can someone correct me here?). That's what taking most of your space IMHO ___ Neo4j mailing list [8]u...@lists.neo4j.org [9]https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list [10]u...@lists.neo4j.org [11]https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [[12]matt...@neotechnology.com] Hacker, Neo Technology [13]www.neotechnology.com ___ Neo4j mailing list [14]u...@lists.neo4j.org [15]https://lists.neo4j.org/mailman/listinfo/user References 1. mailto://matt...@neotechnology.com/ 2. mailto://user@lists.neo4j.org/ 3. mailto://cr...@amanzi.com/ 4. mailto://jo...@neotechnology.com/ 5. mailto://matt...@neotechnology.com/ 6. mailto://biren.gan...@gmail.com/ 7. mailto://matt...@neotechnology.com/ 8. mailto://User@lists.neo4j.org/ 9. https://lists.neo4j.org/mailman/listinfo/user 10. mailto://User@lists.neo4j.org/ 11. https://lists.neo4j.org/mailman/listinfo/user 12. mailto://matt...@neotechnology.com/ 13. http://www.neotechnology.com/ 14. mailto://User@lists.neo4j.org/ 15. https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Embedded .NET use of Neo4j
Interesting work! My experience, having ported large-scale applications to and from Java and .NET, however, is that cross-compilation or bytecode conversion generally doesn't work that optimally (if at all, in some cases). To take advantage of platform-specific optimizations (e.g. NIO/raw IO, threading, etc.) usually requires specific re-design and re-coding. It isn't that painful to do, surprisingly. I might take a peek at the source base for Neo to try to identify any of the obvious trouble spots that could be isolated and modularized. The dilemma is that you inevitably end up with forked code bases that stay out of sync forever...which isn't necessarily bad, just a reality. I'll be interested to follow progress on this, as we have a couple of use cases where it might be attractive to have an embedded Neo on .NET on our device gateways. Original Message Subject: [Neo4j] Embedded .NET use of Neo4j From: Peter Neubauer [1]peter.neuba...@neotechnology.com Date: Fri, June 04, 2010 3:31 am To: Neo4j user discussions [2]u...@lists.neo4j.org Hi all, Taylor Cowan has just written a nice blog about getting Neo4j compiled to .NET and using it in embedded mode. Good news for all folks! Would love to get some performance feedback on that! [3]http://www.thewebsemantic.com/2010/06/03/neo4j-on-net-3-5/ Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn [4]http://www.linkedin.com/in/neubauer Twitter [5]http://twitter.com/peterneubauer [6]http://www.neo4j.org - Your high performance graph database. [7]http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. ___ Neo4j mailing list [8]u...@lists.neo4j.org [9]https://lists.neo4j.org/mailman/listinfo/user References 1. mailto://peter.neuba...@neotechnology.com/ 2. mailto://user@lists.neo4j.org/ 3. http://www.thewebsemantic.com/2010/06/03/neo4j-on-net-3-5 4. http://www.linkedin.com/in/neubauer 5. http://twitter.com/peterneubauer 6. http://www.neo4j.org/ 7. http://www.thoughtmade.com/ 8. mailto://User@lists.neo4j.org/ 9. https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Tell neo to not reuse ID's
Hi, Craig. Not crazy at all. We're doing something similar to flag archived nodes. Instead of deleting context(since we want to infrequently access the nodes/relationships, but only under certain types of queries/traversals), instead we mark the nodes/relationships with a boolean property. Not as space efficient, but in our case, since we need to retain the full state, it works fine. Original Message Subject: Re: [Neo4j] Tell neo to not reuse ID's From: Craig Taverner [1]cr...@amanzi.com Date: Wed, June 02, 2010 7:10 pm To: Neo4j user discussions [2]u...@lists.neo4j.org Here is a crazy idea that probably only works for nodes. Don't actually delete the nodes, just the relationships and the node properties. The skeleton node will retain the id in the table preventing re-use. If these orphans are not relevant to your tests, this should have the effect you are looking for. On Wed, Jun 2, 2010 at 8:17 PM, Martin Neumann [3]m.neumann.1...@gmail.comwrote: Hej, Is it somehow possible to tell Neo4j not to reuse id's at all? Im running some experiments on Neo4j and I want to add and delete the nodes and relationships. To make sure that I can repeat the same experiment I create a log containing the ID's of the nodes i want to delete. To make sure that I can rerun the experiment each node I add has to have the same ID in each experiment. If ID's can be reused that is not always the case thats why I need to turn it off or work around it. hope for your help cheers Martin ___ Neo4j mailing list [4]u...@lists.neo4j.org [5]https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list [6]u...@lists.neo4j.org [7]https://lists.neo4j.org/mailman/listinfo/user References 1. mailto://cr...@amanzi.com/ 2. mailto://user@lists.neo4j.org/ 3. mailto://m.neumann.1...@gmail.com/ 4. mailto://User@lists.neo4j.org/ 5. https://lists.neo4j.org/mailman/listinfo/user 6. mailto://User@lists.neo4j.org/ 7. https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Urgent: Block Not In Use error
We had an accidental shutdown of a running Neo instance, and there was no automatic recovery on startup. We are getting a bunch of Block Not In Use errors such as: Block not inUse[0] blockId[179414] Is there a way to recover from this? Is this a bug? If so, is there a fix available? Thanks, Rick ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Urgent: Block Not In Use error
Some more information: This error is first occurring when trying to read a String property on a node, and also happens when reading string properties on other nodes. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Rick Bullotta Sent: Thursday, June 03, 2010 11:39 AM To: 'Neo4j user discussions' Subject: [Neo4j] Urgent: Block Not In Use error Importance: High We had an accidental shutdown of a running Neo instance, and there was no automatic recovery on startup. We are getting a bunch of Block Not In Use errors such as: Block not inUse[0] blockId[179414] Is there a way to recover from this? Is this a bug? If so, is there a fix available? Thanks, Rick ___ 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] Urgent: Block Not In Use error
Hi, Johan. I might have missed the recovery attempt being logged, but here's the basics: - it was a non-clean shutdown but not a powerdown (task terminated). - the nodes that seem to be exhibiting the odd behavior were not being written to at the time, but that doesn't necessarily mean anything - the OS is Windows 7/64-bit - the storage is a Samsung SSD, NTFS, no compression Hope that helps, Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Johan Svensson Sent: Thursday, June 03, 2010 12:20 PM To: Neo4j user discussions Subject: Re: [Neo4j] Urgent: Block Not In Use error Rick, There is no ordinary way to NOT run recovery on startup if the system crashes. The only way for that to happen is if something extraneous to Neo4j has modified the filesystem in between runs. For example if the logical files are removed after a crash, then starting up could lead to no recovery followed by block not in use behavior you describe. Another example is if you run a filesystem that doesn't honor the POSIX fdatasync() contract (most popular filesystems can be configured to do so...). Could you explain a bit more what happened and some info of your configuration such as: o accidental shutdown means kill/powerfailure/non clean shutdown/clean shutdown etc? o what filesystem and configuration of it -Johan On Thu, Jun 3, 2010 at 5:38 PM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: We had an accidental shutdown of a running Neo instance, and there was no automatic recovery on startup. We are getting a bunch of Block Not In Use errors such as: Block not inUse[0] blockId[179414] Is there a way to recover from this? Is this a bug? If so, is there a fix available? Thanks, Rick ___ 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] Urgent: Block Not In Use error
Hi, Johan. I sent you the store as a zip file. Nothing out of the ordinary other than the process terminating abnormally (it was running in the context of an embedded Tomcat inside of Eclipse, and the embedded instance got terminated by accident instead of shut down normally). Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Johan Svensson Sent: Thursday, June 03, 2010 1:11 PM To: Neo4j user discussions Subject: Re: [Neo4j] Urgent: Block Not In Use error That setup should not be a problem. Anything else you can think of that was out of the ordinary before the task got terminated or after (stacktraces, disk full, concurrent process trying to access the same store files etc)? You can contact me off-list if it would be possible for me to have a look at the store. -Johan On Thu, Jun 3, 2010 at 6:25 PM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Hi, Johan. I might have missed the recovery attempt being logged, but here's the basics: - it was a non-clean shutdown but not a powerdown (task terminated). - the nodes that seem to be exhibiting the odd behavior were not being written to at the time, but that doesn't necessarily mean anything - the OS is Windows 7/64-bit - the storage is a Samsung SSD, NTFS, no compression Hope that helps, Rick ___ 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] Cool graph problems, anyone?
Well, I'll go first. At Burning Sky Software, as part of our ThingWorx platform, we're using Neo4J to model the internet of things as well as to collect a related set of data streams that can be semantically searched/navigated/queried leveraging that same model. If I told you any more, I'd have to kill you. ;-) Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Peter Neubauer Sent: Tuesday, June 01, 2010 1:06 PM To: Neo4j user discussions Subject: [Neo4j] Cool graph problems, anyone? Hi all, I am thrilled to be able to present at http://berlinbuzzwords.de/ next Monday. The plan is to talk about 5 cool problems you can solve with Graph Databases :) Now, I have some ideas what cool problems are, but this community has a lot of really awesome minds, so I would like to ask you all - what are the top cool problems you perceive to be best solved by Neo4j and Graph Databases as such? All input is welcome! Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. ___ 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: [Neo] Transactions in Neo4j REST Server
REST purists prefer that each REST-ful invocation is atomic, but as we all know, there are definitely cases where multiple transactions need to be implemented. The cleanest approach I've seen involved an explicit call to create a transaction/unit of work, and some type of transaction token/ID and/or URL would be returned (a new URI resource) that would be passed as part of subsequent REST-ful calls as either part of the URL or as a header. Then, the original URI resource could be used to complete/rollback the transaction [1]http://server/Neo4J/Transaction/87342342344/Commit or [2]http://server/Neo4J/Transaction/87342342344/Fail. I think Javier's proposal is similar, but what I would avoid is inferring transactions between a client and server in the way Javier describes, and instead making the transaction identifier a part of the URL or delivered as a header. I also like his approach of using well-known HTTP result codes to manage the transaction lifecycle. Rick Original Message Subject: Re: [Neo] Transactions in Neo4j REST Server From: Anders Nawroth and...@neotechnology.com Date: Thu, May 20, 2010 9:00 am To: Neo user discussions user@lists.neo4j.org Hi! The guys who wrote the REST component are offline at the moment, so I'll just chime in here for now. You are right that the current REST API won't allow you to control transactions: it wraps each request in a transaction. There's basically two strategies, either you keep a transaction open spanning multiple requests, or you bundle the operations together somehow and send them in a single request. It would be interesting to hear some different views on this topic from the community - what would be useful to you? /anders Javier de la Rosa wrote: Hi all, I think there's no way to perform a transaction through Neo4j REST Server. It would be great if we could emulate this behaviour using the header Keep-Alive, some session variable or some persistence issue. A good option can be the next (I'm guessing Neo4j isn't able to manage several transactions simultaniously, but I don't really know): Create transaction POST /transaction Example using curl $ curl -H Accept:application/json -X POST [3]http://localhost:/transaction Response 201: OK, a transaction was created 409: Transaction already in progress Since that moment, whatever you do will be under the transaction. When you finish the transaction. the DELETE verb has to be invoked over /transaction: DELETE /transaction Example using curl $ curl -X DELETE [4]http://localhost:/transaction Response 204: OK, no content returned 404: Transaction not found What do you think about this? Is it too many complicated? Is it possible? Best regards. ___ Neo mailing list User@lists.neo4j.org [5]https://lists.neo4j.org/mailman/listinfo/user References 1. http://server/Neo4J/Transaction/87342342344/Commit 2. http://server/Neo4J/Transaction/87342342344/Fail 3. http://localhost:/transaction 4. http://localhost:/transaction 5. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Transactions in Neo4j REST Server
Sounds a lot like code ;-) Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tobias Ivarsson Sent: Thursday, May 20, 2010 2:55 PM To: Neo user discussions Subject: Re: [Neo] Transactions in Neo4j REST Server Hi buddies! My vote is for adding support for posting a batch of operations to be executed within the context of one transaction. What we need to figure out is how these should be expressed. Starting from a list of requirements is usually a good idea. The features I can think of that the batch operations should be able to do is: * Create nodes * Create relationships * Assign/update/remove properties * Verify assumptions The verification of assumptions is the trickiest part. The easies way I can think of for doing this is to have the client read all interesting state using the current API, then build a set of operations to post to the server, including a set of pre-conditions that need to validate for the transaction to be executed. If the operations fail the response will contain the failing conditions and the client can either drop the request or create a new request, either from scratch or based on the previous one and the information about the failing conditions. It might be more useful though to allow the operations to read state and decide on actions based on that. But supporting that is much harder, the set of operations is starting to approach a script in some programming language at that point. Like dr Webber I believe that allowing for client side (explicit) transaction management will lead to resource starvation. Just the thoughts I've been having around this, WDYT? Cheers, Tobias On Thu, May 20, 2010 at 5:51 PM, Kevin Raison rai...@chatsubo.net wrote: I am in a situation where being able to bulk upload an ntriples-like file or perhaps a large JSON data blob via the REST interface as a single transaction would be incredibly helpful. Consider this a feature request. Thanks for your work on this! Cheers. Kevin On 5/20/10 6:14 AM, Jim Webber wrote: Hi fellow graph-tastic people, Allowing a transaction to span multiple requests was ruled out in the early version of the REST API. It's a dangerous pattern that allows for inadvertent (or even malicious) denial of service. If we're going to build systems that sympathetic to the Web, then exposing transactions like this is not the way to go. Having said that, the REST API will need more functionality and that new functionality will need to address transactionality, but it will need to do so in a way that doesn't compromise its Web-iness. Rick's response is one approach, where a transaction is modelled as a resource; another approach might be to submit a transactional workflow through the API and get a result graph/set back. I promise I'll do some work on the API again soon. So start yelling your requirements and I'll prioritise them (and will ignore the ones that are too hard for me to implement, naturally :-) Jim ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Kevin Raison Founder, CTO Chatsubo.net, LLC 9708 1st Ave NW Seattle, WA 98117 rai...@chatsubo.net ph: +1 (206) 801-5728 fx: +1 (206) 801-5729 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Hello Neo4j community. Do you know a fix for Neo4j on Google App Engine?
Has anyone tried hacking GAEVFS into Neo to see if it works? http://code.google.com/p/gaevfs/ -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Anders Nawroth Sent: Thursday, May 13, 2010 10:21 AM To: Neo user discussions Subject: Re: [Neo] Hello Neo4j community. Do you know a fix for Neo4j on Google App Engine? Hi Kim! Kim Soldal wrote: We have a problem with deploying our Neo4j application to Google App Engine. Does anyone know a solution to the problem of Neo4j trying to access the filesystem for persistence while Google App Engine refuse to allow this. In stead it just drop our application. AFAIK there's no solutions to this at the moment. We are a team of student finishing our bachelor project in computer science in two days. I would love to hear more about that! We have made a specialized travel planner framework using Neo4j for persistence, and would like to deploy this application to Google App Engine. Amazon is a better choice, see: http://wiki.neo4j.org/content/Neo4j_in_the_Cloud Good luck with your project! /anders The application is configured and built using Apache Maven. All configuration should be correct, but like mentioned above the deployment does not work due to restrictions from GAE. Is there any way to create the Neo4j graph only in memory, or to utilize the app store persistance on GAE? Thx for feedback! RegardsKim Verner Soldal _ Windows 7: Du får hjelp til gjøre mer. Utforsk Windows 7. http://windows.microsoft.com/windows-7 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Performance
Hi, Atle. FYI, we're building a platform for the scenario you describe (aggregating sensor and other information), and are using Neo4J as our underlying data store and meta model. If you'd not prefer to build your own, I'd be happy to discuss your application and see if we're a fit. We're limiting access to a few customers at this point (it is commercial software), but I'd be interested in learning more about what you're trying to achieve. E-mail me off-list to discuss. Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Atle Prange Sent: Friday, May 07, 2010 6:53 AM To: Neo user discussions Subject: Re: [Neo] Performance The usecase that was the driver for the babudb index was business (primary) keys. Since the id of the node is governed by neo4j, i wanted to implement a faster index than lucene for key searches. Using lucene for other than real fulltext is not very efficient. In my mint neo4j is a far better fit than relational databases to persist objects graphs, and the key indexing has been sort of a show stopper. And the more i use ogrm, the more i appreciate the fact that neo4j handles all relationships for me, so the amount of (error prone) relationship boilerplate is reduced to a minimum. I agreee that graph databases arent the solution for all problems, but in most cases a normal OO mapping maps better into graphs that tables. What also would be interesting is to see if an IndexService based on for example babudb can fill a requirement relational tables where used to fulfill before. I am in the planning phase of an application that collects readings from sensors. That seems like a perfect fit for a relational table, but the readings are also interconnected and chained and so forth, so be able to keep the data in a graph would be a huge gain in simplicity. -atle BTW: the references page now points to neo4j :) On Thu, May 6, 2010 at 3:42 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Mmh, very interesting! What would be a good usecase for using BaduDB alongside e.g. Lucene with Neo4j? Would be nice to make a good example of using a different index than text together. That would open up for a number of possible scenarios, e.g. with CouchDB, Cassandra and others, that have a number of interesting capabilities that could be combined with the graph approach! Good work, wil check out the code for ogrm.org. Also, the link on the dependency page points to neo4k.org which does not exist :) Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://www.thoughtmade.com - Scandinavias coolest Bring-a-Thing party. On Thu, May 6, 2010 at 2:29 PM, Atle Prange atle.pra...@gmail.com wrote: I have done some simple performance comparison between neo4j and babudb (http://code.google.com/p/babudb/), because i use babudb (which users the same architecture as Googles bigtable) as an IndexService for neo4j in my object-graph-mapper. (check out the source for the BabuDbIndexService from ogrm.org) The results aren't that exiting, but updates are about twice as fast in neo4j than in babudb. Reads are equally fast, with babudb having the slight upper hand. Using babudb can therefore be seen as a good indexing service for neo4j! (Thats my conclusion, feel free to ignore) I can read 20 objects in about 4 seconds for both frameworks, including node wrapping and content deserialization (payload of 100bytes, cold cache) (My computer is really slow though) I think that is really fast! I wish i had learned about neo4j earlier though! :) -atle ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Usage questions
Hi, Mark. I would suggest three different types of relationships rather than just a single Strength relationship : SkillStrength (for person-skill) , SkillRelevance (for skill-job), and SkillAffinity (for skill-skill), with a numeric property on the relationship that gauges the strength. I would design it with three nodes off the root node, 'People', 'Skills', and 'Jobs', and then each person/skill/job would be a node linked to one of those three nodes using a relationship (e.g. Person relationship, Skill relationship, and Job relationship). The traversals look pretty simple, and you can define different algorithms for aggregating the results (and can probably build on some of the graph algos that are in the Neo4J optional packages). It will probably be easiest (and more performant) to sort the aggregated results after the fact, though there's no technical reason you couldn't do it in-process during the traversal. Looks like a fun project and a good fit for Neo! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mark Nijhof Sent: Friday, May 07, 2010 7:22 AM To: user@lists.neo4j.org Subject: [Neo] Usage questions Hi, I have a few questions with respect to using Neo4j, let me outline the details of what we want to accomplish first. We are building a job site for the Scandinavian IT market and for my question I would like to use the simplified model: - Persons - Skills - Jobs A Person will have certain Skills but the relation between the person and the skills depends on how well he possesses these skills. I like to call this relation Strength. The same applies to Jobs, a Job requires certain Skills but here as well some skills are more important then others. Then there are also relations between the different Skills them selves, some skills are very tight related together other are no, or have no relation at all. Which would end up like this: - Persons -- Strength -- Skills - Skills -- Strength -- Skills - Jobs -- Strength -- Skills I see all relations bi-directional as I want to be able to from one end to the other. Now what I want to be able to do is: - Find a match between a Job and a Person depending on the relations between them (via Skills) and also try to calculate the overall Strength between these matches. This can go both ways. - Being able to use the relations between Skills to suggest other Jobs even if the skills are not found in the search query. A very simple example would be: Search for Ruby and JavaScript would also suggest Jobs that only have Rails specified. Since there is a strong relation between Ruby and Rails as well as between JavaScript and Rails. There are many more scenario's that we would want to query, but I think that this would be enough to describe the problem domain :-) else just ask. F.ex. later there will also be relations between Companies and Persons and Companies and Skills, and ... Questions: - Are my assumptions correct that Neo4j would be a good fit? - Besides the relations there is a _lot_ more content attached to Persons and Jobs should this data be stored in Neo4j as well, or should that go into a document db and that Neo4j only has a reference? - Given the previous question, if that content is in Neo4j how well is it searchable? I believe Lucene is supported as well, can this be used in the traversal searches? - We are using Heroku for our platform (at least in the start) and so we need a different server to host Neo4j, I am thinking that an Amazon instance would be great, then using JRuby in front of it to create a custom API for the Heroku app to use. Does that sound like a good fit? (our Java abilities are not great, and feel more comfortable with Ruby). I hope I have explained our situation well enough and am looking forward to see some discussion around it. Cheers, -Mark -- Mark Nijhof Cre8ive Thought m: 0047 95 00 99 37 e: mark.nij...@cre8ivethought.com w: www.cre8ivethought.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] How to define StartNodes and Reference Nodes
Hi, Stefan. I always define my start nodes connected to the root node via specific relationship types. For example, I might have a collection of people and a collection of cars. I would create a new node to be the start node of the people collection, and create A relationship from the root node to this new node, of relationship type people. Then do the same for each other start node. Then, to quickly find a start node, simply traverse a single relationship from the root node. Hope that makes sense! Rick Bullotta , at 3:38 AM, Stefan Berndt kont...@stberndt.de wrote: Hello I'm familiarizing with Neo4j more and more. After testing some rudimentary things I'm now trying to write my first Neo4j application with the following Graph: StartNode |-CollectionType1---CollectionType1_1 | | | |CollectionType1_2 | |-CollectionType2---CollectionType2_1 |CollectionType2_2 There are off course more Collections than 2 and the Items of the Collections are also more. Now I want define my Startnode as a really Startnode. and the Nodes CollectionType1...CollectionTypeN as reference nodes. Off course i can get this nodes by GraphDataBaseService.getAllNodes () and iterate then over the Iterable until i've found my Node. But I dunno the Runtime Behavior if my nodespace becomes really big. Is there another Way to define this Startnodes or other important Nodes. I thank you for your help. Cheers, Stefan ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Relationship representation in REST
Would prefer configurable. Getting all the property data each time would be problematic in many of our use cases. /blah/blah/node/* = all properties /blah/blah/node = no properties or system default behavior /blah/blah/node/property = specific property Alternatively a query parameter could be used: propertyMask=* propertyMask= (or absence of this parameter) propertyMask=property I'm sure we could come up with creative ways to also ask for a set of properties (e.g. propertyMask=[property1,property2,property3]) -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Monday, April 26, 2010 4:13 AM To: Neo user discussions Subject: Re: [Neo] Relationship representation in REST Is there any kind of consensus here? Always send back full node representation? Not send back full node representation? Configurable per request somehow? 2010/4/21 Brian Turner br...@wodaklab.org I would have to agree. I've been trying out the REST interface, and it would be nice to have the option to have the full details of each node returned when doing a traversal. You say have the option to have the full details? I'd rather not have it configurable per server... maybe per request. How would that be configurable in a good way (assuming that's what you mean)? Yes, I mean when doing the post and option should exist for level of detail returned. Do you mean when doing a traversal (as in POST .../node/123/traverse/node) or when simply getting relationships for a node? When you use traversers you can specify what to get back and if you get nodes back you get that data. I was thinking of traversal, but it shouldn't matter. Anywhere a node is returned as only an identifier should really allow for the option to have its details included (perhaps even a list of desired attributes). B. __ Brian Turner http://wodaklab.org 416 813 7810 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Checking if relationship exists between two nodes
Cool, Mattias. I just ran into that requirement again today. This is also another good case for the cached/persisted number of relationships counter on a node that has also been discussed. It would enable the optimization to occur automatically. Another API function that would be useful (though it is also easy to implement) is one that automatically deletes all relationships for a node, then deletes the node, since that is the required path of action anyway to delete a node. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Sunday, April 25, 2010 3:52 PM To: Neo4j user discussions Subject: [Neo] Checking if relationship exists between two nodes As you all (probably) know the Neo4j API has no method Node#hasRelationshipTo(Node otherNode) and to find out such a thing could potentially be slow if both the nodes has many relationships (of the type/direction you want to check). I just created a utility for that which starts to iterate from the node (of the two) that the developer thinks/knows has the least relationships. If a certain amount of relationships have been iterated and not yet found a new thread is spawned which starts to iterate from the other node in the opposite direction. The method will return as soon as the first thread finds a match. I'd guess that's the fastest way currently to do that. The next level of this would be to add indexing for relationships (which is an upcoming feature) and go via that instead. So the code may look like: (it's in the neo4j-utils component) GraphDatabaseUtil graphDbUtil = new GraphDatabaseUtil( graphDb ); boolean exists = graphDbUtil.relationshipExistsBetween( node1, node2, MyRelTypes.MY_TYPE, Direction.OUTGOING ); -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Checking if relationship exists between two nodes
Hi, Tobias. I was only referring to the case when it was the intent to delete the node also. In that case, you *have* to delete all the relationships to the node in order to delete the node. No worries, it is easy enough to implement! -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tobias Ivarsson Sent: Sunday, April 25, 2010 5:53 PM To: Neo user discussions Subject: Re: [Neo] Checking if relationship exists between two nodes On Sun, Apr 25, 2010 at 10:42 PM, Mattias Persson matt...@neotechnology.com wrote: 2010/4/25, Rick Bullotta rick.bullo...@burningskysoftware.com: Cool, Mattias. I just ran into that requirement again today. This is also another good case for the cached/persisted number of relationships counter on a node that has also been discussed. It would enable the optimization to occur automatically. Although for this method it doesn't matter, sort of, because it'll iterate from both nodes in parallell (unless it immediately finds it from the first direction, within the first 50 or so) Another API function that would be useful (though it is also easy to implement) is one that automatically deletes all relationships for a node, then deletes the node, since that is the required path of action anyway to delete a node. well, yeah maybe. I don't think I've ever wanted to do that so I haven't created a utility method for it. But it may be time to add it I think just removing all relationships of a node is a bit unsafe. I would prefer if you had to supply the RelationshipTypes to delete, so that you don't destroy unexpected structures. SomeUtilityClass.delete( Node node, RelationshipType... expectedTypes ) -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Sunday, April 25, 2010 3:52 PM To: Neo4j user discussions Subject: [Neo] Checking if relationship exists between two nodes As you all (probably) know the Neo4j API has no method Node#hasRelationshipTo(Node otherNode) and to find out such a thing could potentially be slow if both the nodes has many relationships (of the type/direction you want to check). I just created a utility for that which starts to iterate from the node (of the two) that the developer thinks/knows has the least relationships. If a certain amount of relationships have been iterated and not yet found a new thread is spawned which starts to iterate from the other node in the opposite direction. The method will return as soon as the first thread finds a match. I'd guess that's the fastest way currently to do that. The next level of this would be to add indexing for relationships (which is an upcoming feature) and go via that instead. So the code may look like: (it's in the neo4j-utils component) GraphDatabaseUtil graphDbUtil = new GraphDatabaseUtil( graphDb ); boolean exists = graphDbUtil.relationshipExistsBetween( node1, node2, MyRelTypes.MY_TYPE, Direction.OUTGOING ); -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Conneg in REST API
The better approach is to use an optional request parameter (which is unlikely to conflict with real request parameters) that provides the necessary value(s) that the headers provide, which is analogous to the mechanism used by most REST APIs to allow browsers to do PUT, DELETE, etc... e.g. someURL?_acceptHeaders=text/xml;application/thingworx;bloodtype/apos Original Message Subject: Re: [Neo] Conneg in REST API From: Jim Webber j...@webber.name Date: Wed, April 21, 2010 7:00 am To: Neo user discussions user@lists.neo4j.org Hey Peter, If we really want to cater for non-compliant browsers, then we can dispatch on user-agent, using the same XHTML code that exists today. Jim On 21 Apr 2010, at 11:18, Peter Neubauer wrote: Yeah, this is good, except that some browsers, e.g. IE, don't provide these headers and thus f... up all that nice thinking. Any idea how to cope with that? [1]http://www.newmediacampaigns.com/page/browser-rest-http-accept-heade rs Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn [2]http://www.linkedin.com/in/neubauer Twitter [3]http://twitter.com/peterneubauer [4]http://www.neo4j.org - Your high performance graph database. [5]http://nosqleu.com - The biggest NOSQL event. Ever. [6]http://www.thoughtmade.com - Scandinavias coolest Bring-a-Thing party. On Wed, Apr 21, 2010 at 12:11 PM, Mattias Persson matt...@neotechnology.com wrote: You mean using the Content-Type/Accept headers? That's at least how it's solved now with text/html and application/json living side to side in the REST API today. 2010/3/23 Jim Webber j...@webber.name Just another thought: if we're going to use multiple representation formats, then we should use content negotiation. Jim ___ Neo mailing list User@lists.neo4j.org [7]https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Hacker, Neo Technology [8]www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org [9]https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org [10]https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org [11]https://lists.neo4j.org/mailman/listinfo/user References 1. http://www.newmediacampaigns.com/page/browser-rest-http-accept-headers 2. http://www.linkedin.com/in/neubauer 3. http://twitter.com/peterneubauer 4. http://www.neo4j.org/ 5. http://nosqleu.com/ 6. http://www.thoughtmade.com/ 7. https://lists.neo4j.org/mailman/listinfo/user 8. http://www.neotechnology.com/ 9. https://lists.neo4j.org/mailman/listinfo/user 10. https://lists.neo4j.org/mailman/listinfo/user 11. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Connecting to Neo4j DB from ActionScript
I would not use a Runtime shutdown hook from within Tomcat. I would use a ServletContextListener (override the contextInitialized and contextDestroyed events), and create singletons for the GraphDatabaseService/LuceneIndex when the webapp initializes, and shut them down when the webapp is destroyed. You can only have a single instance of the GraphDatabaseService active at a time. Those changes should get you working. Rick Original Message Subject: Re: [Neo] Connecting to Neo4j DB from ActionScript From: Amir Hossein Jadidinejad amir.jad...@yahoo.com Date: Sat, April 10, 2010 2:48 pm To: Neo user discussions user@lists.neo4j.org Cc: rick.bullo...@burningskysoftware.com Hi, After a lot of try/miss attempts, finally I've created both the server and client sides. I have some problems: 1. I don't know how to manage shutting down stuffs (GraphDatabaseService and IndexService) in the client side. 2. When I run the flex page for the first time (after restarting the Tomcat), everything is ok. But when I run it again or refresh the page, I have a Error: An unknown exception occurred while creating an instance of type 'wikipedia.wnng.Connector'. - It maybe related to the first item! 3. The source codes are attached, would you please review them or share some codes that I can solve the problem? Kind regards, Amir --- On Sat, 3/13/10, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: From: Rick Bullotta rick.bullo...@burningskysoftware.com Subject: Re: [Neo] Connecting to Neo4j DB from ActionScript To: 'Neo user discussions' user@lists.neo4j.org Date: Saturday, March 13, 2010, 9:57 AM Hi, Amir. Most of what we're doing is fairly specific to our domain model (each node has a type and a name property) and technology landscape (WebORB backend, for example), but there are some guidelines I can share with you to help. 1) You'll want to create a viewer based on ExtendedFlexGraph, which brings with it a lot of very useful filtering/searching/layout capabilities that the base FlexGraph class does not have 2) You'll want to create a custom node renderer and a custom arc (relationship) renderer. We overrode the newInstance(), set data, and addToolTipValues() methods to allow us to display Neo node and relationship properties in the mouse-over event, and to provide custom text to display on each node/relationship. The Neo relationship model fits nicely with Flexviz in that an arc in Flexviz has a type that corresponds to the RelationshipType in neo. The Neo node model also fits reasonably well, with the concept of an id (arcs have id's also). 3) You'll need a back-end service (servlet or other) to get data to your Flex front end. We're using WebORB, which allows a high performance bridge to the Flex app using Flex remoting (and a binary protocol), but you could do the same thing with a Flex HTTPService and by outputting XML from a servlet, perhaps in some variant of GraphML. In the handler for a response for the server, you'll then want to parse the result and create the graph model inside Flexviz. Here's the code we use (realize that our result structure is a native object, but the same approach could be used with XML). neoModel = response.result as ArrayCollection; graph.nodeRenderer = new NeoNodeRenderer(); graph.arcRenderer = new NeoRelationshipRenderer(); model = new DefaultGraphModel(); var node:Object; var edge:Object; for each(node in neoModel) { var graphNode:DefaultGraphNode = new DefaultGraphNode(node.id, node.type, node.name, node); model.addNode(graphNode); } for each(node in neoModel) { for each(edge in node.edges) { var fromItem: IGraphNode = model.getNode(edge.fromNode); var toItem: IGraphNode = model.getNode(edge.toNode); var arc:DefaultGraphArc = new DefaultGraphArc(edge.id, fromItem, toItem, edge.type, edge, false, true); model.addArc(arc); } } graph.model = model; var layout:ILayoutAlgorithm = new RadialLayoutAlgorithm(); graph.runLayout(layout); 4) On the server side, we created a class that handles client requests, with a single parameter corresponding to the root node of the request. In our case, we don't want to display the entire Neo4J graph - only nodes one relationship away from a specified node (similar to Neoclipse's default
Re: [Neo] Traversers in the REST API
Since in manycases the results of a query will need to be reformed into their associated domain objects, we've chosen to do our sorting at that point (and on the server). We do our (primary) filtering within the traversal/DB-domain object processes. That seems to work well. Pagination is kinda tricky if the data changes between subsequent requests for pages. Since pagination is generally used for UIs, a common approach is to place the entire dataset (or a cursor, depending on where the data is coming from) in a session object. Regardless of where it is kept, if you want to deal with data changes, you either have to a) invalidate the cached dataset if data changes or b) keep a copy of the whole dataset around in its as queried state so that subsequent paging requests are consistent. Either case involves keeping a fairly big duplicate data structure on the server or middle tier and violates one of the objectives of REST-ful APIs, which is that of statelessness. For that reason, I personally think the REST-ful API shouldn't deal with paging. It should probably be done at some intermediate level as needed by applications. We can certainly build a separate API that we can all leverage if needed, but I don't think it should be in the core REST-ful layer. Just my $0.02, after taxes. Original Message Subject: Re: [Neo] Traversers in the REST API From: Tobias Ivarsson tobias.ivars...@neotechnology.com Date: Fri, April 09, 2010 4:00 am To: Neo user discussions user@lists.neo4j.org I definitely agree that limiting or paging a set of results is probably not very useful without some sort of sorting. The (only) benefit of pushing sorting to the client is that the client might be able to filter the result further before sorting it. Since sorting is generally the most expensive operation it should be done as late as possible. However the idea of semi-sorting, to get only one page of sorted results at each request, that was mentioned in some thread yesterday sounds quite compelling. I agree that an equivalent of LIMIT, OFFSET and ORDER BY is a good target. As to indexing: the structure of the graph IS the index to a large extent. This means that a well designed graph would often not need paging if the traversal is done right. There are however some cases where this is hard to accomplish and we need to work on supporting those cases better. Remember that a Graph Database is NOT a Relational Database. A lot of the ideas people have about databases are based on their knowledge of Relational Databases. I understand that it can be hard, but if that baggage could be left at the door it would make things a lot easier. Nobody is saying that Relational Databases are dead (except for some publicity stunts) far from it! What we (and a lot of other people) are saying is that the age of one database to rule them all is over. Different problems are best solved with different kinds of databases, RDBMSes are great at some, K/V stores some, and Graph Databases are great for some. Then there are some problems that are best solved with a combination of two or more (kinds of) databases, where each database brings its own strengths to the table, and is used only for the things it is good at. That's enough deviation from the topic, my conclusions remain the same as they were before this discussion started, I will state them in as few words as possible and in bullet point form to convey them as clearly as I can: * The REST API will probably need result set limiting or pagination. * Limiting and pagination will require (server side) sorting * Sorting can be better implemented if it's implemented in the core of the traversal framework * Limiting / Pagination can be deferred for a while until we know what it needs to look like (from looking at actual uses) * (Server side) Sorting can be deferred until we need it for limiting / pagination Peace, Tobias On Thu, Apr 8, 2010 at 10:17 PM, Michael Ludwig mil...@gmx.de wrote: Tobias Ivarsson schrieb am 08.04.2010 um 18:23:27 (+0200) [Re: [Neo] Traversers in the REST API]: On Wed, Apr 7, 2010 at 3:05 PM, Alastair James al.ja...@gmail.com wrote: when we start talking about returning 1000s of nodes in JSON over HTTP just to get the first 10 this is clearly sub-optimal (as I build websites this is a very common use case). So, as you say, sorting and limiting can wait, but I suspect the HTTP API would benefit from offering it. Limiting need not require changes to the core API, it could be implemented as a second stage in the HTTP API code prior to output encoding. For paging / limiting: yes, you are absolutely right, this would not
Re: [Neo] Traversers in the REST API
Why not just slap memcached in the middle? Would help with scalability as well, plus you could keep cached results keyed by query params in there if needed. Just a thought... Original Message Subject: Re: [Neo] Traversers in the REST API From: Alastair James al.ja...@gmail.com Date: Fri, April 09, 2010 8:32 am To: Neo user discussions user@lists.neo4j.org Since in manycases the results of a query will need to be reformed into their associated domain objects Unlikely to be the case over the HTTP API. Its unlikely people will create domain objects in (e.g.) PHP they will just use the data directly. Pagination is kinda tricky if the data changes between subsequent requests for pages. Since pagination is generally used for UIs, a common approach is to place the entire dataset (or a cursor, depending on where the data is coming from) in a session object. Regardless of where it is kept, if you want to deal with data changes, you either have to a) invalidate the cached dataset if data changes or b) keep a copy of the whole dataset around in its as queried state so that subsequent paging requests are consistent. Either case involves keeping a fairly big duplicate data structure on the server or middle tier and violates one of the objectives of REST-ful APIs, which is that of statelessness. For that reason, I personally think the REST-ful API shouldn't deal with paging. It should probably be done at some intermediate level as needed by applications. We can certainly build a separate API that we can all leverage if needed, but I don't think it should be in the core REST-ful layer. Well, I think for my use cases (websites), its likely that users dont flick between pages that often. For example, on may sites, users will view page 1 and select an item, any very view move on to page 2. Its a very different usage pattern compared to a traditional desktop UI, so there is absolutely no need to hold the sorted set on the server in a cursor type way. A typical use case for me would be 1000+ matching rows, with 90%+ of page views for the first 10, 5% for the next 10 etc...! You can clearly see that sending the entire results set of 1000+ rows over HTTP/JSON is inefficient. Of course, caching between the web server and the neo HTTP API can help, but not in all cases, and it seems silly to rely on this. Al -- Dr Alastair James CTO James Publishing Ltd. [1]http://www.linkedin.com/pub/3/914/163 [2]www.worldreviewer.com WINNER Travolution Awards Best Travel Information Website 2009 WINNER IRHAS Awards, Los Angeles, Best Travel Website 2008 WINNER Travolution Awards Best New Online Travel Company 2008 WINNER Travel Weekly Magellan Award 2008 WINNER Yahoo! Finds of the Year 2007 Noli nothis permittere te terere! ___ Neo mailing list User@lists.neo4j.org [3]https://lists.neo4j.org/mailman/listinfo/user References 1. http://www.linkedin.com/pub/3/914/163 2. http://www.worldreviewer.com/ 3. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] How to efficiently query in Neo4J?
In a previous post, I suggested a two-way traversal (I guess it's actually a traversal done once in one direction and n-1 times in the other direction, where n = number of tags you're matching posts on). I'm willing to bet it could be pretty 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 mil...@gmx.de Date: Fri, April 09, 2010 2:44 pm To: Neo user discussions user@lists.neo4j.org 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 user code? No need for two traversals if you annotate your category tree in Neo4j the same way Celko has popularized for SQL, i.e. marking each category with *left* and *right*. It's really not a question of graph or sets, as in both cases what you deal with is a tree. [1]http://intelligent-enterprise.informationweek.com/001020/celko.jhtml Note that this needs some custom logic for category tree updates. But it's not difficult in SQL, and I think it's not much more difficult in Neo4j either. -- Michael Ludwig ___ Neo mailing list User@lists.neo4j.org [2]https://lists.neo4j.org/mailman/listinfo/user References 1. http://intelligent-enterprise.informationweek.com/001020/celko.jhtml 2. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] How to efficiently query in Neo4J?
Since no one responded yesterday, I wanted to re-emphasize that there are probably substantial optimizations that can be made in a well-known problem domain such as this. For example, by using pre-calculated relevance measures for tags, and by narrowing the returned set of posts/nodes as rapidly as possible using the least used tag(s) in progressive order. It would be quite trivial (and reasonably performant) to maintain a pair of properties on each node in the tag hierarchy that count the # of relationships of the tag and all its children. Each time a tagging relationship was added to a post, simply add 1 to this property for the tag node and all its ancestors/parents. Then, when you are provided with a list of tags to search upon, order them by the least frequently used tag by leveraging this metric and execute your traversals/set analysis in that order. I also think my proposal for a two-directional search (first one from the direction of the least frequently used tag to the posts that include it, followed by a search from each of those posts back to its tags as described in a previous message) could be quite fast. Another compound index approach that can be used, which is somewhat of a brute force method, is to maintain a property on each tag node that consists of its aggregrate name - e.g. Europe.Italy.Toscana.Siena or Activities.Active.Cycling.MountainBiking. When doing a search for Cycling activities in Italy, you could grab the aggregate names for Italy (Europe.Italy) and Cycling (Activities.Active.Cycling), then, using whatever mechanism you choose for your initial node traversal (exhaustive or least-frequently-used tag), you can compare the aggregate name for the tags assigned to a post node to the aggregate names for the desired nodes using a simple String.startsWith(). For example, if I posted regarding a mountain bike ride I took in the hills around Siena, tagged with the above aggregate names, it would successfully match. My first thought was that this could be problematic if a tag term appeared multiple times in the tag hierarchy, but that's easily managed on the query side. 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. Does that make any sense? Original Message Subject: Re: [Neo] How to efficiently query in Neo4J? From: Craig Taverner cr...@amanzi.com Date: Wed, April 07, 2010 7:05 pm To: Neo user discussions user@lists.neo4j.org 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 node, and then only to (re)connect it to the index tree (creating index nodes on demand, if missing). This can be embedded in your domain classes, so indexing is automatic. You can even synchronously 'garbage-collect' unused index nodes (if the node unlinked was the last node for that index node). I think the index-service for this needs to be well tested for all scenarios, but should ultimately have a very simple API, with no manual management requirement. My one concern with the composite index for your case is that all my thinking in this has been for numerical indexes, where I plan to query with inequalities (eg. return all restaurants with rating = 4 stars). I've not thought about how to solve hierarchical tags like you have. One further optimisation is to only store new items in the hash on the first traversal. Then, in the subsequent traversals, if the key does not exist, there is no need to add key with count 1, as it cannot ever be emitted. This limits the memory requirements to the order of the first traversal, so if you pick that well, it should be better. Nice idea. It makes your approach more like the 'one set intersection' approach in term of memory. Picking a good first query seems a common need for many of the solutions. I presume RDBMS have a query optimization phase that figures that out. I'm hoping to completely avoid that kind of non-deterministic approach with the composite index. Cheers, Craig ___ Neo mailing list User@lists.neo4j.org [1]https://lists.neo4j.org/mailman/listinfo/user References 1. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] How to efficiently query in Neo4J?
As always, it really isn't that simple. Comparing cold queries is probably not a good indicator of steady state performance, since RDBMS's and Graph DB's have different models for file system access and caching. Even different RDBMS's have dramatically different behaviors in common queries (ever try to use MySQL for set operations - yuck.). 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. I'm sure there's a graphy-model for the tag/post example that could be made smoking fast with Neo also. Throw columnar storage, key-value, and document DB's into the mix, and the good news is that we have a lot of weapons in our arsenal now to tackle very demanding and diverse application challenges! Original Message Subject: Re: [Neo] How to efficiently query in Neo4J? From: Michael Ludwig mil...@gmx.de Date: Thu, April 08, 2010 6:02 pm To: Neo user discussions user@lists.neo4j.org 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 things are better not done in the graph. So I decided to keep that in tables, and just move the person relationships to the graph (works with, 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. Exactly what I think. An iterable index, and a great one for the kind of graphy queries that cannot be done efficiently using sets and joins. Any thoughts on what constitutes *graphiness*, if I may venture this term? -- Michael Ludwig ___ Neo mailing list User@lists.neo4j.org [1]https://lists.neo4j.org/mailman/listinfo/user References 1. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Neo4j + REST + .NET anyone?
Hi, Tobias. It could be a fairly challenging task to do a general purpose .NET client using WCF, largely due to the flexibility of the return types (schema-less and type-less) from the REST API and some challenges that the DataContractJsonSerializer has in these scenarios. I think ultimately there's going to be a need for some type of metamodel built in so that inbound and outbound requests can properly map in and out of .NET domain models, but that's probably a bigger effort. There may be some other general purpose .NET client JSON parsers that would be easier to work with and more flexible (e.g. the JSON.NET project). One suggestion might be to add a DELETE method symmetric with the various get relationships on node methods. For example, DELETE /node/XXX/relationships/all would delete all relationships for node XXX. This helps make deletion of a node a simpler and more atomic operation. Also, I think the documentation in the Wiki for get relationships on node is incorrect since it shows a collection of nodes being returned. Lastly, I think it would be very valuable if the relationship type was returned from the REST API whenever a relationship or collection of relationships is returned. Along a related topic, has anyone started a .NET port of Neo4J yet (Neo4Net)? Cheers, Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tobias Ivarsson Sent: Wednesday, April 07, 2010 10:37 AM To: Neo user discussions Subject: [Neo] Neo4j + REST + .NET anyone? Hi everyone! With the REST API approaching a usable state it would be great to get some clients written for it. Since I'll be presenting Neo4j at a .Net conference next week ( http://mow2010.dk/all-abstracts/tobias-ivarsson.aspx ) it would be great if there was a .Net client available for me to show. An early prototype would be enough, but I neither have the time, nor the .Net skills to implement it. Since this list is full of talented developers I thought I'd ask for some help. To make things more interesting I'll throw in a Neo4j t-shirt as a reward for the first .Net Neo4j REST client library with an accompanying small demo application. For reference see the documentation of the Neo4j REST API: * http://components.neo4j.org/neo4j-rest/ * http://wiki.neo4j.org/content/Getting_Started_REST WFC might be a good foundation to build the client library on: * http://damianm.com/tech/building-a-rest-client-with-wcf/ Happy hacking! -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] How to efficiently query in Neo4J?
Here's a rough description of how we're handling something similar: - Create a tag query collection consisting of the node(s) for each tag in your query (TQNodes) - Given the tags to match, determine the specificity of each tag (e.g. depth in the tag hierarchy) - For the most specific tag, using relationships, traverse applicable nodes/posts to first reduce the valid set of nodes to a smaller number. We'll call this collection PostNodes - For each node/post (PostNode) in the returned list (PostNodes), get a list of tag relationships and grab the node Id's for these tags and put them in a tag post collection (TPNodes) - For each tag node (TPNode) in TPNodes, check for a match in the your tag query collection (TQNodes). If TPNode has no matches, get the parent of TPNode and re-check if it is in the TQNodes. Continue until you reach the root node in the tag hierarchy or find a match. If you reach the root node in the tag hierarchy, you do not have a match, so try the next PostNode in PostNodes. If you find a match for TPNode, try the next TPNode in TPNodes. If all the nodes in TPNodes have a match, include 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 discussions Subject: [Neo] How to efficiently query in Neo4J? 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 tags are hierarchical. So, for location we have (say) 'tuscany' inside 'italy' inside 'europe'. For theme we have (say) 'cycling' inside 'activity'. I can beautifully model the parent child relationships of these 'tags' using a graph Db as objects with a 'CHILD_OF' relationship type. Then the posts go in and have related 'tags' related to them with a 'TAGGED_WITH' relationship types. Fine. However, here is the complex bit (well to me): I need to be able to find all posts tagged with a set of tags (AND operation so each post must be tagged with each tag). Whats more, these queries need to respect the parent relationships in the tags. So if I search for 'activity' in 'france' it needs to traverse the CHILD_OF relationships to find things tagged with any child of 'activity' AND any child of 'France'. It seems pretty easy to write a traversal class that would find all posts in any child of ether 'tag' node, simply follow 'CHILD_OF' and 'TAGGED_WITH' backwards and return nodes of type post. However how to do the AND bit? The only way I can see is to return both lists and union them in user code... however that seems inelegant and may not scale brilliantly. Any ideas how to optimise? Al ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] DatatypeClassRange usage
In theory the isAssignableFrom method on the underlying MetaModel Range classes should be able to test for a legal/automatic type conversion, but it looks like that code is commented out in the current version of the Validator class. In any case, it certainly seems that using the normal reference classes for the primitive types should work fine. Nullability is another benefit of using the reference classes. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Niels Hoogeveen Sent: Monday, April 05, 2010 8:42 AM To: user@lists.neo4j.org Subject: Re: [Neo] DatatypeClassRange usage If only reference classes can be added, what are appropriate types. Should I use java.lang.Integer when the underlying property value is and int and java.lang.Long when using a long? Kind regards, Niels Hoogeveen From: pd_aficion...@hotmail.com To: user@lists.neo4j.org Date: Sat, 3 Apr 2010 01:52:06 +0200 Subject: [Neo] DatatypeClassRange usage To model the datatype of a property, I tried to use the DatatypeClassRange. It seems this object only accepts reference classes, not primitive classes. I would like to state that a certain MetaModelProperty has the datatype int. To do so, I thought I would have to provide the MetaModelProperty with a PropertyRange. The DatatypeClassRange seemed the only suitable option, but its fromStringRepresentation method loads the class through a Class.forName, so class int, is of course not found, and the load of the PropertyRange results in a ClassNotFoundException. Is this a bug, is this a feature? Kind regards, Niels Hoogeveen _ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user _ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] MySQL vs. Neo4j in a Breadth-First Graph Traversal
Or sql server or oracle (gasp), which are much faster than mysql in many use cases... The problem with any type of benchmark is that they tend to be very situational. But it is still valuable information, as long as it is viewed in context and not as an absolute. --Original Message-- From: Laurent Laborde Sender: user-boun...@lists.neo4j.org To: Neo user discussions ReplyTo: Neo user discussions Subject: Re: [Neo] MySQL vs. Neo4j in a Breadth-First Graph Traversal Sent: Mar 30, 2010 3:11 AM On Tue, Mar 30, 2010 at 8:57 AM, Peter Neubauer neubauer.pe...@gmail.com wrote: MySQL degrades as the data volume increases, and as the depth increases (at depth 5 MySQL just hangs). You used MyIsam ? InnoDB ? What about postgresql ? (which is not supposed to be faster than MyIsam, but usually faster than InnoDB) -- Laurent ker2x Laborde Sysadmin DBA at http://www.over-blog.com/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Shut down the NeoClipse
I've also found that when you attempt to run the standalone Neoclipse, and the neo database is locked or otherwise unavailable, there's no way to exit the Neoclipse startup sequence, and you have to kill the process manually. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Amir Hossein Jadidinejad Sent: Sunday, March 28, 2010 12:56 PM To: neo4j Subject: [Neo] Shut down the NeoClipse Hi, I can open the Neo4j perspective in Eclipse. It's great! But after change the perspective to Java in order to modify the source code and run again, an error is shown that say Unable to lock store. It seems that Neo4j does not shut down yet so I have to close the Eclipse and run it again! How can I shut down the NeoClipse after I see the output?! Thanks. ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] meta meta classes
Such are the joys and challenges of frameworks and abstractions. Sometimes you do need to get close to the metal though, to achieve specific functional and performance requirements. Thus the reason open source frameworks are awesome. At least we can change and extend them more easily! -Original Message- From: Niels Hoogeveen pd_aficion...@hotmail.com Date: Fri, 26 Mar 2010 15:20:15 To: user@lists.neo4j.org Subject: Re: [Neo] meta meta classes Making MetaModelThing implement the Node interface is actually orthogonal to the creation of Shadow objects. Though it does make code using classes as objects cleaner, and allows the node property of MetaModelThing to become private. From: pd_aficion...@hotmail.com To: user@lists.neo4j.org Date: Fri, 26 Mar 2010 14:38:08 +0100 Subject: Re: [Neo] meta meta classes Or, and this probably the simplest solution. Let a MetaModelThing implement the Node interface. This allows a class to be an instance of another class and/or a SubType of another class. From: pd_aficion...@hotmail.com To: user@lists.neo4j.org Date: Fri, 26 Mar 2010 14:20:07 +0100 Subject: Re: [Neo] meta meta classes The class as object phenomenon is actually quite pervasive, and I think it is possible to have a generalized solution for it. After sending this email yesterday, I came up with a slightly different solution. val taggable = namespace.getMetaClass(taggable, true) val tagName = metaModelNamespace.getMetaProperty(tagname, true) tagName.setCardinality(1) val metaTaggable = metaModelNamespace.getMetaClass(taggable, true) metaTaggable.getDirectProperties.add(tagName) metaTaggable.getDirectInstances.add(taggable.node) val body = namespace.getMetaClass(body, true) taggable.getDirectSubs.add(body) Instead of directly relating the class body to the meta class taggable, I create a shadow of the meta class taggable with the same name in the namespace of the class body, and make body a subclass of this shadow. That way the sub classing relationship remains nicely in one name space, while the instance relationship transcends name spaces, as it should. This could in principle be generalized by adding a methods to MetaModelClass: public MetaModelClass createShadowClass(NameSpace ns){ MetaModelClass mc = ns.getMetaClass(this.getName(), true); this.getDirectInstances.add(mc.node); return mc; } This returns a shadow of a given MetaModelClass in a given namespace and adds it as a an instance of this. It would of course be nicer to have a method with the signature: public MetaModelClass getShadow(NameSpace ns, Boolean create) This is much more in line with the rest of the API, but requires a way to find out the namespace a given MetaModelClass is defined in. I didn't see a method getNamespace() for a given class, and didn't delve deeply enough in the source code to figure out how to do that. A similar approach can of course also be applied to MetaModelProperties, by adding the following method to MetaModelClass: public MetaModelProperty createShadowProperty(NameSpace ns){ MetaModelProperty mp = ns.getMetaProperty(this.getName(), true); this.getDirectInstances.add(mp.node); return mp; } This way the underlying node of a MetaModelProperty can properly be used as a class of its own and have properties, relationships, that can be further modeled in the meta layer. This e.q. allows to set a default rendering format for a given property class. I don't see a MetaModelRelationships, which is unfortunate, since that would allow the modeling of the properties of a Relationship. Kind regards, Niels Hoogeveen Date: Fri, 26 Mar 2010 11:26:29 +0100 From: matt...@neotechnology.com To: user@lists.neo4j.org Subject: Re: [Neo] meta meta classes That's an interresting case you've got here and it looks to me like it's probably the best way to model it in the meta model. 2010/3/25 Niels Hoogeveen pd_aficion...@hotmail.com For my application, I want to model an HTML template in Neo4J, using the MetaModel api. So I started setting up MetaModelClasses for the various HTML entities. e.g. (code in Scala) val classProp = namespace.getMetaProperty(class, true) val idProp = namespace.getMetaProperty(id, true) idProp.setCardinality(1) val body = namespace.getMetaClass(body, true) body.getDirectProperties(classProp) body.getDirectProperties(idProp) Which creates a class named body which has a property named class without a cardinality restriction and a property named id with a cardinality restriction of 1. Now I can create nodes of class body with various values for class and for id. So far so good, but now I want to say that
Re: [Neo] meta meta classes
Very cool. -Original Message- From: Niels Hoogeveen pd_aficion...@hotmail.com Date: Fri, 26 Mar 2010 17:22:41 To: user@lists.neo4j.org Subject: Re: [Neo] meta meta classes Using Scala, I was actually able to extend MetaModelThing to act as a Node and MetaModelClass to have shadowing functionality for both MetaModelClasses and for MetaModelProperties, without touching the original source code. To: user@lists.neo4j.org From: rick.bullo...@burningskysoftware.com Date: Fri, 26 Mar 2010 14:29:03 + Subject: Re: [Neo] meta meta classes Such are the joys and challenges of frameworks and abstractions. Sometimes you do need to get close to the metal though, to achieve specific functional and performance requirements. Thus the reason open source frameworks are awesome. At least we can change and extend them more easily! -Original Message- From: Niels Hoogeveen pd_aficion...@hotmail.com Date: Fri, 26 Mar 2010 15:20:15 To: user@lists.neo4j.org Subject: Re: [Neo] meta meta classes Making MetaModelThing implement the Node interface is actually orthogonal to the creation of Shadow objects. Though it does make code using classes as objects cleaner, and allows the node property of MetaModelThing to become private. From: pd_aficion...@hotmail.com To: user@lists.neo4j.org Date: Fri, 26 Mar 2010 14:38:08 +0100 Subject: Re: [Neo] meta meta classes Or, and this probably the simplest solution. Let a MetaModelThing implement the Node interface. This allows a class to be an instance of another class and/or a SubType of another class. From: pd_aficion...@hotmail.com To: user@lists.neo4j.org Date: Fri, 26 Mar 2010 14:20:07 +0100 Subject: Re: [Neo] meta meta classes The class as object phenomenon is actually quite pervasive, and I think it is possible to have a generalized solution for it. After sending this email yesterday, I came up with a slightly different solution. val taggable = namespace.getMetaClass(taggable, true) val tagName = metaModelNamespace.getMetaProperty(tagname, true) tagName.setCardinality(1) val metaTaggable = metaModelNamespace.getMetaClass(taggable, true) metaTaggable.getDirectProperties.add(tagName) metaTaggable.getDirectInstances.add(taggable.node) val body = namespace.getMetaClass(body, true) taggable.getDirectSubs.add(body) Instead of directly relating the class body to the meta class taggable, I create a shadow of the meta class taggable with the same name in the namespace of the class body, and make body a subclass of this shadow. That way the sub classing relationship remains nicely in one name space, while the instance relationship transcends name spaces, as it should. This could in principle be generalized by adding a methods to MetaModelClass: public MetaModelClass createShadowClass(NameSpace ns){ MetaModelClass mc = ns.getMetaClass(this.getName(), true); this.getDirectInstances.add(mc.node); return mc; } This returns a shadow of a given MetaModelClass in a given namespace and adds it as a an instance of this. It would of course be nicer to have a method with the signature: public MetaModelClass getShadow(NameSpace ns, Boolean create) This is much more in line with the rest of the API, but requires a way to find out the namespace a given MetaModelClass is defined in. I didn't see a method getNamespace() for a given class, and didn't delve deeply enough in the source code to figure out how to do that. A similar approach can of course also be applied to MetaModelProperties, by adding the following method to MetaModelClass: public MetaModelProperty createShadowProperty(NameSpace ns){ MetaModelProperty mp = ns.getMetaProperty(this.getName(), true); this.getDirectInstances.add(mp.node); return mp; } This way the underlying node of a MetaModelProperty can properly be used as a class of its own and have properties, relationships, that can be further modeled in the meta layer. This e.q. allows to set a default rendering format for a given property class. I don't see a MetaModelRelationships, which is unfortunate, since that would allow the modeling of the properties of a Relationship. Kind regards, Niels Hoogeveen Date: Fri, 26 Mar 2010 11:26:29 +0100 From: matt...@neotechnology.com To: user@lists.neo4j.org Subject: Re: [Neo] meta meta classes That's an interresting case you've got here and it looks to me like it's probably the best way to model it in the meta model. 2010/3/25 Niels Hoogeveen pd_aficion...@hotmail.com For my application, I want to model an HTML template in Neo4J, using the MetaModel api. So I
[Neo] Neo4J on google app engine?
I assume there would be some issues, but does anyone have a high level view on the technical feasibility? ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Continuing REST API development
As tempting (and as necessary) as it might be to do transacted stuff, there are good ways and bad ways to do it. It is important that each REST-ful invocation be thought of as effectively stateless. That said, using an RPC-like approach where you have atomic invocations to: - Create a unit of work (a.k.a. transaction) and receive back a token, ideally as a URI, that represents that transaction - POST additional work to that URI - Commit/Rollback/Terminate that work (and render the URI no longer valid) A great reference is the book by Sam Ruby and Leonard Richardson. While I don't agree with 100% of the model proposed in the book, it definitely helped guide the REST-ful API in our product in a manner that made it very clean to implement, easy to consume, client agnostic, and quite flexible. Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Jim Webber Sent: Tuesday, March 23, 2010 11:39 AM To: Neo user discussions Subject: Re: [Neo] Continuing REST API development Hi Mattias, - GET / will return URIs for creating nodes and the reference node as well as the index starting point. Sounds sensible. What about using Atom feeds as the representation for a node set and AtomPub for handling node creation etc? - To have a browse:able representation in addition to JSON, so that you can click your way through the graph That would be nice, but... - Batch operations: to define more than one operation to be performed in a single transaction ...this would be better :-) - Security OAuth! I have some ideas about creating an OAuth graph and using that to determine authorisation. - Transaction control operations (begin, commit, rollback) Gah! Jim ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Indexing in the REST API
Why not just process the DELETE on the index URI as a delete on the node URI by doing the lookup/cross-reference on the server side? I heard that Neo4J is pretty good at tracking relationships like that. ;-) -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Tuesday, March 23, 2010 12:15 PM To: Neo4j user discussions Subject: [Neo] Indexing in the REST API I'm adding indexing to the REST API now and we just come up with a first solution where you POST a node URI to /index/{key}/{value}. What you get back is an index URI which is kind of an intermediate URI so that you can do GET on the index URI and get back a node representation, just as if you would have done a GET /node/{id}. This intermediate index URI will also serve its purpose when you'd like to remove a node from an index (DELETE index URI). My question now is: can we get rid of the intermediate index URI by including a payload in such DELETE requests instead (passing along a node URI)? Is it good/bad to do something like that? -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Indexing in the REST API
Ah, got it. In that case, I would just use an extended URI instead of passing a parameter, as in: If the index URI = /index/MyIndex ...and the node URI = /node/12134 ...the compound URI to delete could be either: /index/MyIndex/node/12134 ...or... /index/MyIndex/12134 Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Tuesday, March 23, 2010 12:21 PM To: Neo user discussions Subject: Re: [Neo] Indexing in the REST API DELETE on a node URI means delete the Node. DELETE on an index URI means remove a particular key-value pair from the index for a Node. i.e. two different things 2010/3/23 Rick Bullotta rick.bullo...@burningskysoftware.com Why not just process the DELETE on the index URI as a delete on the node URI by doing the lookup/cross-reference on the server side? I heard that Neo4J is pretty good at tracking relationships like that. ;-) -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Tuesday, March 23, 2010 12:15 PM To: Neo4j user discussions Subject: [Neo] Indexing in the REST API I'm adding indexing to the REST API now and we just come up with a first solution where you POST a node URI to /index/{key}/{value}. What you get back is an index URI which is kind of an intermediate URI so that you can do GET on the index URI and get back a node representation, just as if you would have done a GET /node/{id}. This intermediate index URI will also serve its purpose when you'd like to remove a node from an index (DELETE index URI). My question now is: can we get rid of the intermediate index URI by including a payload in such DELETE requests instead (passing along a node URI)? Is it good/bad to do something like that? -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Indexing in the REST API
Make sense. I would plan ahead, however, and allow for more than one index (named indexes, different index types, etc.). As in the previous post, I'd suggest using an extended URI syntax instead of passing URI's as parameters. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tobias Ivarsson Sent: Tuesday, March 23, 2010 12:32 PM To: Neo user discussions Subject: Re: [Neo] Indexing in the REST API What we are fishing for here is some input on how we could get rid of the index URI. They were added to the design we are working with now for the sole purpose of enabling us to remove a node from an index association. We create index associations for nodes by POSTing the node URI to /index/{key}/{value}, but creating URIs for the sole purpose of being able to unindex nodes seems a bit wasteful, if anyone has a better suggestion that would be great. /Tobias On Tue, Mar 23, 2010 at 5:15 PM, Mattias Persson matt...@neotechnology.comwrote: I'm adding indexing to the REST API now and we just come up with a first solution where you POST a node URI to /index/{key}/{value}. What you get back is an index URI which is kind of an intermediate URI so that you can do GET on the index URI and get back a node representation, just as if you would have done a GET /node/{id}. This intermediate index URI will also serve its purpose when you'd like to remove a node from an index (DELETE index URI). My question now is: can we get rid of the intermediate index URI by including a payload in such DELETE requests instead (passing along a node URI)? Is it good/bad to do something like that? -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Indexing in the REST API
Not sure I'm following the question, but let me take a guess: To find all indexes: GET /index To find all nodes in an index GET /index/IndexName/*/* To find all values for a given key: GET /index/IndexName/key To find all nodes that contain any value for a given key: GET /index/IndexName/key/* To find all nodes that match a key/value pair GET /index/IndexName/key/value To add a new index PUT /index/NewIndexName To add a new entry: PUT /index/IndexName/key/value/nodeURI To delete an entry: DELETE /index/IndexName/key/value/nodeURI -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Tuesday, March 23, 2010 12:41 PM To: Neo user discussions Subject: Re: [Neo] Indexing in the REST API 2010/3/23 Rick Bullotta rick.bullo...@burningskysoftware.com Ah, got it. In that case, I would just use an extended URI instead of passing a parameter, as in: If the index URI = /index/MyIndex ...and the node URI = /node/12134 ...the compound URI to delete could be either: /index/MyIndex/node/12134 ...or... /index/MyIndex/12134 And how would those URIs be discoverable? Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Tuesday, March 23, 2010 12:21 PM To: Neo user discussions Subject: Re: [Neo] Indexing in the REST API DELETE on a node URI means delete the Node. DELETE on an index URI means remove a particular key-value pair from the index for a Node. i.e. two different things 2010/3/23 Rick Bullotta rick.bullo...@burningskysoftware.com Why not just process the DELETE on the index URI as a delete on the node URI by doing the lookup/cross-reference on the server side? I heard that Neo4J is pretty good at tracking relationships like that. ;-) -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Tuesday, March 23, 2010 12:15 PM To: Neo4j user discussions Subject: [Neo] Indexing in the REST API I'm adding indexing to the REST API now and we just come up with a first solution where you POST a node URI to /index/{key}/{value}. What you get back is an index URI which is kind of an intermediate URI so that you can do GET on the index URI and get back a node representation, just as if you would have done a GET /node/{id}. This intermediate index URI will also serve its purpose when you'd like to remove a node from an index (DELETE index URI). My question now is: can we get rid of the intermediate index URI by including a payload in such DELETE requests instead (passing along a node URI)? Is it good/bad to do something like that? -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Indexing in the REST API
Below is similar to the way we do discovery. The results returned from our REST-ful interface are hyperlinks in the case of HTML output, or a collection of strings representing URI's in JSON and XML format. My general feeling is that the primary use for payloads should be in POSTs and in RPC-like services. It is best if the specific semantics of what function you intend to accomplish and what resource you intend to accomplish it upon can be expressed in the URI itself. In our REST-ful API, we provide support for query parameters primarily as name/value pairs in the GET request to provide filtering, searching, and other behaviors that enhance the specificity of the request beyond what makes sense to include in the URI. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Tuesday, March 23, 2010 2:53 PM To: Neo user discussions Subject: Re: [Neo] Indexing in the REST API What I meant was that URIs shouldn't be handcrafted by the client, but instead retrieved (discoverable) from the server. And the original question was if it's ok to send a payload to a DELETE request. In that case the intermediate index URI can be skipped in favor of a URI template which is discoverable from the server (any input here Jim?). Your suggestion here is roughly the same as our first brainstorm as well, so that's good so far :) 2010/3/23, Rick Bullotta rick.bullo...@burningskysoftware.com: Not sure I'm following the question, but let me take a guess: To find all indexes: GET /index To find all nodes in an index GET /index/IndexName/*/* To find all values for a given key: GET /index/IndexName/key To find all nodes that contain any value for a given key: GET /index/IndexName/key/* To find all nodes that match a key/value pair GET /index/IndexName/key/value To add a new index PUT /index/NewIndexName To add a new entry: PUT /index/IndexName/key/value/nodeURI To delete an entry: DELETE /index/IndexName/key/value/nodeURI -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Tuesday, March 23, 2010 12:41 PM To: Neo user discussions Subject: Re: [Neo] Indexing in the REST API 2010/3/23 Rick Bullotta rick.bullo...@burningskysoftware.com Ah, got it. In that case, I would just use an extended URI instead of passing a parameter, as in: If the index URI = /index/MyIndex ...and the node URI = /node/12134 ...the compound URI to delete could be either: /index/MyIndex/node/12134 ...or... /index/MyIndex/12134 And how would those URIs be discoverable? Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Tuesday, March 23, 2010 12:21 PM To: Neo user discussions Subject: Re: [Neo] Indexing in the REST API DELETE on a node URI means delete the Node. DELETE on an index URI means remove a particular key-value pair from the index for a Node. i.e. two different things 2010/3/23 Rick Bullotta rick.bullo...@burningskysoftware.com Why not just process the DELETE on the index URI as a delete on the node URI by doing the lookup/cross-reference on the server side? I heard that Neo4J is pretty good at tracking relationships like that. ;-) -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Tuesday, March 23, 2010 12:15 PM To: Neo4j user discussions Subject: [Neo] Indexing in the REST API I'm adding indexing to the REST API now and we just come up with a first solution where you POST a node URI to /index/{key}/{value}. What you get back is an index URI which is kind of an intermediate URI so that you can do GET on the index URI and get back a node representation, just as if you would have done a GET /node/{id}. This intermediate index URI will also serve its purpose when you'd like to remove a node from an index (DELETE index URI). My question now is: can we get rid of the intermediate index URI by including a payload in such DELETE requests instead (passing along a node URI)? Is it good/bad to do something like that? -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User
Re: [Neo] Indexing on Doubles in Neo4j
Maybe this? http://components.neo4j.org/neo4j-graph-algo/apidocs/org/neo4j/graphalgo/cen trality/package-summary.html -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Alex D'Amour Sent: Monday, March 22, 2010 5:06 PM To: Neo user discussions Subject: [Neo] Indexing on Doubles in Neo4j Hello all, I'm working on an application where it would be nice to perform lookups on a graph database based on real-valued properties. For example, if I have a social network, and have assigned real-valued centrality measures to each node, I'd like to be able to choose all vertices whose centrality measure is greater than some threshold. I see that the Timeline index service offers this for integer-valued properties. Is there something similar (or in the pipeline) for doing the same with real-valued properties? Is there an easy way to adapt one of the current indexing utilities to do this (besides multiplying by 10^n for sufficiently large n and then rounding)? Thanks, Alex D'Amour Harvard Institute for Quantitative Social Science ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Question regarding nioneo_logical.log
Thanks for the info. That triggers more questions, of course. So what happens if the system crashes before the log is rotated? Will all of the transactions in the log be rolled back (even if they have already been committed)? Or will they be flushed on startup? -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tobias Ivarsson Sent: Thursday, March 18, 2010 5:34 AM To: Neo user discussions Subject: Re: [Neo] Question regarding nioneo_logical.log The logical log is rotated when it grows to 10M. When the log is rotated the data is flushed to the respective stores. What sizes are you seeing on the logical log? If its (much) larger than 10M, and you haven't configured Neo4j to use a larger logical log, then we will need to look into why that is happening. Cheers, Tobias On Wed, Mar 17, 2010 at 10:52 PM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: I notice this file growing rather large during system operation, even though we are doing very small transactions. It seems that the transaction are only flushed to the respective node, property, and relationship stores on shutdown. This of course creates concern, since we are implementing an always on application that never shuts down (OK, in theory). AFAIK, we are calling tx.finish() on each transaction. Thanks for any insights on whether this behavior is to be expected and/or possible causes if it isn't normal... Thanks! Rick ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Question regarding nioneo_logical.log
Cool. So the only transactions that could be lost would be ones that were uncommitted prior to the crash. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tobias Ivarsson Sent: Thursday, March 18, 2010 9:55 AM To: Neo user discussions Subject: Re: [Neo] Question regarding nioneo_logical.log If the system crashes Neo4j will begin the next startup with a recovery phase. During the recovery phase the logical log will be replayed. This reapplies all committed transactions, bringing Neo4j back to the state it was in before the crash. Cheers, Tobias On Thu, Mar 18, 2010 at 2:27 PM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Thanks for the info. That triggers more questions, of course. So what happens if the system crashes before the log is rotated? Will all of the transactions in the log be rolled back (even if they have already been committed)? Or will they be flushed on startup? -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tobias Ivarsson Sent: Thursday, March 18, 2010 5:34 AM To: Neo user discussions Subject: Re: [Neo] Question regarding nioneo_logical.log The logical log is rotated when it grows to 10M. When the log is rotated the data is flushed to the respective stores. What sizes are you seeing on the logical log? If its (much) larger than 10M, and you haven't configured Neo4j to use a larger logical log, then we will need to look into why that is happening. Cheers, Tobias On Wed, Mar 17, 2010 at 10:52 PM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: I notice this file growing rather large during system operation, even though we are doing very small transactions. It seems that the transaction are only flushed to the respective node, property, and relationship stores on shutdown. This of course creates concern, since we are implementing an always on application that never shuts down (OK, in theory). AFAIK, we are calling tx.finish() on each transaction. Thanks for any insights on whether this behavior is to be expected and/or possible causes if it isn't normal... Thanks! Rick ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Tobias Ivarsson tobias.ivars...@neotechnology.com Hacker, Neo Technology www.neotechnology.com Cellphone: +46 706 534857 ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo] Question regarding nioneo_logical.log
I notice this file growing rather large during system operation, even though we are doing very small transactions. It seems that the transaction are only flushed to the respective node, property, and relationship stores on shutdown. This of course creates concern, since we are implementing an always on application that never shuts down (OK, in theory). AFAIK, we are calling tx.finish() on each transaction. Thanks for any insights on whether this behavior is to be expected and/or possible causes if it isn't normal... Thanks! Rick ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Javascript/JSON binding?
Hi, Chris. In any case, you're going to need to cross the embedded Java boundary. The cheapest way might be to leverage the REST-ful interface that is under development. You'll definitely be paying a bit of a performance penalty in any scenario for the JSON-ization of large graphs. You'll probably also want to integrate some type of encoding/decoding for Neo byte arrays (not sure what the REST-ful interface sends them as - probably Base64?) and for JS Date objects (since Neo does not natively recognize a date/time/timestamp primitive type). Definitely spinning up an embedded JVM would be the fastest, but never having done a node.js or V8 plug-in, I can't really gauge what the effort would be to do so. I would think, however, that since the ability to access an embedded JVM is probably of interest to others, it could be done as a pretty horizontal (e.g. non-Neo-specific) way, if it hasn't been done already (I bet a big part of the source would already be in the Chromium project). Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Chris Dew Sent: Saturday, March 13, 2010 2:46 AM To: user@lists.neo4j.org Subject: [Neo] Javascript/JSON binding? Hi, I'm new to this mailling list. I just wondered if there was a Javascript/JSON binding for Neo4j which made the database available to NodeJS. This could done as: 1. a C++ NodeJS plugin 2. JSON objects over TCP 3. JSON objects over HTTP (less efficient, could be extended for browser-side with auth, transaction/session issues) 4. JSON objects over HTML5 websockets (though I don't think NodeJS has a websockets CLIENT yet) Any thoughts? Chris. -- http://www.finalcog.com/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Connecting to Neo4j DB from ActionScript
Hi, Amir. Most of what we're doing is fairly specific to our domain model (each node has a type and a name property) and technology landscape (WebORB backend, for example), but there are some guidelines I can share with you to help. 1) You'll want to create a viewer based on ExtendedFlexGraph, which brings with it a lot of very useful filtering/searching/layout capabilities that the base FlexGraph class does not have 2) You'll want to create a custom node renderer and a custom arc (relationship) renderer. We overrode the newInstance(), set data, and addToolTipValues() methods to allow us to display Neo node and relationship properties in the mouse-over event, and to provide custom text to display on each node/relationship. The Neo relationship model fits nicely with Flexviz in that an arc in Flexviz has a type that corresponds to the RelationshipType in neo. The Neo node model also fits reasonably well, with the concept of an id (arcs have id's also). 3) You'll need a back-end service (servlet or other) to get data to your Flex front end. We're using WebORB, which allows a high performance bridge to the Flex app using Flex remoting (and a binary protocol), but you could do the same thing with a Flex HTTPService and by outputting XML from a servlet, perhaps in some variant of GraphML. In the handler for a response for the server, you'll then want to parse the result and create the graph model inside Flexviz. Here's the code we use (realize that our result structure is a native object, but the same approach could be used with XML). neoModel = response.result as ArrayCollection; graph.nodeRenderer = new NeoNodeRenderer(); graph.arcRenderer = new NeoRelationshipRenderer(); model = new DefaultGraphModel(); var node:Object; var edge:Object; for each(node in neoModel) { var graphNode:DefaultGraphNode = new DefaultGraphNode(node.id, node.type, node.name, node); model.addNode(graphNode); } for each(node in neoModel) { for each(edge in node.edges) { var fromItem: IGraphNode = model.getNode(edge.fromNode); var toItem: IGraphNode = model.getNode(edge.toNode); var arc:DefaultGraphArc = new DefaultGraphArc(edge.id, fromItem, toItem, edge.type, edge, false, true); model.addArc(arc); } } graph.model = model; var layout:ILayoutAlgorithm = new RadialLayoutAlgorithm(); graph.runLayout(layout); 4) On the server side, we created a class that handles client requests, with a single parameter corresponding to the root node of the request. In our case, we don't want to display the entire Neo4J graph - only nodes one relationship away from a specified node (similar to Neoclipse's default behavior) 5) On the client, we created a double click handler for the graph so that double-clicking a node reinvokes the service with a new root node and redisplays the graph. It is easy to implement a go back function by keeping track of the previous root node id's in a stack. Hope that helps! Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Amir Hossein Jadidinejad Sent: Saturday, March 13, 2010 12:04 AM To: Neo user discussions Subject: Re: [Neo] Connecting to Neo4j DB from ActionScript Dear Rick, It's really interesting. Would you please share your experiments with us?, Some example, source code,... Greatly appreciate your help. Kind regards, Amir --- On Fri, 3/12/10, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: From: Rick Bullotta rick.bullo...@burningskysoftware.com Subject: Re: [Neo] Connecting to Neo4j DB from ActionScript To: 'Neo user discussions' user@lists.neo4j.org Date: Friday, March 12, 2010, 6:27 PM Amir, I'm doing something similar (also with Flexviz). I looked at a number of other Flex graph visualization libraries (Kapit, SpringGraph, YFiles, Raviz/Birdeye, Flare) and definitely preferred Flexviz to the others. It seems quite extensible/customizable as well. I'm using Flex/Flash remoting between
Re: [Neo] Connecting to Neo4j DB from ActionScript
Amir, I'm doing something similar (also with Flexviz). I looked at a number of other Flex graph visualization libraries (Kapit, SpringGraph, YFiles, Raviz/Birdeye, Flare) and definitely preferred Flexviz to the others. It seems quite extensible/customizable as well. I'm using Flex/Flash remoting between the server and the client, and on the server side, I'm using WebORB Java. Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Amir Hossein Jadidinejad Sent: Friday, March 12, 2010 5:10 PM To: Neo user discussions Subject: Re: [Neo] Connecting to Neo4j DB from ActionScript Dear Todd, I'm not familiar with them. Would you please provide me a simple how-to or some source code example? In fact, I'm going to visualise the Neo4j DB using FlexViz. It's really beautiful and flexible. Thanks. Amir --- On Fri, 3/12/10, Todd Stavish toddstav...@gmail.com wrote: From: Todd Stavish toddstav...@gmail.com Subject: Re: [Neo] Connecting to Neo4j DB from ActionScript To: Neo user discussions user@lists.neo4j.org Date: Friday, March 12, 2010, 4:43 PM Hi Amir, I used GSON (google's json package) on the Neo side and Flex's json AS3 classes to make the connection. -Todd On Fri, Mar 12, 2010 at 4:31 PM, Amir Hossein Jadidinejad amir.jad...@yahoo.com wrote: Hi, Is it possible to connect a Neo4j instance using ActionScript and Adobe Flex?! Thanks. ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Nodes commonly connected to a set of predefined nodes in a graph
Sounds fairly easy. To use your customer analogy, simply iterate on all nodes that have a PurchasedProduct relationship with the ProductX node (these will be customer nodes, based on the domain model), and iterate one level beyond the customer (e.g. other things they purchased), and exclude the original node. Keep a HashMap or other structure filled with the unique ProductName/ProductNode (or POJO) list as you traverse. The net result is that you'll end up with a list of the distinct set of products purchased by all customers who purchased productX. Original Message Subject: [Neo] Nodes commonly connected to a set of predefined nodes in a graph From: Sumanth Thikka suma...@truesparrow.com Date: Fri, March 05, 2010 1:03 am To: Neo user discussions user@lists.neo4j.org Hi, I am searching for an optimal way to find a commonly connected nodes to a set of nodes in a graph. Consider the case where n1, n2, n3, n4 ,n5 are 5 nodes in a graph. These 5 are connected to the other nodes. I need to find the nodes in the graph which are connected all above 5 nodes optimally. The solution which I can think of is like: Find all the relationships(of a type, say KNOWS) of each of the above 5 nodes and get to know the node with minimum relationships say n3. For each node connected to n3, find the nodes which are connected to all the other four nodes. Which is our result set. A similar link [1]http://lists.neo4j.org/pipermail/user/2010-February/002722.html provided earlier in the other thread. From what I understood from the link, it is to know the products bought by any of the customers who bought productX. Whereas, in my case, I need the products which were bought by all the customers who bought product X . I am not very sure how this solution can be extended to my case, if possible. Is there any other way or a graph algorithm to solve this in a more optimal way. Thanks, Sumanth ___ Neo mailing list User@lists.neo4j.org [2]https://lists.neo4j.org/mailman/listinfo/user References 1. http://lists.neo4j.org/pipermail/user/2010-February/002722.html 2. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Undirected relationships
Hi, Amir. That is because you are calling getEndNode() when printing the output, which is a direction-specific method. You should be calling getOtherNode(). Regards, Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Amir Hossein Jadidinejad Sent: Thursday, March 04, 2010 5:08 PM To: neo4j Subject: [Neo] Undirected relationships Hi, I'm going to setup a Nearest Neighbour Graph. Its relations are not directed. How to define undirected relationships in Neo4j? By the way, I'm confused with relations! check the following codes to create a simple graph: GraphDatabaseService graphDb = new EmbeddedGraphDatabase(var); IndexService index = new LuceneIndexService(graphDb); Transaction tx = graphDb.beginTx(); try { Node andy = graphDb.createNode(); Node larry = graphDb.createNode(); andy.setProperty(name, Andy Wachowski); index.index(andy, name, andy.getProperty(name)); larry.setProperty(name, Larry Wachowski); index.index(larry, name, larry.getProperty(name)); andy.createRelationshipTo(larry, MyRelationshipTypes.KNOWS); tx.success(); } finally { tx.finish(); index.shutdown(); graphDb.shutdown(); } This is a simple relations from andy to larry. When I print the neighbours of larry by the following codes: Node a = index.getSingleNode(name, Larry Wachowski); System.out.println(Relations:); for(Relationship r: a.getRelationships()) System.out.println(r.getEndNode().getProperty(name)); The output is: Relations: Larry Wachowski It means that larry is related to himself! why? Kind regards, Amir ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Undirected relationships
That means that you buy the first round of beers next week at the NoSQL conference... -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Peter Neubauer Sent: Thursday, March 04, 2010 5:18 PM To: Neo user discussions Subject: Re: [Neo] Undirected relationships Damn Rick, you beat me with 10 seconds on the answer! Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://www.tinkerpop.com - Processing for Internet-scale graphs. http://www.thoughtmade.com - Scandinavias coolest Bring-a-Thing party. On Thu, Mar 4, 2010 at 11:16 PM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Hi, Amir. That is because you are calling getEndNode() when printing the output, which is a direction-specific method. You should be calling getOtherNode(). Regards, Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Amir Hossein Jadidinejad Sent: Thursday, March 04, 2010 5:08 PM To: neo4j Subject: [Neo] Undirected relationships Hi, I'm going to setup a Nearest Neighbour Graph. Its relations are not directed. How to define undirected relationships in Neo4j? By the way, I'm confused with relations! check the following codes to create a simple graph: GraphDatabaseService graphDb = new EmbeddedGraphDatabase(var); IndexService index = new LuceneIndexService(graphDb); Transaction tx = graphDb.beginTx(); try { Node andy = graphDb.createNode(); Node larry = graphDb.createNode(); andy.setProperty(name, Andy Wachowski); index.index(andy, name, andy.getProperty(name)); larry.setProperty(name, Larry Wachowski); index.index(larry, name, larry.getProperty(name)); andy.createRelationshipTo(larry, MyRelationshipTypes.KNOWS); tx.success(); } finally { tx.finish(); index.shutdown(); graphDb.shutdown(); } This is a simple relations from andy to larry. When I print the neighbours of larry by the following codes: Node a = index.getSingleNode(name, Larry Wachowski); System.out.println(Relations:); for(Relationship r: a.getRelationships()) System.out.println(r.getEndNode().getProperty(name)); The output is: Relations: Larry Wachowski It means that larry is related to himself! why? Kind regards, Amir ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Philadelphia and Boston Neo4j meetup next week!
Will try to get there. I don't want to sign up for Ning, though (social network overload!) - who can we RSVP to in an old school way...? -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Peter Neubauer Sent: Thursday, March 04, 2010 5:25 PM To: Neo user discussions Subject: [Neo] Philadelphia and Boston Neo4j meetup next week! Hi folks, I am going to present at NoSQL Live in Boston next week, http://www.10gen.com/events - feel free to join, and thanks to 10gen for organising! However, on Tuesday, there is a Neo4j meetup in Philadelphia going on. If you wanna meet up for some relationship building, welcome at http://phillyspring.ning.com/events/march-meeting-all-the-good ! Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://www.tinkerpop.com - Processing for Internet-scale graphs. http://www.thoughtmade.com - Scandinavias coolest Bring-a-Thing party. ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo] Neoclipse FTW!
Well, the good news is that I finally got Neoclipse running standalone (all attempts to get it to work with Eclipse 3.5 were unsuccessful), and the tool is fantastic! It will save me many, many hours of debugging and diagnostic effort. Really nice job by the team that put it together. One question I had was whether there was any way to get Neoclipse running in a read-only mode against a running instance of Neo4J (in this case, one that is running embedded in Tomcat). I think this capability would be incredibly valuable, as would the more general ability to have an out of proc read-only Neo API allowing multiple processes the ability to interact with a Neo graph. Is this even technically feasible? ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo] Deleting a property
Perhaps a stupid question, but is setting a property to null effectively the same as deleting a property? ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Neoclipse FTW!
I was never able to get it working. Only as a standalone in the provided Eclipse container. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Ernesto A. Sent: Wednesday, March 03, 2010 11:51 AM To: Neo user discussions Subject: Re: [Neo] Neoclipse FTW! I'm trying to get Neoclipse running under Eclipse in Ubuntu 9.10 but it continuously crashes the IDE. Would you mind sharing your experiences about it? Best regards, ernesto. On Wed, Mar 3, 2010 at 10:14 AM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Well, the good news is that I finally got Neoclipse running standalone (all attempts to get it to work with Eclipse 3.5 were unsuccessful), and the tool is fantastic! It will save me many, many hours of debugging and diagnostic effort. Really nice job by the team that put it together. One question I had was whether there was any way to get Neoclipse running in a read-only mode against a running instance of Neo4J (in this case, one that is running embedded in Tomcat). I think this capability would be incredibly valuable, as would the more general ability to have an out of proc read-only Neo API allowing multiple processes the ability to interact with a Neo graph. Is this even technically feasible? ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Neoclipse FTW!
Hi, Anders. I ran into all kinds of trouble with trying to get the dependencies satisfied under Eclipse 3.5.1. What is the best site for getting the necessary Zest stuff or other required dependency parts? LMK and I'll give it a try. Thanks, Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Anders Nawroth Sent: Wednesday, March 03, 2010 3:07 PM To: Neo user discussions Subject: Re: [Neo] Neoclipse FTW! Hi! Ernesto A. wrote: I'm trying to get Neoclipse running under Eclipse in Ubuntu 9.10 but it continuously crashes the IDE. Would you mind sharing your experiences about it? Best regards, ernesto. I just tried the snapshot version from here: http://eclipse.neo4j.org/neoclipse/snapshot/ in Ubuntu 9.10 + Eclipse Galileo / 3.5.1 (Java EE version). It worked fine. It should also work fine with Eclipse Ganymede (that's what the snapshot plugin is built against). For different reasons I find the standalone version a much better choice :-) It's possible to connect to a running Neo4j instance by exposing it as a server using http://components.neo4j.org/neo4j-remote-graphdb/ and entering the resource URI in the settings of Neoclipse. (the resource URI will take precedence over the database directory setting) This is just veeery untested ... worked last time I tried it. /anders On Wed, Mar 3, 2010 at 10:14 AM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Well, the good news is that I finally got Neoclipse running standalone (all attempts to get it to work with Eclipse 3.5 were unsuccessful), and the tool is fantastic! It will save me many, many hours of debugging and diagnostic effort. Really nice job by the team that put it together. One question I had was whether there was any way to get Neoclipse running in a read-only mode against a running instance of Neo4J (in this case, one that is running embedded in Tomcat). I think this capability would be incredibly valuable, as would the more general ability to have an out of proc read-only Neo API allowing multiple processes the ability to interact with a Neo graph. Is this even technically feasible? ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Typing of nodes (WAS: Java outof 64 GB ram)
Actually, we do have the case (due to an indexing/tagging model that can span many diverse types) where we do not have knowledge within the domain model of the specific type of entity represented by a node at one end of a relationship, thus the reason for marking them with a type property -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Monday, March 01, 2010 4:25 AM To: Neo user discussions Subject: Re: [Neo] Typing of nodes (WAS: Java outof 64 GB ram) 2010/2/26 rick.bullo...@burningskysoftware.com: Hi, Mattias. We had a similar requirement (to track the type of a node), and while we were able to achieve this with relationships in very constrained scenarios, we could not do so in a more general sense. Let me explain and maybe you can suggest some ideas. We have collections of typed entities: dogs, trees, cars. Each dog node relates to a dogs node, which in turn relates to the root node. This way, we can easily traverse all of the dogs and trees, etc... Imagine then a collection of locations. Dogs, trees, and cars can be related to a location. Thus, we can find all of the entities associated with a specific location. However, when we traverse these relationships from location to other entities, we lose the type-ness, since all we have is a generic node identity at the end of the relationship. We thought about iterating through a series of hasSingleRelationship checks on all of the known type relationships on the node, but that seemed excessive. Thus, we now set a property on each node that corresponds to the string representation (enum.name()) for its type relationship. We avoided using the ordinal of the enum as the property since that could be fragile and also to make the property more readable during debugging. Sure, it you go with a more generic relationship type then of course you'll have to store that information as f.ex. a property instead. These kind of types dog, cat, car or whatever suits better with properties, whereas domain model types, such as User or Group or Organisation can be great with only relationship types. So there's a difference between types and types, if you know what I mean. And it's not like you randomly grab a domain model object's node and try to find out its type... usually you hop one relationship (or some) and typically know roughly what you're landing at, so in such cases you won't have to iterate through ALL your types and do getSingleRelationship to figure out its type. One advantage of this approach is that it is very easy to invert this String property using enum.valueOf() to turn it back into the underlying relationship type enum (for faster comparisons, different types of traversals, etc.). Another is that it provides a much easier way to deal with import/export of graph subsets since we can infer directly from the node what it is and how to serialize/deserialize it to XML, JSON, etc. I haven't looked at the source code for the various POJO-Neo libraries, but I'd suspect that they have to tag the node with a type property as well. Thus far, it seems to work well. I welcome your thoughts as to alternative approaches, however. Rick Original Message Subject: Re: [Neo] Java outof 64 GB ram From: Mattias Persson matt...@neotechnology.com Date: Fri, February 26, 2010 5:11 am To: Neo user discussions user@lists.neo4j.org 2010/2/26 Miguel Ãngel Ãguila magu...@ac.upc.edu: I will explain me better. Every node has: - One String that have 5 chars. - One String that have 3 chars. - One String that have 4 chars. - One String that have 100 chars. Is one of them any kind of node type? Because often you can infer a type from its relationships or surrounding environment, making that property redundant in a way. (nodes can often represent one or more logical entities, hence a single type wouldn't suffice and that's why it isn't built in to the API). Mike El vie, 26-02-2010 a las 10:05 +0100, Miguel Ãngel Ãguila Lorente escribió: I don't know if I'm answering your question but every node has 4 pairs of String, therefore 4 pairs of char(15). Mike El jue, 25-02-2010 a las 07:18 -0700, rick.bullo...@burningskysoftware.com escribió: Yes, exactly the question. If it's a big string, it is quite possible to have the file grow this large. Miguel, approximately how long is the property value? Original Message Subject: Re: [Neo] Java outof 64 GB ram From: Johan Svensson jo...@neotechnology.com Date: Thu, February 25, 2010 7:13 am To: Neo user discussions user@lists.neo4j.org If you store 322M strings (one string
Re: [Neo] Java outof 64 GB ram
Yes, exactly the question. If it's a big string, it is quite possible to have the file grow this large. Miguel, approximately how long is the property value? Original Message Subject: Re: [Neo] Java outof 64 GB ram From: Johan Svensson jo...@neotechnology.com Date: Thu, February 25, 2010 7:13 am To: Neo user discussions user@lists.neo4j.org If you store 322M strings (one string property/relationship), were each string is 200 bytes, the string store will be 60GB+ in size. How large are the strings you are storing? -Johan On Thu, Feb 25, 2010 at 2:55 PM, rick.bullo...@burningskysoftware.com wrote: The string propertystore file seems really, really large to me, based on the # of nodes/relationships/properties. The reason I ask is that I saw similar behavior in some of our early testing. Extremely large string propertystores file. It would be helpful to understand why the file gets that large, and whether it is related to some of the memory stress issues. Original Message Subject: Re: [Neo] Java outof 64 GB ram From: Miguel �ngel_�guila Lorente magu...@ac.upc.edu Date: Thu, February 25, 2010 1:57 am To: Neo user discussions user@lists.neo4j.org There are 322 million relationships, no 57 million relationships. The only propierty I save in the relationship is a String. In this 322 million relationships there are 3 diferents types of relations. Do you think that 13 GB is a strange number? Why? ___ Neo mailing list User@lists.neo4j.org [1]https://lists.neo4j.org/mailman/listinfo/user References 1. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Java outof 64 GB ram
I guess the bigger question to me is why 57 million relationships would require 13 GB for the propertystore file and 67 GB for the string propertystore. Something doesn't seem right. Can you describe what types of properties you're storing on each node/relationship? Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Miguel Ángel Águila Lorente Sent: Wednesday, February 24, 2010 6:29 AM To: Neo user discussions Subject: Re: [Neo] Java outof 64 GB ram Around 57.000.000 nodes and 322.000.000 relationships. Now I'm trying with the following configuration: neostore.nodestore.db.mapped_memory=913M neostore.relationshipstore.db.mapped_memory=11G neostore.propertystore.db.mapped_memory=50M neostore.propertystore.db.strings.mapped_memory=100M neostore.propertystore.db.arrays.mapped_memory=0M I think that I had understood wrong the neo.props file. Now I'm expecting what happen. El mié, 24-02-2010 a las 11:19 +, Rick Bullotta escribió: Hello, Miguel. Approximately how many nodes and relationships are in your graph database? Rick -Original Message- From: Miguel Ángel Águila Lorente magu...@ac.upc.edu Date: Wed, 24 Feb 2010 11:06:35 To: Neo user discussionsuser@lists.neo4j.org Subject: Re: [Neo] Java outof 64 GB ram Hi, firstly I used the numbers of 9 bytes * number_of_nodes and 33 bytes * number_of_relations for the neo.props configure, but it doesn't work. After that I tried with my actual configuration: neostore.nodestore.db.mapped_memory=180G neostore.relationshipstore.db.mapped_memory=6000G neostore.propertystore.db.mapped_memory=50M neostore.propertystore.db.strings.mapped_memory=100M neostore.propertystore.db.arrays.mapped_memory=0M This are the numbers of my database: 488.2M neostore.nodestore.db 12.6G neostore.propertystore.db 67G neostore.propertystore.db.strings 9.9G neostore.relationshipstore.db In the page configuartion seetings the only thing (in my view) that could help me is the garbage collector but I've ever thought that garbage collector works when I need space and I have things to remove, therefore I'm not sure if this information can help me. El mié, 24-02-2010 a las 10:38 +0100, Johan Svensson escribió: Hi, What is the error/problem you get when executing the program? It is not a good idea to use all available RAM for the Java heap. Have a look at http://wiki.neo4j.org/content/Configuration_Settings for more information on how to configure Neo4j to make good use of available RAM. Regards, -Johan On Tue, Feb 23, 2010 at 6:11 PM, Miguel Angel Aguila magu...@ac.upc.edu wrote: Yes I give 64 GB and only 60 GB in diferent executions. 2010/2/23 Mattias Persson matt...@neotechnology.com One more thing... how much heap have you given the JVM? You control how much RAM your JVM gets with the -Xmx option to the java command. F.ex: java -Xmx10G -cp . Please see more information regarding performance and tweaking at http://wiki.neo4j.org/content/Neo4j_Performance_Guide 2010/2/23 Mattias Persson matt...@neotechnology.com: I see that you're using an older version of Neo4j. Have you tried using 1.0? http://components.neo4j.org/neo4j-kernel http://neo4j.org/download Maven groupId: org.neo4j artifactId: neo4j-kernel version: 1.0 ...and at first glance I don't see any direct problem with your code. 2010/2/23 Miguel Ángel Águila magu...@ac.upc.edu: Hello, I'm doing a code to walk around all the nodes and get the node with the maximum out degree. The main problem is that there are around 57 million of nodes and 322 million of edges in the neo database, and using a 64 GB RAM is insufficient to execute the program. It is the code: Can anyone see what I'm doing wrong? I don't understand. Thanks. Mike public static void getNodeMaxOutDegreeNeo(final NeoService neo, final IndexService indexService) { Node idNode; long degree; long maxDegree = 0; IndexHitsNode nodes; long idDegree; long idMaxDegree; Transaction tx = neo.beginTx(); try { nodes = indexService.getNodes(TYPE, titles); IteratorNode it = nodes.iterator(); Node idNodeMaxDegree=it.next(); IteratorRelationship relIterator = idNodeMaxDegree.getRelationships( NeoDataBase.MyRelationshipTypes.REF, Direction.OUTGOING).iterator(); while (relIterator.hasNext()) { relIterator.next(); maxDegree++; } long counter = 0; while (it.hasNext()) { if ( ++counter % 5 == 0 ) { tx.success
Re: [Neo] IllegalStateException meaning
I think it would be valuable to understand why the memory requirements are so large and how best to manage these types of situations in addition to increasing the heap, since it seems that in some cases this merely delays the issue. Is there any internal instrumentation on Neo memory usage that could be used to help tune/tweak the settings? If not, would it make sense to add a couple of MBeans for this type of information? Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Adam Rabung Sent: Tuesday, February 23, 2010 2:15 PM To: Neo user discussions Subject: Re: [Neo] IllegalStateException meaning I just got this same problem, and was able to defeat by upping heap size. It was very strange - does Transaction#finish do some non-blocking work? Disclaimer: I'm using trunk neo-kernel from 2/10. Thanks, Adam On Mon, Jun 1, 2009 at 1:31 PM, Johan Svensson jo...@neotechnology.com wrote: Great that it seems to work. Please do get back to me if you run into any problems. -Johan On Mon, Jun 1, 2009 at 7:06 PM, Rob Challen rjchal...@gmail.com wrote: Thanks Johan, I increased a whole lot of memory limits and swapped my jre over from IBM Java 64 bit to a sun 32 bit. Because it was happening after 2 hours into a load I didn't get to properly debug but so far the problem seems to have disappeared, and I can't reproduce it now. I think it may be a symptom of another problem somewhere else. Will get back to you if I can find anything more. Rob. On Sun, May 31, 2009 at 3:21 PM, Johan Svensson jo...@neotechnology.comwrote: Hi Rob, I've seen this problem once before but could not reproduce the behavior once I tried. Could you check if tx.success() is called before tx.finish()? Also, could you check in the stacktrace for the source of the nested IllegalStateException. -Johan On Sun, May 31, 2009 at 12:12 AM, Rob Challen rjchal...@gmail.com wrote: I am getting the following exception when I call a Transaction.finish(). It occurs during the load of a large medical terminology dataset, and prior to this error the load progress was found to be slowing. I can;t really figure out what the exception is telling me, or where to start looking to figure out the cause. If anyone can give me any pointers to explain the meaning of the error in neo4j I would be really grateful. The .finish() is in a loop that completes without any problem up to this point. I cannot completely rule out bad input - but finding that in a 1.5M nodes graph would be a challenge in itself. Exception in thread main java.lang.RuntimeException: java.lang.IllegalStateException: Tx status is: STATUS_COMMITING at org.neo4j.api.core.EmbeddedNeo$TransactionImpl.finish(EmbeddedNeo.java:383) ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo] Transaction/Exception question
If an exception cause a block of code to exit prior to a transaction being finish()ed, will it be implicitly finished in garbage collection? Here's the situation I want to try to implement : I would like to propagate the exception thrown by doSomething() to the caller of myFunc(), but also ensure that the transaction is properly failed and the transaction is properly finished, if necessary: public void myFunc() throws Exception { Transaction txneo.beginTx(); try { doSomething(); // This could throw an exception } catch(Exception ex) { tx.failure(); throw new Exception(An error has occurred: + ex.getMessage); } finally{ tx.finish(); } } I think I'm just not thinking clearly since I've been coding for 24 of the last 36 hours, so I wanted to see if I'm too tired to figure out what should be an easy exception handling scenario. Thanks Rick ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Choosing between a property or a node
Mattias (and everyone) - can you see a way to model multiple relationships of the same type between two nodes? We have few cases where the relationship is essentially the same type but might have different properties. Max's Class/Teacher scenario is somewhat similar. Rick Original Message Subject: Re: [Neo] Choosing between a property or a node From: Mattias Persson matt...@neotechnology.com Date: Fri, February 19, 2010 4:27 am To: Neo user discussions user@lists.neo4j.org I've included some first thoughts on how you could model this. The choice of properties/index vs. relationships is often quite obvious, but is some cases you'll have to try and see which fits best. But neo4j encourages you to create relationships if you're in doubt and it's often better to use more relationships types than fewer, i.e. it's good to be as specific as possible when modelling your graph. 2010/2/19 Max De Marzi Jr. maxdema...@gmail.com: Hello, What is the proper way to handle things that have only a few choices like: gender (male/female/unknown) status (active, inactive, purged) race(10 choices + other) etc. As properties of a Person node, or as nodes that link to the Person node? Pros or Cons of each method? It depends on how you're querying the data... gender, status and race could probably be modelled using properties (and maybe indexed with IndexService, see [1]http://components.neo4j.org/neo4j-index/) since you would use them as filters in queries. But if you're planning to do traversals which will bridge persons over to other persons (or other entities) via f.ex. status, then relationships would be handier. How about something with instances? Student took a Class (twice) once with This teacher, once with Another Teacher. The first time he failed, the second time he got a B. Create a StudentClass node with a property of Grade, linked to Teacher? Yes, have each student as a node. Each class instance as a node with TEACHES_IN relationship to teacher (and maybe CLASS_TYPE relationship to what type of class the class instance is). Have a TAKES_CLASS relationship between student and class instance and set grade property on that relationship. In order to answer: Find all students who took the class. Relationships between student and class. Find all students who took the class when it was offered in the spring semester (or taught by This Teacher). Start from either a teacher node (and go to the class instance) or from a class instance. They can be lookup up from and IndexService or something) and get relationships to students from there. Find all students who got a B If you create nodes for each grade available and create relationships to those grade nodes whenever a student gets a grade. Then it'd be easy to just get that B grade node and traverse all its relationships to students. Otherwise you could index the grade property from the ATTEND_CLASS relationships (see above) for the student nodes. Find all students to got a B in this class? Start from the class and traverse out to all its class instances and students, filtering those who got a B (using the grade property on ATTEND_CLASS relationships). Find all students to got a B in this class during the spring semester? Same as previous but only traverse those class instances which were offered in spring semester. Find all students to got a B in this class when This Teacher taught it? Start from either the teacher node or the class node and find the class instance for that class which the teacher has a relationship to. And tou get the students from there. I hope this will help you, Best, Mattias ___ Neo mailing list User@lists.neo4j.org [2]https://lists.neo4j.org/mailman/listinfo/user References 1. http://components.neo4j.org/neo4j-index/ 2. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Announcing Neo4j 1.0
Congratulations! --Original Message-- From: Johan Svensson Sender: user-boun...@lists.neo4j.org To: Neo user discussions ReplyTo: Neo user discussions Subject: [Neo] Announcing Neo4j 1.0 Sent: Feb 16, 2010 11:11 AM Friends, After ten years of development, we are happy to finally announce the release of Neo4j 1.0. It's available here: http://neo4j.org/download http://dist.neo4j.org/neo4j-kernel-1.0-binary.zip http://dist.neo4j.org/neo4j-kernel-1.0-binary.tar.gz For the kernel component this release includes documentation updates together with bug fixes for all known bugs. For more information see: http://dist.neo4j.org/CHANGES.txt Also included in this release is the Neo4j index component: http://components.neo4j.org/neo4j-index/ (version 1.0) You can download the kernel and index (together with some other useful components) bundled together in the apoc package: http://dist.neo4j.org/neo4j-apoc-1.0.zip http://dist.neo4j.org/neo4j-apoc-1.0.tar.gz If you are using maven you can depend on the following (group id=org.neo4j): neo4j-apoc 1.0 or individual components: neo4j-kernel 1.0 neo4j-index 1.0 Finally, let us just offer a huge thanks to everyone on this list, on twitter and in the broader community. Without the feedback and energy and passion and interest from all of you guys, all the endless nights of staring through java.nio stacktraces would never be worth it. We truly feel that 2010 is the year of the graph. Let's change the world. -- Regards, The Neo4j team ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Announcing Neo4j 1.0
Hi, Johan. Small question: The Kernel distribution includes jta-1_1.jar and the APOC distribution uses the Geronimo JTA jar. Is there any functional difference or any reason to not use the Geronimo version in all cases? Thanks, Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Johan Svensson Sent: Tuesday, February 16, 2010 11:12 AM To: Neo user discussions Subject: [Neo] Announcing Neo4j 1.0 Friends, After ten years of development, we are happy to finally announce the release of Neo4j 1.0. It's available here: http://neo4j.org/download http://dist.neo4j.org/neo4j-kernel-1.0-binary.zip http://dist.neo4j.org/neo4j-kernel-1.0-binary.tar.gz For the kernel component this release includes documentation updates together with bug fixes for all known bugs. For more information see: http://dist.neo4j.org/CHANGES.txt Also included in this release is the Neo4j index component: http://components.neo4j.org/neo4j-index/ (version 1.0) You can download the kernel and index (together with some other useful components) bundled together in the apoc package: http://dist.neo4j.org/neo4j-apoc-1.0.zip http://dist.neo4j.org/neo4j-apoc-1.0.tar.gz If you are using maven you can depend on the following (group id=org.neo4j): neo4j-apoc 1.0 or individual components: neo4j-kernel 1.0 neo4j-index 1.0 Finally, let us just offer a huge thanks to everyone on this list, on twitter and in the broader community. Without the feedback and energy and passion and interest from all of you guys, all the endless nights of staring through java.nio stacktraces would never be worth it. We truly feel that 2010 is the year of the graph. Let's change the world. -- Regards, The Neo4j team ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo] Check for existence of relationship between two nodes
There was a discussion of this last week, and I just wanted to add my wishlist request that there be a method on Node to lookup a specific relationship given the end node and relationship type (and, for that matter, direction).it would be very useful in some of our domain scenarios! It might also be useful to have a node zapper - a method to remove all relationships on a node, then delete the node. All of these are easy patterns to implement today, but it would be convenient to have them in the core, and there are probably some optimizations that could be done at that level. Rick ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Error on startup
Figured it out. It occurs if you try to create two instances of EmbeddedGraphDatabase that point to the same path. Need to clean up our singleton usage a bit. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Friday, February 12, 2010 9:27 AM To: Neo user discussions Subject: Re: [Neo] Error on startup I don't recognize that exception. Could you please provide the full stack trace for further information. 2010/2/12 Rick Bullotta rick.bullo...@burningskysoftware.com: On startup, if no neo database exists, we create one and populate it with some initial content. However, it recently started throwing an error: Could not create data source [nioneodb], see nested exception for cause of error. .and the nested error is: java.nio.channels.OverlappingFileLockException AFAIK, there is only one thread active doing any Neo work, since it is in the WebApp's context listener. Any thoughts? Thanks, Rick ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Database does not recover after unclean shutdown
I think johan just committed a fix for this... --Original Message-- From: Dmitri Livotov Sender: user-boun...@lists.neo4j.org To: user@lists.neo4j.org ReplyTo: Neo user discussions Subject: [Neo] Database does not recover after unclean shutdown Sent: Feb 8, 2010 6:24 AM Hi, while initially I was impressed by the graph traverlas speed, Im curently testing how the database survive after unclean shutdown. To do so, Im just running my test project as a java console app without registering a shutdown hook and then accidently killing the JVM via Ctrl+C or killall -9 First 3 rounds, after such resets, engine recovered lost and unfinished transactions in a seconds and database keeps running. However, on a 4-th round, when I terminated the database in process of full text indexing, I got the following exception on restart and database won't start anymore. Any ideas on how to cure similar situations - if this happened during the testing (and happened quite quickly, on a 3-4 round of killalls), this probably will happen in a production after a unexpected server poweroff or so. Thanks, Dmitri 08.02.2010 12:32:19 org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog doInternalRecovery INFO: Non clean shutdown detected on log [/home/dlivotov/neo4j-db/lucene/lucene.log.1]. Recovery started ... 08.02.2010 12:32:19 org.neo4j.kernel.impl.transaction.TxManager init INFO: Unresolved transactions found, recovery started ... Exception in thread main org.neo4j.kernel.impl.transaction.TransactionFailureException: No mapping found for branchId[0x262374] at org.neo4j.kernel.impl.transaction.XaDataSourceManager.getXaResource(XaDataSourceManager.java:183) at org.neo4j.kernel.impl.transaction.TxManager.getXaResource(TxManager.java:867) at org.neo4j.kernel.impl.transaction.TxManager.buildRecoveryInfo(TxManager.java:385) at org.neo4j.kernel.impl.transaction.TxManager.recover(TxManager.java:231) at org.neo4j.kernel.impl.transaction.TxManager.init(TxManager.java:159) at org.neo4j.kernel.impl.transaction.TxModule.start(TxModule.java:79) at org.neo4j.kernel.GraphDbInstance.start(GraphDbInstance.java:153) at org.neo4j.kernel.GraphDbInstance.start(GraphDbInstance.java:65) at org.neo4j.kernel.EmbeddedGraphDbImpl.init(EmbeddedGraphDbImpl.java:69) at org.neo4j.kernel.EmbeddedGraphDatabase.init(EmbeddedGraphDatabase.java:56) at com.alee.voldtest.Neo4jTestApp.init(Neo4jTestApp.java:50) at com.alee.voldtest.Neo4jTestApp.main(Neo4jTestApp.java:420) ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Node with the millions of incoming relationships to - is this a proper way ?
Hello, Dmitri. We are using the first approach - a top level class node with entity nodes below them in the graph. In some cases, this is a flat collection of entities, in others, it is a more complex set of linkages accomplished via relationships. Our taxonomy model (something similar to folders) can contain any class(es) of entities, via relationships. Additionally, an entity can be multiply linked to multiple taxonomy locations (and of course to other entities). We are also using a hybrid approach to reduce the # of nodes that must be traversed in certain types of searches. Basically, we are using a sort of bucket approach. In this scenario, the class node links to a set of buckets. These buckets represent some logical clustering of related nodes that correspond to some commonly used key data that would be used to query/reduce the set of nodes in the resultset. For example, if the most common way to retrieve these nodes would be based on a date/time key, we might create a set of bucket nodes for each day, each day/hour, etc...allowing rapid reduction to a smaller subset of relevant nodes for a date oriented search. Similarly, you could do the same for some key field in the nodes (bucket all nodes by the first letter of the node identity field), or use a tagging metamodel where the buckets corresponded to tag values. I suppose this could also be done directly or indirectly using Lucene as well. Hope this helps. Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Dmitri Livotov Sent: Monday, February 08, 2010 8:26 AM To: Neo user discussions Subject: [Neo] Node with the millions of incoming relationships to - is this a proper way ? A kind of architectural question now We're thinking on our graph model now, where we will have a lot of nodes of particular type. Something like the filesystem, where each fs element (node in neo4j terms) could be of type file or folder. We need to be able to separate and later query (filter) nodes by type. In some cases, we'll also need to iterate over all nodes of some type and so on. For now, I do see two ways for defining the node types in the database: - first is to define so called class nodes, say File class node and Folder class node and then every node in the database will have the extra relation either to File class node or Folder class node. This way I can easily find all nodes of particular type and so on. - second way - to define a property in every node, say nodetype, with the appropriate value for every node. First way seems to be more correct for me, but Im concerning that there will be a millions of relations to a single node - is this OK for the database performance and deficiency (millions to one relationship looks like an unbalanced graph) ? Thanks, Dmitri ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo] Heresy
Yes, yes, I know Microsoft is pure evil and all (though not as evil as Apple or Google these days), but has anyone considered the feasibility of a C#/.NET port of Neo? Just a curiosity more than anything else. ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Heresy
Hi, Peter. Having ported big applications and libraries to and from .NET and Java, in general, a rewrite is the best approach. The code looks surprisingly similar, but exploiting platform and framework-specific capabilities for file I/O, threading, memory management, transactioning, and so on are essential. The so-called interpreters/translators, at the bytecode or source level, generally don't work well except in a few edge cases. Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Peter Neubauer Sent: Friday, February 05, 2010 11:35 AM To: Neo user discussions Subject: Re: [Neo] Heresy Hi there, I know of some minor attempts to do that, and some major that might be underway, but never heard back from the persons involved. Not sure on the status of such thinking. We would love to do such a bridge, but it seems it is still after all these years not trivial to either run the Java code directly in .NET with something like IKVM, or to properly bridge things. Very strange since the platforms are very close to each other in thinking. Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org- Your high performance graph database. http://gremlin.tinkerpop.com- The terminal to the Giant Global Graph. On Fri, Feb 5, 2010 at 5:23 PM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Yes, yes, I know Microsoft is pure evil and all (though not as evil as Apple or Google these days), but has anyone considered the feasibility of a C#/.NET port of Neo? Just a curiosity more than anything else. ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Neo In The Wild - Vizatweet
Hi, Matt. I share your pain. We ended up back on Flex/Flash because we can provide a much more exciting and interactive user experience than we could with HTML 5 (at present). Just as important was that we didn't need to screw around with browser incompatibility issues which, by some of Google's estimates, consume 30-50% of the effort of developing web-based UIs. Would I love to see all of the capabilities of Flex/Flash (and Silverlight) as native browser capabilities? Sure, of course. But even if HTML 5 hits its stride, we're still a couple years away from broad based usage...even more so if you're developing apps for use behind the corporate firewall. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Matt Johnston Sent: Wednesday, February 03, 2010 9:42 AM To: Neo user discussions Subject: Re: [Neo] Neo In The Wild - Vizatweet Thanks for all the comments so far and please feel free to share/tweet/link/slashdot/digg/whatever you want with the link. I do welcome feedback. Part of the reason I posted this in a pretty early release state is because I want to see how people will use something like this and what features would be most useful. I tried to stick with thejit because it was javascript, but that seems to make a non-ideal experience on IE. If I keep running into roadblocks with IE, I may have to switch to flash and use flare. Matt On Tue, Feb 2, 2010 at 2:30 PM, Mattias Persson matt...@neotechnology.comwrote: Looks really cool! If you're in a state where you're ready for feedback: I noticed that sometimes the texts gets a little displaced from the graph thought. 2010/2/2 Peter Neubauer peter.neuba...@neotechnology.com: Wohow, cool! The service is down but I got some searches going. Let us know when it is up again, together with your twitter name, so I can slashdot it ;) Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org- Your high performance graph database. http://gremlin.tinkerpop.com- The terminal to the Giant Global Graph. On Tue, Feb 2, 2010 at 8:10 PM, Matt Johnston m...@lattaoutdoors.com wrote: I just posted a simple app I've been working on. The app lets you search twitter and then displays the relationships between the tweets, popular users and popular words. Everything is stored in Neo and I used thejit javascript library for the display. Check it out. http://www.vizatweet.com/ Matt ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo] Neo Error - Block not inuse
Has anyone seen an error like this? Block not inuse[0] blockId[10931] Seems to be occurring attempting to commit an update to a node's properties. I ended up deleting and recreating the entire graph and it went away.but still curious to know what the cause might have been. Thanks, Rick ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Neo In The Wild - Vizatweet
Doesn't work for IE8. :( -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Matt Johnston Sent: Tuesday, February 02, 2010 2:11 PM To: Neo user discussions Subject: [Neo] Neo In The Wild - Vizatweet I just posted a simple app I've been working on. The app lets you search twitter and then displays the relationships between the tweets, popular users and popular words. Everything is stored in Neo and I used thejit javascript library for the display. Check it out. http://www.vizatweet.com/ Matt ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Checking whether a relationship exists between two nodes...
Hi, Maria. You should be using the hasRelationship(...) method of the Node object. http://api.neo4j.org/current/org/neo4j/graphdb/Node.html Best regards, Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Maria Giatsoglou Sent: Tuesday, February 02, 2010 5:45 PM To: user@lists.neo4j.org Subject: [Neo] Checking whether a relationship exists between two nodes... Hello all I am creating a project that performs a number of benchmark tasks on Neo. One of the tests measures the required time for creating a relationship between two neo nodes A and B. However, before creating the relationship, it should firs be checked whether a relationship of the same type already exists between these two nodes. My current implementation calls the getRelationships() function for the A node and then iterates over the returned Iterable object checking whether a relationship's end node is equal to node B. If such a relationship does not exist, then the required relationship is created between nodes A and B. However, this technique seems to be very slow, with the creation of a relationship (including the check operation) taking around 57msec to complete. Is there a faster way to implement this operation? I considered trying to modify the LuceneIndexService implementation in order to enable indexing relationships apart from nodes. Do you recommend such an approach for this problem? Many thanks in advance, Best regards, Maria Giatsoglou ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Relation properties
Why do you need to set your own ID's? You can use the relationship's built-in as your index key (it is guaranteed to be unique) and getRelationshipByID to retrieve the relationship. You'd need to very slightly extend the LuceneIndex stuff to deal with relationships, but it shouldn't be difficult. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Anton Popov Sent: Friday, January 29, 2010 9:31 AM To: Neo user discussions Subject: Re: [Neo] Relation properties And as far as I can see there is no way to set my own id'es for Relations? Only Nodes has such functionality - am I right? -- Forwarded message -- From: Anton Popov popov.ua.w...@gmail.com Date: 2010/1/29 Subject: Re: [Neo] Relation properties To: Neo user discussions user@lists.neo4j.org Hello Mattias, Got it. Thanks. Is there any RoadMap available? 2010/1/29 Mattias Persson matt...@neotechnology.com Unfortunately you cannot index Relationships, but it's a (frquently requested) feature we're planning to add. 2010/1/29 Anton Popov popov.ua.w...@gmail.com: Hello everybody, A related question is can I index both Nodes Relations? As I can see LuceneIndexBatchInserter.index( long node, String key, Object value ) applies for Nodes only. 2010/1/28 Mattias Persson matt...@neotechnology.com Not at all, you're not the first one to overlook that inheritance! 2010/1/28, Anton Popov popov.ua.w...@gmail.com: Thanks for a quick answer, Mattias. Sorry for a stupid questions, just haven't noticed the inheritance of Relationship interface. On 28 January 2010 19:43, Mattias Persson matt...@neotechnology.com wrote: Relationship has all the property methods, just like Node... they're actually on PropertyContainer (a common super interface to Node and Relationship) see http://api.neo4j.org/current/org/neo4j/graphdb/Relationship.html and http://api.neo4j.org/current/org/neo4j/graphdb/PropertyContainer.html for more information. So to manage the cost in a dijkstra algorithm you can use whatever property key, f.ex. weight, like this: Relationship rel = ... // any relationship rel.setProperty( weight, 4 ); And if you're using the Dijkstra algorithms in the neo4j-graph-algo component, http://components.neo4j.org/neo4j-graph-algo/ , you can instantiate it with a CostEvaluator instance something like this: new CostEvaluatorInteger() { CostType getCost( Relationship relationship, boolean backwards ) { / TODO Handle backwards flag? return ( Integer ) relationship.getProperty( weight, 1 ); } } ...and pass it to your Dijkstra algo instance. Is this what you were looking for? 2010/1/28 Anton Popov popov.ua.w...@gmail.com: Hello everyone, Is there any possibility to assign properties to Relations? The matter is I want to try Dijkstra algorithm performance on some weighted directed graph and don't know where to put weight actually... -- Best regards, Popov Anton ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Best regards, Popov Anton ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Best regards, Popov Anton ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Best regards, Popov Anton -- Best regards, Popov Anton ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Range Query using Lucene Index Service?
Take a look at the timeline functionality in the index package in the wiki. It uses neo, not lucene, to store the index. --Original Message-- From: Nathan Marz Sender: user-boun...@lists.neo4j.org To: user@lists.neo4j.org ReplyTo: Neo user discussions Subject: [Neo] Range Query using Lucene Index Service? Sent: Jan 28, 2010 3:43 PM I have nodes that have a timestamp property and I want to do range queries on timestamp, such as to get all nodes older than X days. Looking at LuceneIndexService, the methods seem to only provide for key-value lookups. Is there any way to do range queries or some alternative way to do this? Thanks, Nathan Marz ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Lucene full text indexing service: searching multiple node keys
I took a quick look at Compass, and it looked really interesting and promising, until I dl'd the distribution with dependencies - seems like every single open source Java project is included as a dependency/JAR library... :( -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Jonny Wray Sent: Tuesday, January 26, 2010 1:54 PM To: Neo user discussions Subject: Re: [Neo] Lucene full text indexing service: searching multiple node keys Yeah, it worked pretty well. I'd used compass in a more normal situation (RDMBS and Hibernate) and my experience with it took me that direction. It's a very nice project. I'll dig the code out and look, but I have a feeling I could be embarrassed by it - it was very much a prototype. Jonny On Mon, Jan 25, 2010 at 9:47 PM, Peter Neubauer peter.neuba...@neotechnology.com wrote: Hi Jonny, sounds like compass could be a good component integration to add. Do you have some example code that we maybe could put on the wiki or package as a component? Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org- Your high performance graph database. http://gremlin.tinkerpop.com- PageRank in 2 lines of code. On Tue, Jan 26, 2010 at 2:26 AM, Jonny Wray jwray.deve...@gmail.com wrote: Subhash, while this ability isn't built into the current IndexService, the indexing in Neo is very extendable/pluggable, and I implemented the functionality you mentioned in some pilot code I wrote a few months ago. I used the compass project (http://www.compass-project.org/) to implement my own extension of the standard IndexService which provides some useful tools on top of raw Lucene, including transaction support in a Spring environment. I don't have the code in front of me currently but I just wanted to mention that implementing and using such an approach wasn't too hard at all. best, Jonny On Mon, Jan 25, 2010 at 12:03 AM, Subhash Chandran sub...@gmail.com wrote: Thanks for letting me know. Subhash. On Mon, Jan 25, 2010 at 12:07 PM, Mattias Persson matt...@neotechnology.com wrote: This is currently not possible... the IndexService is meant to be a simple lookup index, not a complex query index for such queries. With that said it could be possible to add it in the future. 2010/1/25 Subhash Chandran sub...@gmail.com: Disclaimer: I am new to both Neo4J and Lucene. My question is regarding: http://bit.ly/4sTBnx In the code above I am using property p:body p:title for full-text-indexing. When querying the index: idx.getNodes(p:body, searchTerm) I want to query both p:body and p:title at once. Is this possible? -- Regards, Subhash Chandran S http://indiwiz.com/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Regards, Subhash Chandran S http://indiwiz.com/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Traverser customization
Having just done a blog/wiki/forum prototype using Neo as the backend, I found that it was easier to use a series of traversals driven by domain-specific code than to write/model a single traverser. I also ended up placing the collection of node(s) in an intermediate/wrapper class that also tags the nodes with metadata (retrieved from their properties or properties of nodes they are related to) so that I can sort/filter the collection using the Comparer/Comparator interface(s). The decision to do it the way we did could be borne more of ignorance of how to best write and utilize traversers, though. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Robert Hritz Sent: Monday, January 25, 2010 1:29 PM To: user@lists.neo4j.org Subject: [Neo] Traverser customization Hi, I am currently playing around with neo4j for one of my pet projects and it certainly looks like a interesting technology. I have a few questions regarding traversers though. Let's say I'm building a threaded discussion forum. Any node can be root of a tree of 'reaction' relations with other nodes. Now usually, I would want to display the reactions tree depth-first, with descending creation time (newest reactions first), and of course paged. For the depth-first part, we have the DepthFirstTraverser, which is fine. Descending creation time (of the node or relation, doesn't really matter) can be approximated by the 'natural ordering' mentioned in AbstractTraverser.addEndNodesToList(), we only have to reverse the order in which nodes are added to the positions list - I didn't try this yet but shouldn't be a big issue. Of course I could get all the relevant nodes and do the sorting later in the application instead of having to modify the AbstractTraverser but this looks to be far more effective. Now to paging: using StopEvaluator and ReturnableEvaluator, I can get the first N nodes, next N nodes etc.. But if the root node has 100k direct descendants in this relationship and I only want first X of them by the aforementioned ordering, the ReturnableEvaluator will still be called for all 100k traversal positions, which is not effective at all, because I already know that I do not want the last 100k-X, where X is not more than 100. I do understand that StopEvaluator and ReturnableEvaluator are fine for many cases like results filtering, but in the case I would need something like a HardStopEvaluator, which will stop the traverser from adding new positions and/or calling the evaluators after a node. Of course, I can modify the current traverser to fit my needs, but maybe I am missing something or there is a better, faster, more effective way to accomplish this task. Thank you very much for any input. Cheers, Robert Hritz ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Graph Visualization
Neoclipse is a good place to start. I've just started looking at Flare and birdeye to see if they're a fit for browser clients. --Original Message-- From: Amir Hossein Jadidinejad Sender: user-boun...@lists.neo4j.org To: neo4j ReplyTo: Neo user discussions Subject: [Neo] Graph Visualization Sent: Jan 23, 2010 7:39 AM Hi, What's the best way to visualize some part of a graph in Neo4j Graph DB? Albeit I can create an online instance and pass it to third-party visualizer, but: 1. Is it an straight forward (embedded) visualizer available? 2. If NO, which third-party graph visualizer do you prefer? Thanks and kind regards, Amir ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Mutliple embedded databases?
Thanks, Tobias. Is the same true for the index services? I assume so, but wanted to double check. Is it also correct to assume that you should only have one index service per graph database instance? Best, Rick Original Message Subject: Re: [Neo] Mutliple embedded databases? From: Johan Svensson jo...@neotechnology.com Date: Thu, January 21, 2010 8:16 am To: Neo user discussions user@lists.neo4j.org No, should work fine. -Johan On Thu, Jan 21, 2010 at 3:09 PM, rick.bullo...@burningskysoftware.com wrote: Are there any restrictions on having a Java app host more than one GraphDatabaseService? Any issues with transactioning? Thanks, Rick ___ Neo mailing list User@lists.neo4j.org [1]https://lists.neo4j.org/mailman/listinfo/user References 1. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo] Mutliple embedded databases?
Are there any restrictions on having a Java app host more than one GraphDatabaseService? Any issues with transactioning? Thanks, Rick ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Import/export
There is really no natural way to express complex graphs (something more than hierarchal) in something like XML or JSON, but it can be done as long as each entity has a unique identification of some kind (e.g. GraphML's IDs). Barring any reason not to, it would seem that GraphML would be the most logical place to start. It seems to recognize many of the potential complications(e.g. the parse hints) and is extensible. One primary disconnect point is the dependency on ids. Neo nodes and relationships have an implicit ID (the long value representing the node or relationship), but may or may not have an explicit ID. Thus, as mentioned previously, the identity may not be the same on import as it was an export, unless an explicit ID is provided for each node/relationship. Our current graph model is a mix of both. Some nodes have ID's (typically a name), others do not. Also, GraphML would need to be extended to support the concept of relationship types, but this seems to be fairly straightforward using custom attributes, elements and/or xlink. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Craig Taverner Sent: Tuesday, January 19, 2010 4:07 AM To: Neo user discussions Subject: Re: [Neo] Import/export I was wondering if the neo-shell or the neo4j.rb in IRB would solve this requirement (easily creating or loading some initial graph). I have not played much with the shell, but know that it has commands for making nodes and relationships. But I think it is best for interactive work, and I think it is not ideal for scripting. On the other hand the Ruby API provides a command-line/scripting DSL for generating a graph and since it is also very easy to read data from a file, it is easy to read the file and create the graph in a language not entirely unlike your original 'javascript-like' example. While on that note, I said javascript-like, but if we focus on the 'state transfer' example you gave, we're talking about JSON, and I think I might get a few votes for suggesting that as a nicer alternative to XML for a generic data structure. So, if you use JSON, the Java API and a JSON library would suffice to build the graph. If you are willing to deviate a little from the syntax, you could have the format in Ruby and directly executable in neo4j.rb (which I think is even cooler :-) I also personally think both XML and JSON represent implicit tree structures, and so any XML or JSON dataset can be loaded as a tree graph with generic code (and no need for hashes of node ids or any caches). However, things get slightly tricky when we need to translate XML/JSON closed graph contructs into the graph, but even that seems achievable (with hashes/caches ;-) On Tue, Jan 19, 2010 at 8:55 AM, David Montag da...@montag.se wrote: Hi, Having read the replies and thought about it more, I think my initial e-mail had a slightly wrong focus. The technical details that have surfaced so far are interesting, and would definitely be relevant, should an implementation be attempted. However. What I personally would like to know is, do you think there's a need for initial data sets in the first place? Because that is the problem that I initially set out to solve. Then I kind of got ahead of myself and started thinking about the hows, and not the whats and whys. Simply zipping up a couple of pre-populated stores with different graphs would actually solve the problem. Maybe not in the most elegant and/or maintainable way, but still. Export/import is a much broader feature. Opinions? Don't get me wrong, I'm not trying to kill the tech discussion. I'm just trying to solve the actual problem that I ran into. And if you think export/import would be useful too, great! I'd be happy to continue that discussion as well. Also, let me make it clear that this (i.e. initial data sets) isn't something I'm doing as a project for myself. I would expect it to be a community effort, benefiting everyone. So I actually *want* to know if you like the ideas or not, in addition to solutions. With the awesomeness that is the Neo4j community, it shouldn't be a problem. :) -David On Tue, Jan 19, 2010 at 2:32 AM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Actually, I think there's one other key gotcha to be aware of. Rewiring relationships when importing should not assume anything about the nodeID's. While the nodeID's are a useful unique identifier in the export process, on import, you'd want to create a HashMap or similar structure that you populate with the old and new node ID's as you create them in the first pass through (nodes/properties), then use the old nodeIDs referenced in the exported relationships as your lookup to get the new nodeIDs. Could be kinda memory intensive for really large graphs (since you'd have to keep a HashMap entry of Long/Long for each node), but probably manageable. In the worst
Re: [Neo] Quick question on finding orphaned nodes
Thanks for the info, Johan. Although the relationships are lazily loaded, does the hasRelationship() method typically require a disk read? -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Johan Svensson Sent: Sunday, January 17, 2010 9:35 AM To: Neo user discussions Subject: Re: [Neo] Quick question on finding orphaned nodes Hi Rick, On Sun, Jan 17, 2010 at 2:01 AM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: Here's a broader question: Does Neo maintain an in-memory list of relationships for a given node? If so, could the # of relationships be exposed somehow as a property of the node? There is an in-memory list of relationships for each node but it does not always contain the number of relationships that actually exist (relationships are loaded lazily when needed). Regards, -Johan ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Quick question on finding orphaned nodes
Since there are some cases where what might be considered orphan nodes are perfectly normal use cases (a node with no relationships), I think the only way is to iterate through all nodes and check to see if relationships exist. Here's a broader question: Does Neo maintain an in-memory list of relationships for a given node? If so, could the # of relationships be exposed somehow as a property of the node? If so, you could conceivably use a Lucene index on the # of relationships and quickly find all nodes with no relationships. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Zerony Zhao Sent: Saturday, January 16, 2010 12:49 PM To: Neo user discussions Subject: [Neo] Quick question on finding orphaned nodes Hi Neo4j users, Is there a shortcut to find the orphaned nodes on in graph? Currently the program uses a loop to check each nodes in the graph to find it is orphaned or not. Thanks. Zerony ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Quick question on finding orphaned nodes
After further review... (an American football saying we're becoming all too familiar with)...there is a hasRelationship() method on Node that returns a boolean indicating if the Node has any relationships or not...thus an orphan node would return false. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tim Langley Sent: Saturday, January 16, 2010 8:04 PM To: Neo user discussions Subject: Re: [Neo] Quick question on finding orphaned nodes That would be VERY VERY useful :) if there was a trivial way to implement this one of the key use-cases for me is to count the number of relationships T On 17 Jan 2010, at 01:01, Rick Bullotta wrote: Since there are some cases where what might be considered orphan nodes are perfectly normal use cases (a node with no relationships), I think the only way is to iterate through all nodes and check to see if relationships exist. Here's a broader question: Does Neo maintain an in-memory list of relationships for a given node? If so, could the # of relationships be exposed somehow as a property of the node? If so, you could conceivably use a Lucene index on the # of relationships and quickly find all nodes with no relationships. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user- boun...@lists.neo4j.org] On Behalf Of Zerony Zhao Sent: Saturday, January 16, 2010 12:49 PM To: Neo user discussions Subject: [Neo] Quick question on finding orphaned nodes Hi Neo4j users, Is there a shortcut to find the orphaned nodes on in graph? Currently the program uses a loop to check each nodes in the graph to find it is orphaned or not. Thanks. Zerony ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user Tel:+44 7989 539363 Email: t...@timlangley.me.uk Web:http://www.linkedin.com/in/langleytim ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Glassfish v3 and others application servers
We will probably cruft together some type of neo viewer/editor in flex (java back end) in the next few months. It will rely on traversing from the root node, most likely. --Original Message-- From: Laurent Laborde Sender: user-boun...@lists.neo4j.org To: Neo user discussions ReplyTo: Neo user discussions Subject: Re: [Neo] Glassfish v3 and others application servers Sent: Jan 11, 2010 4:18 AM Mmmm, there is, in fact, a neo4j grails plugin :) http://www.grails.org/plugin/neo4j -- Laurent ker2x Laborde Sysadmin DBA at http://www.over-blog.com/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Neo is very slow (I think I'm being stupid)
and tweak the memory allocation settings for the jvm and neo... -Original Message- From: Peter Neubauer peter.neuba...@neotechnology.com Date: Mon, 11 Jan 2010 23:19:07 To: Neo user discussionsuser@lists.neo4j.org Subject: Re: [Neo] Neo is very slow (I think I'm being stupid) Tim, I think the structure is quite normal, would be good to see the code, you could send it to me off-list. That way I get an impression on both the querying code, the dataset size and maybe test-run it. Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org- Relationships count. http://gremlin.tinkerpop.com- PageRank in 2 lines of code. http://www.linkedprocess.org - Computing at LinkedData scale. On Mon, Jan 11, 2010 at 10:28 PM, Tim Langley timlang...@me.com wrote: hi Peter Thanks for the rapid response (one of the reasons I really like the Neo crowd) ok - structure Node: Event (for the start of a session) So the first time a user loads a page then creating a new NodeEvent Node: EventItem Every time the user generates a new page view then a new NodeEventItem is created ok - query code: I'm trying to ask questions like How many EventItems are under each Event? or How many Events were there between Time X and Time Y? I've tried using the Traverser and also iterating through each relationship individually? (Does this help - or would you like to see the actual code) T On 11 Jan 2010, at 21:23, Peter Neubauer wrote: Tim, yes, since your loading evidently is working normally, a look at your graph layout and query code would be great to have any opinion on what might be wrong/not optimal. Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Relationships count. http://gremlin.tinkerpop.com - PageRank in 2 lines of code. http://www.linkedprocess.org - Computing at LinkedData scale. On Mon, Jan 11, 2010 at 10:18 PM, Tim Langley timlang...@me.com wrote: hey :) ok - I'm trying to build a web-analytics program using Neo4j in a very similar manner to http://wiki.neo4j.org/content/Site_Usage_Analytics I'm using Scala (and whilst eventually there will be a REST API - at the moment everything is within Scala) The loading of data is blisteringly fast (really impressed) However - the querying is horribly slow For example: If I want to get the total number of relationships (or Nodes) attached to a Node it's painfully slow Am I doing something stupid? I can post more code / details etc.. if required Thanks in advance T ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user Tel: +44 7989 539363 Email: ...@timlangley.me.uk Web: http://www.linkedin.com/in/langleytim Skype: LangleyTim Twitter: �...@timlangley ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Neo is very slow (I think I'm being stupid)
Hi, Tim. Here's a section on the various memory tuning options for Neo. http://wiki.neo4j.org/content/Neo_Performance_Guide In terms of setting Java VM parameters, I know how to do it for a Java app or application server, but not for Scala. ;-) Anyone? Rick -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Tim Langley Sent: Monday, January 11, 2010 6:23 PM To: Neo user discussions Subject: Re: [Neo] Neo is very slow (I think I'm being stupid) hey Rick Thanks for this (I'm n00b tho - how do I do this pls?) T On 11 Jan 2010, at 23:21, Rick Bullotta wrote: and tweak the memory allocation settings for the jvm and neo... -Original Message- From: Peter Neubauer peter.neuba...@neotechnology.com Date: Mon, 11 Jan 2010 23:19:07 To: Neo user discussionsuser@lists.neo4j.org Subject: Re: [Neo] Neo is very slow (I think I'm being stupid) Tim, I think the structure is quite normal, would be good to see the code, you could send it to me off-list. That way I get an impression on both the querying code, the dataset size and maybe test-run it. Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org- Relationships count. http://gremlin.tinkerpop.com- PageRank in 2 lines of code. http://www.linkedprocess.org - Computing at LinkedData scale. On Mon, Jan 11, 2010 at 10:28 PM, Tim Langley timlang...@me.com wrote: hi Peter Thanks for the rapid response (one of the reasons I really like the Neo crowd) ok - structure Node: Event (for the start of a session) So the first time a user loads a page then creating a new NodeEvent Node: EventItem Every time the user generates a new page view then a new NodeEventItem is created ok - query code: I'm trying to ask questions like How many EventItems are under each Event? or How many Events were there between Time X and Time Y? I've tried using the Traverser and also iterating through each relationship individually? (Does this help - or would you like to see the actual code) T On 11 Jan 2010, at 21:23, Peter Neubauer wrote: Tim, yes, since your loading evidently is working normally, a look at your graph layout and query code would be great to have any opinion on what might be wrong/not optimal. Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org- Relationships count. http://gremlin.tinkerpop.com- PageRank in 2 lines of code. http://www.linkedprocess.org - Computing at LinkedData scale. On Mon, Jan 11, 2010 at 10:18 PM, Tim Langley timlang...@me.com wrote: hey :) ok - I'm trying to build a web-analytics program using Neo4j in a very similar manner to http://wiki.neo4j.org/content/Site_Usage_Analytics I'm using Scala (and whilst eventually there will be a REST API - at the moment everything is within Scala) The loading of data is blisteringly fast (really impressed) However - the querying is horribly slow For example: If I want to get the total number of relationships (or Nodes) attached to a Node it's painfully slow Am I doing something stupid? I can post more code / details etc.. if required Thanks in advance T ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user Tel:+44 7989 539363 Email: t...@timlangley.me.uk Web:http://www.linkedin.com/in/langleytim Skype: LangleyTim Twitter:@TimLangley ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user Tel:+44 7989 539363 Email: t...@timlangley.me.uk Web:http://www.linkedin.com/in/langleytim Skype: LangleyTim Twitter:@TimLangley ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Solr integration for Neo4j in the making
Can anyone compare and contrast lucene and solr for those of us who aren't as familiar with solr? --Original Message-- From: Peter Neubauer Sender: user-boun...@lists.neo4j.org To: Neo user discussions ReplyTo: Neo user discussions Subject: [Neo] Solr integration for Neo4j in the making Sent: Jan 9, 2010 6:28 AM Hi all, Patrick O'Leary just contributed a basic integration component for Solr and Neo4j. Thanks a lot Patrick for doing the effort and welcome to the Neo4j community! This comonent lets Solr update a (right now social) graph in Neo4j when documents with certain neo-IDs are inserted through the Solr HTTP import facility. This is a bit different from the tight Lucene integration where indexing is done through the Neo4j APIs. The component right now lives in https://svn.neo4j.org/laboratory/components/solr and will undergo some initial tweaking, mavenizazion, testing and package renaming before it settles down. Anyway, feel free to check it out and comment/feedback/contribute! Happy Hacking, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org- Relationships count. http://gremlin.tinkerpop.com- PageRank in 2 lines of code. http://www.linkedprocess.org - Computing at LinkedData scale. ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Persisting store metadata
Exactly. You would/could create a chicken and egg problem if the service dependencies needed to be known prior to a recovery or startup options, and since you can't start the db, you couldn't read the metadata. The separate file approach (or even a mini db that used Neo constructs but did not have any other dependencies) would work fine. Original Message Subject: Re: [Neo] Persisting store metadata From: Peter Neubauer peter.neuba...@neotechnology.com Date: Tue, January 05, 2010 5:48 am To: Neo user discussions user@lists.neo4j.org Hi there, my only concern with storing metadata in the db itself is the issue of having no way to discover the version of Neo4j needed to open the db, and the inability to get that metainf out with anything but Neo4j itself. I am thinking of things like maven processing to programmatically add info there etc etc, if that may be of interest later. It depends of course on how big this should be and where in the SW stack the meta info comes in. Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn [1]http://www.linkedin.com/in/neubauer Twitter [2]http://twitter.com/peterneubauer [3]http://www.neo4j.org - Relationships count. [4]http://gremlin.tinkerpop.com - PageRank in 2 lines of code. [5]http://www.linkedprocess.org - Computing at LinkedData scale. On Tue, Jan 5, 2010 at 1:07 PM, Mattias Persson matt...@neotechnology.com wrote: 2010/1/5 Tobias Ivarsson tobias.ivars...@neotechnology.com: That's an interesting idea. However something in my gut tells me that it's not good/better: * It's still open for people to mock about with, however now it's in the node space using up a relationship type that is now unusable by the application (at least as a relationship from the reference node). * This is intended (at least by how I envision it) to be read by the kernel to know which components to load in order to have a consistent store, it seems to me like having the data in the node space would require too much bootstrapping before it can be accessed. Remember that this information is meant to be part of the bootstrapping process. Yep I agree that it'd probably require too much bootstrapping to reach that information. It does have the advantage that the consistency of the information would be guaranteed. The upside is, as you say, that you get all these nice things such as consistency for free... as well as that it automatically tags along in online backup and all such things, which is quite nice. /Tobias On Tue, Jan 5, 2010 at 9:34 AM, Mattias Persson matt...@neotechnology.comwrote: Great initiative. Instead of storing such information in a plain-text file it could be stored in the neo4j store itself (as a sub-reference node or something). I don't know if that'd be good/better though. 2010/1/4 Tobias Ivarsson tobias.ivars...@neotechnology.com: Hi, Neo4j today is made up of a core service that persists nodes, relationships and properties. In addition to that there are a number of additional services, where index-util is probably the most used and most important at the moment. index-util is also a good example of the problem I would like to discuss in this email. With the current architecture there is no way of introspecting which additional services have been initialized with a particular Neo store, for example there is no way of telling which (if any) IndexService has been used. This causes problems with the transaction recovery process, where the recovery mechanism today has to know about all possible extension services without having a compile time dependency on them. Needless to say this causes a mess. The code for this is ugly and borderline-buggy. It also causes a problem when introspecting a store, or even restarting your software, since it is up to the programmer to remember to restart all of the same services as last time. I would like to propose an addition to the store, in a separate metadata file in the store directory, where we store a simple list of all started additional services. Does anyone have any suggestions to what this should look like to be reasonable future proof (i.e. be able to handle some service that is not implemented yet as well as the current index-utils). What comes to mind is something similar to the Java ServiceLoader API [1], but simplified with the fact that we can require all classes referenced in the file to implement one specific interface, and we know where the
Re: [Neo] getProperty and null...
The other very useful aspect of the default value method is that is allow resilience of applications that may have had data or objects persisted into Neo but that have since had additional properties added to their domain model. The default value approach helps mitigate the need for a traditional migration process. Original Message Subject: Re: [Neo] getProperty and null... From: Mattias Persson matt...@neotechnology.com Date: Tue, January 05, 2010 4:59 am To: Neo user discussions user@lists.neo4j.org Well, I think it's generally a good thing to be able to distinguish mandatory stuff from optional stuff... and that's the use case of those two methods. If you're getting a property which must be there in your domain you shouldn't have to check for null in all those cases, it feels so C-like to me... it should just return my value or else fail miserably so that I can see right then and there that there's a bug in my code (in this case the code which created my domain object or similar). And the one with the default value is great since I find myself passing in other things as well, not just null. I just couldn't live without any of them really. Just my point of view on this... 2010/1/5 Mattias Ask mattias@jayway.com: Hi everyone, I have an issue which I would like your opinion on... It's mostly a question of code aesthetics, to be honest, but still... When I look in my code I see myNode.getProperty(SOME_PROP, null); everyehere... The reason for this is that I if I called myNode.getProperty(SOME_PROP) I'd have to check for org.neo4j.api.core. NotFoundException everywhere that I read properties that are not mandatory. What if myNode.getProperty(SOME_PROP) was to return null instead? The doc says explicitly that you can't persist null. If myNode.getProperty(SOME_PROP) where to return null this would mean, without any doubt, that the property does not exist, right? The upside to this would be that I wouldn't have to use the DefaultReturnValue null everywhere. And the argument that I'd have to null-check everywhere is kind of moot since I already return null as DefaultReturnValue. In my case my domain objects extend a NodeDelegate, which takes an underlaying node in the constructor. This means that I can use getProperty(SOME_PROP, null) everytime I call getProperty(SOME_PROP)... but the question is if there are any downsides to doing that? What are your thoughts on this? Best, Mattias Ask ___ Neo mailing list User@lists.neo4j.org [1]https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, [2]www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org [3]https://lists.neo4j.org/mailman/listinfo/user References 1. https://lists.neo4j.org/mailman/listinfo/user 2. http://www.neotechnology.com/ 3. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] getProperty and null...
Traditional migrations tend to be a one time event, rather than an ongoing process. The risk of a lazy approach is that the db could be logically inconsistent at certain points. I guess the short answer is the ubiquitous it depends -Original Message- From: Peter Neubauer peter.neuba...@neotechnology.com Date: Tue, 5 Jan 2010 14:13:36 To: Neo user discussionsuser@lists.neo4j.org Subject: Re: [Neo] getProperty and null... Hi there, yes, default values are nice, but I think in the case of resilience, this should be handled in a more generic approach outside of the core engine, dealing with the whole space of default values and lazy migrators of nodes and relationships (migrators being plugins to handle more complex scenarios than returning a default value, e.g. adding or removing props/relationships), maybe attached to the neo-meta component that can assign node schema migrators between versions of the meta model. WDYT? Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org- Relationships count. http://gremlin.tinkerpop.com- PageRank in 2 lines of code. http://www.linkedprocess.org - Computing at LinkedData scale. On Tue, Jan 5, 2010 at 2:09 PM, rick.bullo...@burningskysoftware.com wrote: The other very useful aspect of the default value method is that is allow resilience of applications that may have had data or objects persisted into Neo but that have since had additional properties added to their domain model. The default value approach helps mitigate the need for a traditional migration process. Original Message Subject: Re: [Neo] getProperty and null... From: Mattias Persson matt...@neotechnology.com Date: Tue, January 05, 2010 4:59 am To: Neo user discussions user@lists.neo4j.org Well, I think it's generally a good thing to be able to distinguish mandatory stuff from optional stuff... and that's the use case of those two methods. If you're getting a property which must be there in your domain you shouldn't have to check for null in all those cases, it feels so C-like to me... it should just return my value or else fail miserably so that I can see right then and there that there's a bug in my code (in this case the code which created my domain object or similar). And the one with the default value is great since I find myself passing in other things as well, not just null. I just couldn't live without any of them really. Just my point of view on this... 2010/1/5 Mattias Ask mattias@jayway.com: Hi everyone, I have an issue which I would like your opinion on... It's mostly a question of code aesthetics, to be honest, but still... When I look in my code I see myNode.getProperty(SOME_PROP, null); everyehere... The reason for this is that I if I called myNode.getProperty(SOME_PROP) I'd have to check for org.neo4j.api.core. NotFoundException everywhere that I read properties that are not mandatory. What if myNode.getProperty(SOME_PROP) was to return null instead? The doc says explicitly that you can't persist null. If myNode.getProperty(SOME_PROP) where to return null this would mean, without any doubt, that the property does not exist, right? The upside to this would be that I wouldn't have to use the DefaultReturnValue null everywhere. And the argument that I'd have to null-check everywhere is kind of moot since I already return null as DefaultReturnValue. In my case my domain objects extend a NodeDelegate, which takes an underlaying node in the constructor. This means that I can use getProperty(SOME_PROP, null) everytime I call getProperty(SOME_PROP)... but the question is if there are any downsides to doing that? What are your thoughts on this? Best, Mattias Ask ___ Neo mailing list User@lists.neo4j.org [1]https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, [2]www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org [3]https://lists.neo4j.org/mailman/listinfo/user References 1. https://lists.neo4j.org/mailman/listinfo/user 2. http://www.neotechnology.com/ 3. https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list
Re: [Neo] Neo in a cluster?
Raul, do you know of any performance metrics/examples for the Datanucleus access/query layer? We've currently implemented our own SQL-like query layer on top of Neo (and other non-SQL sources), but would be interested in exploring Datanucleus if the performance implications of the extra layers aren't too substantial (our current implementation is very specifically optimized for our use case, and can query/filter/sort/serialize a few thousand records in about 30mS). In particular, I'd be interested to know if there are any examples of an in-memory provider/persistence layer being queried using JDOQL, SQL, or JPQL that could be used to gauge raw performance of the query layer (filtering, sorting, aggregates, etc.). -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Raul Raja Martinez Sent: Friday, January 01, 2010 11:16 PM To: Neo user discussions Subject: Re: [Neo] Neo in a cluster? I forgot to mention that if implementing JPA/JDO it'd provably good to do it as a Datanucleus store for example http://www.datanucleus.org/plugins/store.db4o/index.html 2010/1/1 Raul Raja Martinez raulr...@gmail.com Hi Peter, Yes we looked at jo4neo and found it very interesting and it probably suits most people use cases. In our particular case these are the reasons why we didn't choose it. 1. jo4neo is tightly couple to neo4j, our implementation is based on neo4j but the interface impls are defined so that they can be swapped for other graph based storage in case we decide to not use neo4j in some other project. 2. Our implementation never handles transactions directly, jo4neo does. jo4neo does not allow control over transactions and creates a transaction per operation http://jo4neo.googlecode.com/svn/trunk/jo4neo/src/main/java/jo4neo/DeleteOpe rtation.java For a webapp we provide a filter that wraps the request in a transaction, allowing to groups operations, and we also plan to support Callbacks that allow you to group operations ina transactional context. We also integrate with Spring and we are working on the @Transactional support 3. jo4neo loads all properties for a bean even when these are not queried or used. We enforce the use of interfaces not beans and we create a dynamic proxy that implements the interface so that calls to properties and relationships are proxied and delegated to the underlying nodes without the need to use reflection. So when you load a Object by id nothing we do not load all its properties or relationships unless you use them, and even when you use them they don't get cached in the proxy so it saves memory. We trust that neo4j caches the nodes and properties that are used the most. As far as JPA is concerned... Yes and No. I think you'd gain more acceptance if you implement JPA, on the other hand the JPA spec pretty much assumes the storage is based on a relational database, they say... The Java Persistence API deals with the way relational data is mapped to Java objects (persistent entities), the way that these objects are stored in a relational database so that they can be accessed at a later time, and the continued existence of an entity's state even after the application that uses it ends. In addition to simplifying the entity persistence model, the Java Persistence API standardizes object-relational mapping. So I'd be great to have a partial JPA impl for basic querying and annotations but neo4j approach to persistence is much more flexible and not constrained by the relational model. 2010/1/1 Peter Neubauer peter.neuba...@neotechnology.com Raul, thanks for the info! Have you looked at Taylor's jo4neo, http://code.google.com/p/jo4neo/ which is taking a similar approach, and do you think there would be value in having a JPA adapter for Neo4j? We would be happy to hear about your experience there! Happy New Year! /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org- Relationships count. http://gremlin.tinkerpop.com- PageRank in 2 lines of code. http://www.linkedprocess.org - Computing at LinkedData scale. On Thu, Dec 31, 2009 at 10:53 PM, Raul Raja Martinez raulr...@gmail.com wrote: Hi Johan, It does and we're very excited about Neo4j. Can't wait for your clustering support. We have developed a annotation based sytem on top of Neo based on interfaces and java dynamic proxies that allows you to delegate all state lookup and relationship to the neo store such as @Node public interface Person { @Id Long getId(); @Property(indexed=true,unique=true,fulltext=true) String getName(); void setName(String name); @Relationship City getCity(); @Relationship ListPerson getFriends();
Re: [Neo] Communication channel preferences?
I completely agree with Lorin. Wave can just as easily be abused and misused as any other medium - plus you can create useless and difficult to navigate content in real time! However, if we set some ground rules/usage suggestions, it'll work well. BTW, I guess I haven't tried yet, but are the Neo4J.org Wikis community editable? -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Lorin Halpert Sent: Wednesday, December 30, 2009 8:56 PM To: Neo user discussions Subject: Re: [Neo] Communication channel preferences? IMHO Wave pages get extremely messy, disorganized and laggy very quickly. +1 for IRC on Freenode, there are archival bots available if logging is really necessary. Although a simple shortcut bot is usually all that is needed to run a smooth channel (see #css, can ask Zof about suggestions regarding bots) +1 for Wave as long as it is split over multiple public pages with proper moderation, otherwise it's a heap of pain. On Wed, Dec 30, 2009 at 8:22 AM, Rick Bullotta rick.bullo...@burningskysoftware.com wrote: +1 for Wave, mostly because the discussions are persistent and searchable. I was a Wave alpha user so I am less taken in by the hype of Wave as the next big thing, but it definitely has a place for certain types of collaboration. You'll probably also want to set up a Neo Google group, or even switch to Google Groups/Wave as the primary communications medium. Wave robots could also be used to sync with the old list server if needed. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Peter Neubauer Sent: Wednesday, December 30, 2009 5:37 AM To: Neo user discussions Subject: [Neo] Communication channel preferences? Hi Folks, just wanted to check with you all if there is interest in some additional forms of communication? What do you think of IRC - very informal and fast, but non-logged and people tend to be inactive with no indication? Jabber chat room - not mainstream, people need an extra account Google Wave - new, beta, but loggable, we have invites for interested people, rich communication others? What are your preferences? Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org- Relationships count. http://gremlin.tinkerpop.com- PageRank in 2 lines of code. http://www.linkedprocess.org - Computing at LinkedData scale. ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] Transaction for traverser ?
I had the same question a couple weeks ago, Laurent. It still isn't clear to me why traversals/reads need to be wrapped in a transaction. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Laurent Laborde Sent: Monday, December 28, 2009 11:29 AM To: Neo user discussions Subject: Re: [Neo] Transaction for traverser ? tx = neo.beginTx(); for(Node node : traverser) { //Some setProperty stuff. } tx.success(); tx.finish(); Exception in thread main java.lang.OutOfMemoryError: Java heap space With 512m ... Bleh :( -- Laurent ker2x Laborde Sysadmin DBA at http://www.over-blog.com/ ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] traverser speed on first execution
It is likely because the caching infrastructure needs to load the nodes once, and then can progressively optimize traversals after that. A common practice to boost first user request performance is to pre-cache certain frequently accessed content by executing a dummy traversal/query when you start your application or web application. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Darren Jensen Sent: Thursday, December 17, 2009 8:16 AM To: user@lists.neo4j.org Subject: [Neo] traverser speed on first execution Hi Neo4j users, My model is based on a typical Yellow Pages style business directory which basically consists of Categories (like Hotels, Restaurants, Swimming Pools etc) and Listings (e.g. Marriott Hotel). A listing can be placed under one or more Categories and a Category can contain one or more Listings. I have written a simple traverser that returns all the Listings in a Category. I am testing with a Category that contains 566 listing nodes. I am wondering why the first time the code executes, it is much slower than subsequent executes? Can you tell me a little bit more about what is happening under the hood please? Is the first execution slower becuase Neo4j has to setup the traverser or is it to setup the transaction? Are there any improvements that I can make to speed up the first execution? Here are the execution times (in order of execution): Duration: 661 ms Duration: 128 ms Duration: 82 ms Duration: 82 ms Duration: 121 ms Duration: 31 ms Duration: 25 ms Duration: 20 ms Duration: 12 ms Duration: 8 ms Duration: 7 ms Duration: 6 ms Duration: 4 ms This is the traverser code (which is executed in a transaction): Traverser listingInCategoryTraverser = categoryNode.traverse( Traverser.Order.BREADTH_FIRST, StopEvaluator.END_OF_GRAPH, ReturnableEvaluator.ALL_BUT_ START_NODE, RelTypes.CATEGORIZED_AS, Direction.INCOMING ); Many thanks for any comments and ideas! Darren ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo] traverser speed on first execution
any sufficiently advanced technology is indistinguishable from magic... - Arthur C. Clarke -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Mattias Persson Sent: Thursday, December 17, 2009 1:15 PM To: Neo user discussions Subject: Re: [Neo] traverser speed on first execution Then there's the JVM voodoo-hot-spot-just-in-time-compilation which need some warmup as well. I'm not really good at JVM behaviour, but that's my guess. 2009/12/17 Rick Bullotta rick.bullo...@burningskysoftware.com: It is likely because the caching infrastructure needs to load the nodes once, and then can progressively optimize traversals after that. A common practice to boost first user request performance is to pre-cache certain frequently accessed content by executing a dummy traversal/query when you start your application or web application. -Original Message- From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On Behalf Of Darren Jensen Sent: Thursday, December 17, 2009 8:16 AM To: user@lists.neo4j.org Subject: [Neo] traverser speed on first execution Hi Neo4j users, My model is based on a typical Yellow Pages style business directory which basically consists of Categories (like Hotels, Restaurants, Swimming Pools etc) and Listings (e.g. Marriott Hotel). A listing can be placed under one or more Categories and a Category can contain one or more Listings. I have written a simple traverser that returns all the Listings in a Category. I am testing with a Category that contains 566 listing nodes. I am wondering why the first time the code executes, it is much slower than subsequent executes? Can you tell me a little bit more about what is happening under the hood please? Is the first execution slower becuase Neo4j has to setup the traverser or is it to setup the transaction? Are there any improvements that I can make to speed up the first execution? Here are the execution times (in order of execution): Duration: 661 ms Duration: 128 ms Duration: 82 ms Duration: 82 ms Duration: 121 ms Duration: 31 ms Duration: 25 ms Duration: 20 ms Duration: 12 ms Duration: 8 ms Duration: 7 ms Duration: 6 ms Duration: 4 ms This is the traverser code (which is executed in a transaction): Traverser listingInCategoryTraverser = categoryNode.traverse( Traverser.Order.BREADTH_FIRST, StopEvaluator.END_OF_GRAPH, ReturnableEvaluator.ALL_BUT_ START_NODE, RelTypes.CATEGORIZED_AS, Direction.INCOMING ); Many thanks for any comments and ideas! Darren ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user -- Mattias Persson, [matt...@neotechnology.com] Neo Technology, www.neotechnology.com ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo] Node vs NodeID questions
Is it safe to hold on to a Node object and share it across threads? In particular, in order to speed up some common traversals, we were thinking of maintaining references to the root nodes of a few important subgraphs in our Neo instance. If it isn't OK to do so, I would guess that it is safe to keep the NodeID and use getNodeByID to get a reference. Just curious if there are any advantages/risks to one approach or the other. ___ Neo mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user