Re: [Neo4j] [Neo4j - Load CSV ] create not enough nodes in csv file.

2014-07-04 Thread Nguyen Minh Nhut
OK Thks! On Sat, Jul 5, 2014 at 3:25 AM, Michael Hunger < michael.hun...@neotechnology.com> wrote: > I just deleted all quotes and the emojii smileys ;) > > Sent from mobile device > > Am 04.07.2014 um 17:10 schrieb Nguyen Minh Nhut < > nguyenminhnhutk...@gmail.com>: > > I have escaped all the

Re: [Neo4j] Ensuring data integrity in Neo4j - unique outgoing relationships

2014-07-04 Thread Alex Frieden
This is probably wrong, but can't you just merge a relationship between the nodes to insure the outgoing relationship is unique? Maybe I don't fully understand the use case. On Fri, Jul 4, 2014 at 4:22 PM, Michael Hunger < michael.hun...@neotechnology.com> wrote: > There is no way yet to enforc

Re: [Neo4j] Concurrent numeric index queries slows linearly with the number threads

2014-07-04 Thread ashish jindal
let me try that. On Saturday, July 5, 2014 2:15:38 AM UTC+5:45, Michael Hunger wrote: > > I just saw. ... If you have already n > > Then it should be much faster to check outgoing rels by property than a > index lookup. > > Sent from mobile device > > Am 04.07.2014 um 22:25 schrieb ashish jindal

Re: [Neo4j] Concurrent numeric index queries slows linearly with the number threads

2014-07-04 Thread Michael Hunger
I just saw. ... If you have already n Then it should be much faster to check outgoing rels by property than a index lookup. Sent from mobile device Am 04.07.2014 um 22:25 schrieb ashish jindal : > yes, each thread has its own transaction. > > On Saturday, July 5, 2014 2:08:45 AM UTC+5:45, Mic

Re: [Neo4j] [Neo4j - Load CSV ] create not enough nodes in csv file.

2014-07-04 Thread Michael Hunger
I just deleted all quotes and the emojii smileys ;) Sent from mobile device Am 04.07.2014 um 17:10 schrieb Nguyen Minh Nhut : > I have escaped all the single quotes by double them and delete all the > smileys like you said. Now when i count(*), it reuturns 30375 but not 41879 > nodes. > Could

Re: [Neo4j] Concurrent numeric index queries slows linearly with the number threads

2014-07-04 Thread ashish jindal
yes, each thread has its own transaction. On Saturday, July 5, 2014 2:08:45 AM UTC+5:45, Michael Hunger wrote: > > But tge tx is created per thread? > > > > Sent from mobile device > > Am 04.07.2014 um 22:20 schrieb ashish jindal >: > > It is in a single transaction, which is on the outermost lay

Re: [Neo4j] Concurrent numeric index queries slows linearly with the number threads

2014-07-04 Thread Michael Hunger
But tge tx is created per thread? Sent from mobile device Am 04.07.2014 um 22:20 schrieb ashish jindal : > It is in a single transaction, which is on the outermost layer. > > On Saturday, July 5, 2014 2:01:44 AM UTC+5:45, Michael Hunger wrote: >> >> What is your transactional scope? >> >> M

Re: [Neo4j] Ensuring data integrity in Neo4j - unique outgoing relationships

2014-07-04 Thread Michael Hunger
There is no way yet to enforce that at the neo level we plan to add such optional constraints later on. What works in such import situations is to have a set of rules written in cypher that check the valid model and return offenders Then you can use a cypher query to fix your model Eg by delet

Re: [Neo4j] Concurrent numeric index queries slows linearly with the number threads

2014-07-04 Thread ashish jindal
It is in a single transaction, which is on the outermost layer. On Saturday, July 5, 2014 2:01:44 AM UTC+5:45, Michael Hunger wrote: > > What is your transactional scope? > > Michael > > Sent from mobile device > > Am 04.07.2014 um 22:06 schrieb ashish jindal >: > > Hi Michael, > number of rels r

Re: [Neo4j] Concurrent numeric index queries slows linearly with the number threads

2014-07-04 Thread Michael Hunger
What is your transactional scope? Michael Sent from mobile device Am 04.07.2014 um 22:06 schrieb ashish jindal : > Hi Michael, > number of rels returned is 10-50 . Yes, i close the hits iterator as soon as > its purpose is served. > > On Saturday, July 5, 2014 1:08:09 AM UTC+5:45, Michael Hun

Re: [Neo4j] Concurrent numeric index queries slows linearly with the number threads

2014-07-04 Thread ashish jindal
Hi Michael, number of rels returned is 10-50 . Yes, i close the hits iterator as soon as its purpose is served. On Saturday, July 5, 2014 1:08:09 AM UTC+5:45, Michael Hunger wrote: > > How many rels are returned from the call? > > Do you close the hits afterwards to release resources? > > Sent fr

Re: [Neo4j] Concurrent numeric index queries slows linearly with the number threads

2014-07-04 Thread Michael Hunger
How many rels are returned from the call? Do you close the hits afterwards to release resources? Sent from mobile device Am 04.07.2014 um 10:51 schrieb ashish jindal : > Hi, > I am relatively new to neo4j. I have implemented a traversal algorithm using > neo4j as underlying graph storage. > G

Re: [Neo4j] java api for getting all nodes for a label?

2014-07-04 Thread Michael Hunger
GlobalGraphOperations.at(db).getAllNodesByLabel(label) Sent from mobile device Am 04.07.2014 um 21:07 schrieb Pieter Martin : > Hi, > > I am looking for a way to find all nodes for with a label using the java api. > > I can only see the following, > > GraphDatabaseService.findNodesByLabelA

[Neo4j] Ensuring data integrity in Neo4j - unique outgoing relationships

2014-07-04 Thread Liliana Ziolek
I came across this as a classic PEBKAC issue when importing the data, but the resulting exception on SDN was a bit obscure and I ended spending quite a bit of time time trying to work out what's wrong. It made me think of a better way of handling this issue at the data import step. What happene

[Neo4j] java api for getting all nodes for a label?

2014-07-04 Thread Pieter Martin
Hi, I am looking for a way to find all nodes for with a label using the java api. I can only see the following, GraphDatabaseService.findNodesByLabelAndProperty( Label label, String key, Object value ) Is there a way to find all nodes only for a given label(s) using the java api? Thanks

[Neo4j] Re: Concurrent numeric index queries slows linearly with the number threads

2014-07-04 Thread ashish jindal
Any help ? On Friday, July 4, 2014 2:36:59 PM UTC+5:45, ashish jindal wrote: > > Hi, > I am relatively new to neo4j. I have implemented a traversal algorithm > using neo4j as underlying graph storage. > Graph has about 40K nodes and about 2M edges. > Using 2.1.2 community version of neo4j embed

Re: [Neo4j] [Neo4j - Load CSV ] create not enough nodes in csv file.

2014-07-04 Thread Nguyen Minh Nhut
I have escaped all the single quotes by double them and delete all the smileys like you said. Now when i count(*), it reuturns 30375 but not 41879 nodes. Could you tell me, what characters I should check that affect my results. Sorry about my bad English. On Fri, Jul 4, 2014 at 5:28 PM, Michael

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread ducky
Thanks. I understand the necessity of having no data corruption and hence the need for locks. But if we can get slightly less locking without giving up any of the goodness which comes with it, it'll be awesome! I've had a look at Max's latest post. I've signed up for his kickstarter as well. Re

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread Chris Vest
You can't manually release locks from on-going transactions. Write-locks protects writes that you logically only intend to do, until the transaction commits or rolls back. It might be possible to add a feature like that, but we'd have to keep the write-locks on the entities that are actually wr

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread Michael Hunger
You could acquire a coarser lock on a certain lock node for your use-case so the requests would be serialized Or you batch your operations so that the locks are held by the same tx See maxdemarzi.com blog for several examples. Sent from mobile device Am 04.07.2014 um 13:50 schrieb ducky : > T

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread ducky
Thanks Chris. What I meant was that a read-write lock on a node when an edge is being created felt heavy. If thats what is required for a transactional database like neo4j, so be it. I understand how I can handle this in my user code (by retrying or structuring my data differently). If I kn

Re: [Neo4j] [Neo4j - Load CSV ] create not enough nodes in csv file.

2014-07-04 Thread Michael Hunger
You have several single quotes in your file, which cause our csv reader to continue to read until it finds the next quote. You have to escape those by doubling them. Many of them are smileys like this ":) LOAD CSV FROM "file:///Users/mh/Downloads/thanhvien.csv" AS line return count(*); +---

[Neo4j] Concurrent numeric index queries slows linearly with the number threads

2014-07-04 Thread ashish jindal
Hi, I am relatively new to neo4j. I have implemented a traversal algorithm using neo4j as underlying graph storage. Graph has about 40K nodes and about 2M edges. Using 2.1.2 community version of neo4j embedded. It is hosted as service in tomcat7 with allocated 6Gb of memory on 14.04 Ubuntu. Fol

[Neo4j] what is the behaviour of concurrent numeric queries?

2014-07-04 Thread ashish jindal
Hi, I am relatively new to neo4j. I have implemented a traversal algorithm using neo4j as underlying graph storage. public Relationship getRelationship(Node n, int lowerlimit, int upperlimit) throws Exception { long t1 = System.currentTimeMillis(); IndexHits hits = numericIndex.qu

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread Chris Vest
Hi, This is expected behaviour for transactional databases with pessimistic concurrency control. You usually handle this in user-code by retrying the transaction, making sure that external side-effects, such as sending emails and processing payments, only happen after the transaction has commit

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread ducky
Hi Chris, i) I do create more than 1 relationship per transaction. ii) As you suggest, the nodes b, c are involved in creating other relationships but not between each other. This is a real bummer. So in my case, creating locks on the nodes when creating relationships and the locks only being re