Re: [Neo4j] java.lang.UnsupportedOperationException

2011-08-11 Thread Mattias Persson
The BatchInserter#getGraphDbService() is only there to have the batch
inserter look like a GraphDatabaseService, so that you wouldn't have to
rewrite your code to be able to import it with the batch inserter. index()
support haven't been implemented there... but you should really use
LuceneBatchInserterIndexProvider, see
http://docs.neo4j.org/chunked/stable/indexing-batchinsert.html

2011/8/2 ahmed.elsharkasy ahmed.elshark...@gmail.com

 I am receiving java.lang.UnsupportedOperationException with new
 BatchInserterImpl(neo4j_directory).getGraphDbService().index()

 can you please help me ?

 --
 View this message in context:
 http://neo4j-community-discussions.438527.n3.nabble.com/java-lang-UnsupportedOperationException-tp3218626p3218626.html
 Sent from the Neo4j Community Discussions mailing list archive at
 Nabble.com.
 ___
 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


Re: [Neo4j] Neo4J SQLIMporter question

2011-08-11 Thread Peter Neubauer
Donovan,
I just spend a few hours to bring the SQL Importer project up to date,
see https://github.com/peterneubauer/sql-import for a screenshort of
an imported SQL file that models books, authors, and a related tag
hierarchy and tag relations. Much of what you need should be there.
Looking at 
https://github.com/peterneubauer/sql-import/blob/master/src/test/java/com/neo4j/sqlimport/InsertTest.java#L80
you can omit the subreference nodes creation since it potentially
creates supernodes and is not used for anything practical in the
import.

Is that helping along the way? If you want, contact me with your
example data and we can work out an import setup.

Cheers,

/peter neubauer

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://startupbootcamp.org/    - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



On Wed, Aug 10, 2011 at 10:43 AM, Peter Neubauer
peter.neuba...@neotechnology.com wrote:
 Donovan,
 The project is on GIThub, https://github.com/peterneubauer/sql-import
 and I am right now porting it to Neo4j 1.4. However, I have limited
 bandwidth, I suspect it will take me some evenings to get it working
 properly again. Is that ok?

 Cheers,

 /peter neubauer

 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://startupbootcamp.org/    - Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Tue, Aug 9, 2011 at 9:54 PM, dhsieh dhsie...@yahoo.com wrote:
 Yes, something similar

 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Re-Neo4j-Neo4J-SQLIMporter-question-tp2508296p3240150.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.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] Change multiple relations in one operation

2011-08-11 Thread cnordenfelt
Hi
I have started to digg into neo4j and have not found a nice way to change
many relationships from one node to another. For example, I have n1 with a
relationship to m1, m2 and m3. Now I would like to change the relationship
to point from n2 to m1, m2 and m3 instead. I could of course fetch all
relationships from n1 and change each relationship individually to n2 but
this will make me iterate over all relationships, which could be quite many.
Is there any way to replace a node with another or to reassign multiple
relationships with one operation? 

I'm currently using the Java API.

Thanks
Carl

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246141.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Replication corner cases?

2011-08-11 Thread Tuure Laurinolli
Hello,

I read through the HA/replication documentation at 
http://docs.neo4j.org/chunked/stable/ha.html but a few question about possible 
failure modes remains: Can a HA transaction fail after it's committed on 
master? Consider the following: client C1 commits transaction T through slave 
S1, which propagates it to master M, which commits it. What happens to T if S1 
crashes now? How does client C1 see this? If T is rolled back on M upon fialure 
of S1, can client C2 read the result of T from M before S1 has committed T?


___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Change multiple relations in one operation

2011-08-11 Thread Peter Neubauer
Carl,
this is what you can do. Relationships are immutable, that is, once
created you have to delete them and create new ones in order to change
endpoints. Not much choice there. What is the size of your
reassignments and the number of relationships in one transaction?

Cheers,

/peter neubauer

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://startupbootcamp.org/    - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



On Thu, Aug 11, 2011 at 4:47 PM, cnordenfelt carl.nordenf...@gmail.com wrote:
 Hi
 I have started to digg into neo4j and have not found a nice way to change
 many relationships from one node to another. For example, I have n1 with a
 relationship to m1, m2 and m3. Now I would like to change the relationship
 to point from n2 to m1, m2 and m3 instead. I could of course fetch all
 relationships from n1 and change each relationship individually to n2 but
 this will make me iterate over all relationships, which could be quite many.
 Is there any way to replace a node with another or to reassign multiple
 relationships with one operation?

 I'm currently using the Java API.

 Thanks
 Carl

 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246141.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.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] Further information about Neo4J

2011-08-11 Thread Bruno Paiva Lima da Silva
Hello,

My name is Bruno Paiva Lima da Silva, and I am a PhD student at LIRMM in 
Montpellier, France investigating graph-based conjunctive query 
answering. A very quick description of my thesis can be found at: [ 
http://bplsilva.com/en/ ] , or, for more details, please check my 
presentations [ http://bplsilva.com/en/research/talks/ ].

The reason why I am writing to you is that I require further information 
regarding your storage system. In my work I aim comparing several 
different storage systems for conjective querying. To this end I have 
implemented a common and abstract interface in Java that uses in the 
logical representation (as defined in First-Order Logic) of a factual 
piece of knowledge. The formula is then sent to different storage 
systems (e.g. DEX, HyperGraph, MySQL, Neo4J, OrientDB, Sqlite, and 
others), one of them being your system, and the storage and querying 
time is then logged for further analysis and comparisons.

To this end, I am testing this architecture by the means of an 
incrementally large RDF file, that can go from 10k triples up to 5M 
triples (and more).

The main reason of this e-mail, beside annoucing you that I am using 
your system in a research scope, is to understand whether I am using it 
correctly for our purpose, ensuring the validity of the results I obtain 
when I run my tests.

I am particularly interested in knowing whether I am using the best 
solution with Neo4J within 6 of our functions. In red you will find the 
way we perform it as of today.

- (1) Creating a new graph

public Neo4jGraph(String s) throws Exception {
 super(s);
 directory = alaska-data/neo4j/ + s;
 graph = new EmbeddedGraphDatabase(directory);
 }


- (2) Adding a new node to the graph

public long addTerm(Object label) {
 MapString,Object properties = new 
HashMapString,Object();
 properties.put(label,label.toString());
 long newNode = inserter.createNode(properties);
 batchIndex.add(newNode,properties);
 batchIndex.flush();
 return newNode;
 }

- (3) Adding a new edge to the graph

public void addAtom(Object predicateLabel, ArrayListObject 
termObjects) throws Exception {
 Long n1 = getNodeByLabel(termObjects.get(0));
 Long n2 = getNodeByLabel(termObjects.get(1));

 if (n1 == null) { n1 = addTerm(termObjects.get(0)); }
 if (n2 == null) { n2 = addTerm(termObjects.get(1)); }

 if (n1 != n2) {
 
inserter.createRelationship(n1,n2,DynamicRelationshipType.withName(predicateLabel.toString()),null);
 

 }
 }



- (4) Retrieving all the nodes of the graph

public ArrayListITerm getTerms() throws Exception {
 ArrayListITerm terms = new ArrayListITerm();
 for (Node n : graph.getAllNodes()) {
 if (n.getId() != 0) {
 Term newTerm = new 
Term(n.getProperty(label));
 terms.add(newTerm);
 }
 }
 return terms;
 }

- (5) Retrieving all the edges of the graph

public ArrayListIAtom getAtoms() throws Exception {
 ArrayListIAtom atomsToReturn = new ArrayListIAtom();

 for (Node n : graph.getAllNodes()) {
 IterableRelationship rel = 
n.getRelationships(Direction.OUTGOING);

 for (Relationship r : rel) {
 String predFullName = 
r.getType().toString();
 int predStart = 
predFullName.indexOf([) + 1;
 String predName = 
predFullName.substring(predStart,predFullName.length()-1);

 Predicate pred = new 
Predicate(predName,2);

 ArrayListITerm atomTerms = new 
ArrayListITerm();

 ITerm nt1 = new 
Term(r.getStartNode().getProperty(label));
 ITerm nt2 = new 
Term(r.getEndNode().getProperty(label));
 atomTerms.add(nt1);
 atomTerms.add(nt2);

 IAtom newAtom = new Atom(pred,atomTerms);
 atomsToReturn.add(newAtom);
 }
 }
 return atomsToReturn;
 }

- (6) Retrieving a node by its label

public Long getNodeByLabel(Object label) {
 IndexHitsLong hits = 
batchIndex.get(label,label.toString());
 if (hits.size() == 0) { return null; }
 else { return hits.getSingle(); }
 }

- (7) Identifying whether there is an edge between two nodes or not

public boolean areConnected(ITerm t1,ITerm t2,Predicate p,int pos) 
throws 

Re: [Neo4j] Change multiple relations in one operation

2011-08-11 Thread cnordenfelt
Thanks
For now I'm just prototyping and the case might be that there are several
millions of relationshids that has to be changed in one transaction.
However, it is a very uncommon operation and it might also be that the graph
design should be changed to limit the number of relationships?

//Carl

On Thu, Aug 11, 2011 at 6:04 PM, Peter Neubauer [via Neo4j Community
Discussions] ml-node+3246384-1725270690-421...@n3.nabble.com wrote:

 Carl,
 this is what you can do. Relationships are immutable, that is, once
 created you have to delete them and create new ones in order to change
 endpoints. Not much choice there. What is the size of your
 reassignments and the number of relationships in one transaction?

 Cheers,

 /peter neubauer

 GTalk:  neubauer.peter
 Skype   peter.neubauer
 Phone   +46 704 106975
 LinkedIn   http://www.linkedin.com/in/neubauer
 Twitter  http://twitter.com/peterneubauer

 a href=http://www.neo4j.org http://www.neo4j.org   - Your
 high performance graph database.
 http://startupbootcamp.org/- Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Thu, Aug 11, 2011 at 4:47 PM, cnordenfelt [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3246384i=0
 wrote:

  Hi
  I have started to digg into neo4j and have not found a nice way to change

  many relationships from one node to another. For example, I have n1 with
 a
  relationship to m1, m2 and m3. Now I would like to change the
 relationship
  to point from n2 to m1, m2 and m3 instead. I could of course fetch all
  relationships from n1 and change each relationship individually to n2 but

  this will make me iterate over all relationships, which could be quite
 many.
  Is there any way to replace a node with another or to reassign multiple

  relationships with one operation?
 
  I'm currently using the Java API.
 
  Thanks
  Carl
 
  --
  View this message in context:
 http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246141.html
  Sent from the Neo4j Community Discussions mailing list archive at
 Nabble.com.
  ___
  Neo4j mailing list
  [hidden email] http://user/SendEmail.jtp?type=nodenode=3246384i=1
  https://lists.neo4j.org/mailman/listinfo/user
 
 ___
 Neo4j mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=3246384i=2
 https://lists.neo4j.org/mailman/listinfo/user


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246384.html
  To unsubscribe from Change multiple relations in one operation, click
 herehttp://neo4j-community-discussions.438527.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3246141code=Y2FybC5ub3JkZW5mZWx0QGdtYWlsLmNvbXwzMjQ2MTQxfDQwNDcxMjI=.




--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246722.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Enhanced API wiki page

2011-08-11 Thread Peter Neubauer
Nils,
interesting approaches! However, IMHO the API is still too heavy to
grasp with ConnectorType, EdgeElement, EdgeType and Edge being
involved in creating connections between facts. Is anyone seeing a
more fluent/concise approach to this?  Also, did you have some ideas
about how to traverse or query these hyperedges?

Cheers,

/peter neubauer

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://startupbootcamp.org/    - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



On Wed, Aug 10, 2011 at 1:19 AM, Niels Hoogeveen
pd_aficion...@hotmail.com wrote:

 Today I updated the wiki page for Enhanced API. Since the last edit many 
 changes have taken place, so it was to to reflect those changes on the wiki 
 page.

 See: https://github.com/peterneubauer/graph-collections/wiki/Enhanced-API

 I also changed what was previously called an EdgeRole into a Connector.

 Every Edge has a number of Connectors to which Vertices connect.

 The EdgeType of an Edge defines the ConnectorTypes of the Connectors of an 
 Edge.

 Each ConnectorType and with that a Connector, has a ConnectionMode, which can 
 be one of these four:

 Unrestricted: An Edge can connect to an unlimited number of Vertices through 
 a Connector with an unrestricted mode, and a Vertex can have an unlimited 
 number of connected Edges with a ConnectorType with an unrestricted 
 ConnectionMode.
 Injective: An Edge can connect to only one Vertex through a Connector with 
 injective mode, but a Vertex can have an unlimited number of connected Edges 
 with a ConnectorType with an injective ConnectionMode.
 Surjective: An Edge can connect to an unlimited number of Vertices through a 
 Connector with a surjective mode, but a Vertex can only have one Edge 
 connected to it with a ConnectorType with a surjective ConnectionMode.
 Bijective: An Edge can connect to only one Vertex through a Connector with 
 bijective mode, and a Vertex can only have one Edge connected to it with a 
 ConnectorType with a bijective ConnectionMode.
 All ConnectionModes have been implemented.

 The switch from EdgeRole to Connector with ConnectionModes has eliminated 
 some of the more annoying type parameters found in the previous incarnation 
 of Enhanced API.


 ___
 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] Change multiple relations in one operation

2011-08-11 Thread Rick Bullotta
A couple questions:

- What are you changing? The properties of the relationship(s) or the 
relationships themselves?
- Are you relationships many-to-many, one-to-many, or one-to-one?



-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of cnordenfelt
Sent: Thursday, August 11, 2011 1:55 PM
To: user@lists.neo4j.org
Subject: Re: [Neo4j] Change multiple relations in one operation

Thanks
For now I'm just prototyping and the case might be that there are several
millions of relationshids that has to be changed in one transaction.
However, it is a very uncommon operation and it might also be that the graph
design should be changed to limit the number of relationships?

//Carl

On Thu, Aug 11, 2011 at 6:04 PM, Peter Neubauer [via Neo4j Community
Discussions] ml-node+3246384-1725270690-421...@n3.nabble.com wrote:

 Carl,
 this is what you can do. Relationships are immutable, that is, once
 created you have to delete them and create new ones in order to change
 endpoints. Not much choice there. What is the size of your
 reassignments and the number of relationships in one transaction?

 Cheers,

 /peter neubauer

 GTalk:  neubauer.peter
 Skype   peter.neubauer
 Phone   +46 704 106975
 LinkedIn   http://www.linkedin.com/in/neubauer
 Twitter  http://twitter.com/peterneubauer

 a href=http://www.neo4j.org http://www.neo4j.org   - Your
 high performance graph database.
 http://startupbootcamp.org/- Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.



 On Thu, Aug 11, 2011 at 4:47 PM, cnordenfelt [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3246384i=0
 wrote:

  Hi
  I have started to digg into neo4j and have not found a nice way to change

  many relationships from one node to another. For example, I have n1 with
 a
  relationship to m1, m2 and m3. Now I would like to change the
 relationship
  to point from n2 to m1, m2 and m3 instead. I could of course fetch all
  relationships from n1 and change each relationship individually to n2 but

  this will make me iterate over all relationships, which could be quite
 many.
  Is there any way to replace a node with another or to reassign multiple

  relationships with one operation?
 
  I'm currently using the Java API.
 
  Thanks
  Carl
 
  --
  View this message in context:
 http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246141.html
  Sent from the Neo4j Community Discussions mailing list archive at
 Nabble.com.
  ___
  Neo4j mailing list
  [hidden email] http://user/SendEmail.jtp?type=nodenode=3246384i=1
  https://lists.neo4j.org/mailman/listinfo/user
 
 ___
 Neo4j mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=3246384i=2
 https://lists.neo4j.org/mailman/listinfo/user


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246384.html
  To unsubscribe from Change multiple relations in one operation, click
 herehttp://neo4j-community-discussions.438527.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3246141code=Y2FybC5ub3JkZW5mZWx0QGdtYWlsLmNvbXwzMjQ2MTQxfDQwNDcxMjI=.




--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246722.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.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] Further information about Neo4J

2011-08-11 Thread Jim Webber
Salut Bruno,

Could you clarify your intent for (2) and (3) please?

Do you really mean to use the batch inserter there (that is, is this for an 
initial import), or are you trying to add data to a steady-state database?

If the latter, then you need to read the core API: 
http://docs.neo4j.org/chunked/snapshot/tutorials-java-embedded-hello-world.html

Jim

PS - do keep this list appraised of your research, there are a number of 
academic folks here (including me) who would be  interested.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Change multiple relations in one operation

2011-08-11 Thread Carl Nordenfelt
It's the relationship itself (or to be exact it is the end node of all
relationships to a specific node that I would like to change). The
relationship is one to many. Actually it is a parent child relationship (one
parent have multiple children) and I would like to reassign the parent for
all children of a specific parent.

//Carl

On Thu, Aug 11, 2011 at 8:53 PM, Rick Bullotta
rick.bullo...@thingworx.comwrote:

 A couple questions:

 - What are you changing? The properties of the relationship(s) or the
 relationships themselves?
 - Are you relationships many-to-many, one-to-many, or one-to-one?



 -Original Message-
 From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
 On Behalf Of cnordenfelt
 Sent: Thursday, August 11, 2011 1:55 PM
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] Change multiple relations in one operation

 Thanks
 For now I'm just prototyping and the case might be that there are several
 millions of relationshids that has to be changed in one transaction.
 However, it is a very uncommon operation and it might also be that the
 graph
 design should be changed to limit the number of relationships?

 //Carl

 On Thu, Aug 11, 2011 at 6:04 PM, Peter Neubauer [via Neo4j Community
 Discussions] ml-node+3246384-1725270690-421...@n3.nabble.com wrote:

  Carl,
  this is what you can do. Relationships are immutable, that is, once
  created you have to delete them and create new ones in order to change
  endpoints. Not much choice there. What is the size of your
  reassignments and the number of relationships in one transaction?
 
  Cheers,
 
  /peter neubauer
 
  GTalk:  neubauer.peter
  Skype   peter.neubauer
  Phone   +46 704 106975
  LinkedIn   http://www.linkedin.com/in/neubauer
  Twitter  http://twitter.com/peterneubauer
 
  a href=http://www.neo4j.org http://www.neo4j.org   -
 Your
  high performance graph database.
  http://startupbootcamp.org/- Öresund - Innovation happens HERE.
  http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
  On Thu, Aug 11, 2011 at 4:47 PM, cnordenfelt [hidden email]
 http://user/SendEmail.jtp?type=nodenode=3246384i=0
  wrote:
 
   Hi
   I have started to digg into neo4j and have not found a nice way to
 change
 
   many relationships from one node to another. For example, I have n1
 with
  a
   relationship to m1, m2 and m3. Now I would like to change the
  relationship
   to point from n2 to m1, m2 and m3 instead. I could of course fetch all
   relationships from n1 and change each relationship individually to n2
 but
 
   this will make me iterate over all relationships, which could be quite
  many.
   Is there any way to replace a node with another or to reassign
 multiple
 
   relationships with one operation?
  
   I'm currently using the Java API.
  
   Thanks
   Carl
  
   --
   View this message in context:
 
 http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246141.html
   Sent from the Neo4j Community Discussions mailing list archive at
  Nabble.com.
   ___
   Neo4j mailing list
   [hidden email] http://user/SendEmail.jtp?type=nodenode=3246384i=1
   https://lists.neo4j.org/mailman/listinfo/user
  
  ___
  Neo4j mailing list
  [hidden email] http://user/SendEmail.jtp?type=nodenode=3246384i=2
  https://lists.neo4j.org/mailman/listinfo/user
 
 
  --
   If you reply to this email, your message will be added to the discussion
  below:
 
 
 http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246384.html
   To unsubscribe from Change multiple relations in one operation, click
  here
 http://neo4j-community-discussions.438527.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3246141code=Y2FybC5ub3JkZW5mZWx0QGdtYWlsLmNvbXwzMjQ2MTQxfDQwNDcxMjI=
 .
 
 


 --
 View this message in context:
 http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246722.html
 Sent from the Neo4j Community Discussions mailing list archive at
 Nabble.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


[Neo4j] Extend the reference API

2011-08-11 Thread shlomyb
I use  NEO4J Server with REST technology. 
For my proect  needs ,   I want to add some features  to  Neo4J API
For example , in the RelationShip API I want to give the user the
opportunity to link between to nodes using unique identifier with  an option 
to create them (one or both) if they are not exist?

1.Where\what is a good starting point to do so (in code/document ].. etc.)

2. As I said I am using REST technology , so what is the best way to add a
node in a multi-threded environment?






--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Extend-the-reference-API-tp3247126p3247126.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Extend the reference API

2011-08-11 Thread Michael Hunger
Hi,

you could use either 
* Server-Plugins: http://docs.neo4j.org/chunked/snapshot/server-plugins.html
* Unmanaged 
Extensions:http://docs.neo4j.org/chunked/snapshot/server-unmanaged-extensions.html
* or the (J)Ruby-Script-Extensions: 
http://wiki.neo4j.org/content/Ruby-script_extension

For what you intend ServerPlugins should be the easiest way to go.

You just add the node. Neo4j is thread safe.

Cheers

Michael

Am 11.08.2011 um 21:14 schrieb shlomyb:

 I use  NEO4J Server with REST technology. 
 For my proect  needs ,   I want to add some features  to  Neo4J API
 For example , in the RelationShip API I want to give the user the
 opportunity to link between to nodes using unique identifier with  an option 
 to create them (one or both) if they are not exist?
 
 1.Where\what is a good starting point to do so (in code/document ].. etc.)
 
 2. As I said I am using REST technology , so what is the best way to add a
 node in a multi-threded environment?
 
 
 
 
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Extend-the-reference-API-tp3247126p3247126.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.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] Change multiple relations in one operation

2011-08-11 Thread Michael Hunger
If that is a very frequent operation, you could introduce an intermediate node 
that depicts the root of the tree which is fixed (and probably anonymous) and 
have that node have a single relationship to the parent which can be easily 
replaced.

Cheers

Michael

Am 11.08.2011 um 21:06 schrieb Carl Nordenfelt:

 It's the relationship itself (or to be exact it is the end node of all
 relationships to a specific node that I would like to change). The
 relationship is one to many. Actually it is a parent child relationship (one
 parent have multiple children) and I would like to reassign the parent for
 all children of a specific parent.
 
 //Carl
 
 On Thu, Aug 11, 2011 at 8:53 PM, Rick Bullotta
 rick.bullo...@thingworx.comwrote:
 
 A couple questions:
 
 - What are you changing? The properties of the relationship(s) or the
 relationships themselves?
 - Are you relationships many-to-many, one-to-many, or one-to-one?
 
 
 
 -Original Message-
 From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
 On Behalf Of cnordenfelt
 Sent: Thursday, August 11, 2011 1:55 PM
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] Change multiple relations in one operation
 
 Thanks
 For now I'm just prototyping and the case might be that there are several
 millions of relationshids that has to be changed in one transaction.
 However, it is a very uncommon operation and it might also be that the
 graph
 design should be changed to limit the number of relationships?
 
 //Carl
 
 On Thu, Aug 11, 2011 at 6:04 PM, Peter Neubauer [via Neo4j Community
 Discussions] ml-node+3246384-1725270690-421...@n3.nabble.com wrote:
 
 Carl,
 this is what you can do. Relationships are immutable, that is, once
 created you have to delete them and create new ones in order to change
 endpoints. Not much choice there. What is the size of your
 reassignments and the number of relationships in one transaction?
 
 Cheers,
 
 /peter neubauer
 
 GTalk:  neubauer.peter
 Skype   peter.neubauer
 Phone   +46 704 106975
 LinkedIn   http://www.linkedin.com/in/neubauer
 Twitter  http://twitter.com/peterneubauer
 
 a href=http://www.neo4j.org http://www.neo4j.org   -
 Your
 high performance graph database.
 http://startupbootcamp.org/- Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
 On Thu, Aug 11, 2011 at 4:47 PM, cnordenfelt [hidden email]
 http://user/SendEmail.jtp?type=nodenode=3246384i=0
 wrote:
 
 Hi
 I have started to digg into neo4j and have not found a nice way to
 change
 
 many relationships from one node to another. For example, I have n1
 with
 a
 relationship to m1, m2 and m3. Now I would like to change the
 relationship
 to point from n2 to m1, m2 and m3 instead. I could of course fetch all
 relationships from n1 and change each relationship individually to n2
 but
 
 this will make me iterate over all relationships, which could be quite
 many.
 Is there any way to replace a node with another or to reassign
 multiple
 
 relationships with one operation?
 
 I'm currently using the Java API.
 
 Thanks
 Carl
 
 --
 View this message in context:
 
 http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246141.html
 Sent from the Neo4j Community Discussions mailing list archive at
 Nabble.com.
 ___
 Neo4j mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=3246384i=1
 https://lists.neo4j.org/mailman/listinfo/user
 
 ___
 Neo4j mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=3246384i=2
 https://lists.neo4j.org/mailman/listinfo/user
 
 
 --
 If you reply to this email, your message will be added to the discussion
 below:
 
 
 http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246384.html
 To unsubscribe from Change multiple relations in one operation, click
 here
 http://neo4j-community-discussions.438527.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3246141code=Y2FybC5ub3JkZW5mZWx0QGdtYWlsLmNvbXwzMjQ2MTQxfDQwNDcxMjI=
 .
 
 
 
 
 --
 View this message in context:
 http://neo4j-community-discussions.438527.n3.nabble.com/Change-multiple-relations-in-one-operation-tp3246141p3246722.html
 Sent from the Neo4j Community Discussions mailing list archive at
 Nabble.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

___
Neo4j mailing list

[Neo4j] Very Slow Transaction only on Windows

2011-08-11 Thread Keiichiro Ono
Hi.
I have a summer student working on Cytoscape (graph
visualization/analysis software)-Neo4j integration project using
Blueprints framework.

https://github.com/keiono/blueprints-graph-cytoscape/wiki

Currently, I've got a question from him which I do not know the answer.

Here is the very simple test code.  It adds 1000 Vertices to Neo4j
Graph using CommitManager:

@Test
public void testPerformance() {

long start = System.currentTimeMillis();
final CommitManager manager = 
TransactionalGraphHelper.createCommitManager(
(TransactionalGraph) graphImplementation, 1000);
for (int i = 0; i  1000; i++) {
net.addNode();
manager.incrCounter();
}

manager.close();
final long time = (System.currentTimeMillis() - start);
System.out.println(Nodes added in  + time +  msec.);

assertEquals(1000, net.getNodeCount());

// If we does not use transaction utility method, this can be
minutes or hours...
assertTrue(2000time);
}

https://github.com/keiono/blueprints-graph-cytoscape/blob/master/src/test/java/org/cytoscape/blueprints/implementations/Neo4jTest.java

where net is a wrapper object for Cytoscape graph model, and addNode()
method simply calles graph.addVertex() method in Blueprints' Graph
API.  This test passes in less than a second on my MacBook, but on
Windows PC, it takes 1+ minutes to finish.  Seems transaction is not
working correctly on Windows, but I do not understand why it happens
only on Windows.

Could you give me any suggestions to solve this Windows-dependent problem?

Thanks,

Kei
Cytoscape Core Developer

-- 
Keiichiro Ono    http://www.keiono.net/
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Very Slow Transaction only on Windows

2011-08-11 Thread Michael Hunger
Kei,

How much heap does he use for the test?

On windows memory mapped files are allocated within the java heap space not 
outside as on *nix systems.

There is a messages.log in the graphdb directory. 

Could you share its content with us?

Thanks so much

Michael

Am 11.08.2011 um 21:58 schrieb Keiichiro Ono:

 Hi.
 I have a summer student working on Cytoscape (graph
 visualization/analysis software)-Neo4j integration project using
 Blueprints framework.
 
 https://github.com/keiono/blueprints-graph-cytoscape/wiki
 
 Currently, I've got a question from him which I do not know the answer.
 
 Here is the very simple test code.  It adds 1000 Vertices to Neo4j
 Graph using CommitManager:
 
   @Test
   public void testPerformance() {
 
   long start = System.currentTimeMillis();
   final CommitManager manager = 
 TransactionalGraphHelper.createCommitManager(
   (TransactionalGraph) graphImplementation, 1000);
   for (int i = 0; i  1000; i++) {
   net.addNode();
   manager.incrCounter();
   }
   
   manager.close();
   final long time = (System.currentTimeMillis() - start);
   System.out.println(Nodes added in  + time +  msec.);
   
   assertEquals(1000, net.getNodeCount());
   
   // If we does not use transaction utility method, this can be
 minutes or hours...
   assertTrue(2000time);
   }
 
 https://github.com/keiono/blueprints-graph-cytoscape/blob/master/src/test/java/org/cytoscape/blueprints/implementations/Neo4jTest.java
 
 where net is a wrapper object for Cytoscape graph model, and addNode()
 method simply calles graph.addVertex() method in Blueprints' Graph
 API.  This test passes in less than a second on my MacBook, but on
 Windows PC, it takes 1+ minutes to finish.  Seems transaction is not
 working correctly on Windows, but I do not understand why it happens
 only on Windows.
 
 Could you give me any suggestions to solve this Windows-dependent problem?
 
 Thanks,
 
 Kei
 Cytoscape Core Developer
 
 -- 
 Keiichiro Onohttp://www.keiono.net/
 ___
 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] Replication corner cases?

2011-08-11 Thread dhsieh
According to http://docs.neo4j.org/chunked/stable/ha-architecture.html, this
is my understanding and I would like for confirmation from Neo4j:

A slave will handle writes by synchronizing with the master to preserve
consistency. 
 It sounds like 2-phase commit between write initiated slave  master
 nodes.

Updates will however propagate from the master to other slaves eventually so
a write from one slave is not immediately visible on all other slaves.
 It sounds like eventual consistency from master to other slaves. if so, I
 am interested in finding out details about Neo4j HA member nodes voting
 quorum  arbitrater setup (assuming using zookeeper)

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Replication-corner-cases-tp3246146p3247312.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Very Slow Transaction only on Windows

2011-08-11 Thread Keiichiro Ono
Thanks for the quick reply.
I'll forward the e-mail to him.

By the way, here is my setting, which passes the test:

Thu Aug 11 12:45:50 PDT 2011: Physical mem: 4096MB, Heap size: 123MB
Thu Aug 11 12:45:50 PDT 2011: Kernel version: Neo4j - Graph Database
Kernel 1.4.1
Thu Aug 11 12:45:50 PDT 2011: Neo4j - Graph Database Kernel 1.4.1
Thu Aug 11 12:45:50 PDT 2011: Operating System: Mac OS X; version:
10.7; arch: x86_64; cpus: 4
Thu Aug 11 12:45:50 PDT 2011: VM Name: Java HotSpot(TM) 64-Bit Server VM
Thu Aug 11 12:45:50 PDT 2011: VM Vendor: Apple Inc.
Thu Aug 11 12:45:50 PDT 2011: VM Version: 20.1-b02-383

Kei

2011/8/11 Michael Hunger michael.hun...@neotechnology.com:
 Kei,

 How much heap does he use for the test?

 On windows memory mapped files are allocated within the java heap space not 
 outside as on *nix systems.

 There is a messages.log in the graphdb directory.

 Could you share its content with us?

 Thanks so much

 Michael

 Am 11.08.2011 um 21:58 schrieb Keiichiro Ono:

 Hi.
 I have a summer student working on Cytoscape (graph
 visualization/analysis software)-Neo4j integration project using
 Blueprints framework.

 https://github.com/keiono/blueprints-graph-cytoscape/wiki

 Currently, I've got a question from him which I do not know the answer.

 Here is the very simple test code.  It adds 1000 Vertices to Neo4j
 Graph using CommitManager:

       @Test
       public void testPerformance() {

               long start = System.currentTimeMillis();
               final CommitManager manager = 
 TransactionalGraphHelper.createCommitManager(
                               (TransactionalGraph) graphImplementation, 
 1000);
               for (int i = 0; i  1000; i++) {
                       net.addNode();
                       manager.incrCounter();
               }

               manager.close();
               final long time = (System.currentTimeMillis() - start);
               System.out.println(Nodes added in  + time +  msec.);

               assertEquals(1000, net.getNodeCount());

               // If we does not use transaction utility method, this can be
 minutes or hours...
               assertTrue(2000time);
       }

 https://github.com/keiono/blueprints-graph-cytoscape/blob/master/src/test/java/org/cytoscape/blueprints/implementations/Neo4jTest.java

 where net is a wrapper object for Cytoscape graph model, and addNode()
 method simply calles graph.addVertex() method in Blueprints' Graph
 API.  This test passes in less than a second on my MacBook, but on
 Windows PC, it takes 1+ minutes to finish.  Seems transaction is not
 working correctly on Windows, but I do not understand why it happens
 only on Windows.

 Could you give me any suggestions to solve this Windows-dependent problem?

 Thanks,

 Kei
 Cytoscape Core Developer

 --
 Keiichiro Ono    http://www.keiono.net/
 ___
 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




-- 
Keiichiro Ono    http://www.keiono.net/
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Enhanced API wiki page

2011-08-11 Thread Niels Hoogeveen

Hi Peter,

The API is indeed a bit heavy to grasp, if you want to use N-ary edges. I don't 
know how to make that simpler without sacrificing functionality.

For binary edges and properties, the API is very similar to the standard Neo4j 
API, give or take a some details. 

I have given it considerable thought how to traverse these hyperedges, and the 
answer is stunningly simple: the same as we would a binary edge.

Right now we traverse from a Node to another Node by means of a RelatonshipType 
(given a Direction).

We could also say in Enhanced API parlance that we traverse from a Vertex to a 
BinaryEdge following the StartConnector, then use the EndConnector to reach 
another Vertex.

So traversing the graph requires that we provide a pair of Connectors. This 
works the same for N-ary edges, we still provide a pair of connector, helping 
to build the path we want to return.

Example:

Suppose we have stored the fact Tom, Dick and Harry give Flo and Eddie a Book 
and a Bicycle, as explained on the Wiki page. Suppose all people in the 
database can also be FRIENDs to other people.

Now suppose we want to know the people who are friends of the people that Tom 
has given a gift to.

We provide the traverser with (Giver, Recipient, GIFT) and with 
(StartConnector, EndConnector, FRIEND).

Now we can of course further simplify this by making each step in the traversal 
to only follow one connector:

(Giver, GIFT) (Recipient, GIFT) (StartConnector, FRIEND) (EndConnector, FRIEND)

This way we can traverse not only from Vertex to Vertex (via an Edge), but to 
traverse from a Vertex to an Edge, to a property on that Edge.

Since we want to return a path through the graph, we need to provide a list of 
Connectors describing how to get there. 

Interestingly enough the arity of an Edge has no impact on how the graph is 
traversed. It takes one connector to get to an Edge, and it takes one connector 
to get away from an Edge. 

Niels





 From: peter.neuba...@neotechnology.com
 Date: Thu, 11 Aug 2011 20:46:59 +0200
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] Enhanced API wiki page
 
 Nils,
 interesting approaches! However, IMHO the API is still too heavy to
 grasp with ConnectorType, EdgeElement, EdgeType and Edge being
 involved in creating connections between facts. Is anyone seeing a
 more fluent/concise approach to this?  Also, did you have some ideas
 about how to traverse or query these hyperedges?
 
 Cheers,
 
 /peter neubauer
 
 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://startupbootcamp.org/- Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
 On Wed, Aug 10, 2011 at 1:19 AM, Niels Hoogeveen
 pd_aficion...@hotmail.com wrote:
 
  Today I updated the wiki page for Enhanced API. Since the last edit many 
  changes have taken place, so it was to to reflect those changes on the wiki 
  page.
 
  See: https://github.com/peterneubauer/graph-collections/wiki/Enhanced-API
 
  I also changed what was previously called an EdgeRole into a Connector.
 
  Every Edge has a number of Connectors to which Vertices connect.
 
  The EdgeType of an Edge defines the ConnectorTypes of the Connectors of an 
  Edge.
 
  Each ConnectorType and with that a Connector, has a ConnectionMode, which 
  can be one of these four:
 
  Unrestricted: An Edge can connect to an unlimited number of Vertices 
  through a Connector with an unrestricted mode, and a Vertex can have an 
  unlimited number of connected Edges with a ConnectorType with an 
  unrestricted ConnectionMode.
  Injective: An Edge can connect to only one Vertex through a Connector with 
  injective mode, but a Vertex can have an unlimited number of connected 
  Edges with a ConnectorType with an injective ConnectionMode.
  Surjective: An Edge can connect to an unlimited number of Vertices through 
  a Connector with a surjective mode, but a Vertex can only have one Edge 
  connected to it with a ConnectorType with a surjective ConnectionMode.
  Bijective: An Edge can connect to only one Vertex through a Connector with 
  bijective mode, and a Vertex can only have one Edge connected to it with a 
  ConnectorType with a bijective ConnectionMode.
  All ConnectionModes have been implemented.
 
  The switch from EdgeRole to Connector with ConnectionModes has eliminated 
  some of the more annoying type parameters found in the previous incarnation 
  of Enhanced API.
 
 
  ___
  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] cant use index after commit

2011-08-11 Thread ahmed.elsharkasy
i followed your advice and it is now fairly good

but i have a new performance issue with traversing i have this line of code


Traverser travser = result.traverse(Traverser.Order.DEPTH_FIRST,
StopEvaluator.END_OF_GRAPH, ReturnableEvaluator.ALL,
DynamicRelationshipType.withName(name), Direction.OUTGOING);

the number of nodes i traverse are on average 60 nodes , and it took me
about 500 millisecond to traverse

is this normal?


--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/cant-use-index-after-commit-tp3233038p3247801.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] cant use index after commit

2011-08-11 Thread Michael Hunger
How large is your graph?
And how many connections do those nodes have?

Thanks

Michael

Am 12.08.2011 um 01:50 schrieb ahmed.elsharkasy:

 i followed your advice and it is now fairly good
 
 but i have a new performance issue with traversing i have this line of code
 
 
Traverser travser = result.traverse(Traverser.Order.DEPTH_FIRST,
 StopEvaluator.END_OF_GRAPH, ReturnableEvaluator.ALL,
 DynamicRelationshipType.withName(name), Direction.OUTGOING);
 
 the number of nodes i traverse are on average 60 nodes , and it took me
 about 500 millisecond to traverse
 
 is this normal?
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/cant-use-index-after-commit-tp3233038p3247801.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.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] cant use index after commit

2011-08-11 Thread ahmed.elsharkasy
My graph contains 281 nodes with a total of 350 relationships . average
outgoing edges per node less than 10 and the same for in going edges

what do you think?

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/cant-use-index-after-commit-tp3233038p3247898.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] cant use index after commit

2011-08-11 Thread Michael Hunger
Is this the first traversal, or the average time for several runs?

Thanks

Michael

Am 12.08.2011 um 02:55 schrieb ahmed.elsharkasy:

 My graph contains 281 nodes with a total of 350 relationships . average
 outgoing edges per node less than 10 and the same for in going edges
 
 what do you think?
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/cant-use-index-after-commit-tp3233038p3247898.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.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] cant use index after commit

2011-08-11 Thread Michael Hunger
I just created a graph like yours and run the traversal test, it takes a few 
milliseconds for the initial runs but with hot caches it executes almost 
instantly.

Michael

node count = 952 took 72 ms
node count = 963 took 29 ms
node count = 957 took 39 ms
node count = 973 took 29 ms
node count = 967 took 16 ms
node count = 964 took 19 ms
node count = 952 took 7 ms
node count = 961 took 6 ms
node count = 957 took 6 ms
node count = 973 took 7 ms
node count = 967 took 8 ms
node count = 964 took 9 ms
node count = 1 took 0 ms
node count = 961 took 8 ms
node count = 1 took 2 ms
node count = 973 took 12 ms
node count = 967 took 11 ms
node count = 964 took 10 ms
node count = 952 took 11 ms
node count = 961 took 11 ms
node count = 957 took 12 ms
node count = 973 took 7 ms
node count = 967 took 11 ms
node count = 964 took 6 ms
node count = 952 took 7 ms
node count = 961 took 6 ms
node count = 957 took 6 ms
node count = 973 took 7 ms
node count = 967 took 4 ms
node count = 964 took 4 ms
node count = 952 took 4 ms
node count = 962 took 4 ms
node count = 957 took 4 ms
node count = 973 took 3 ms
node count = 967 took 3 ms
node count = 964 took 3 ms
node count = 952 took 3 ms
node count = 961 took 3 ms
node count = 957 took 3 ms
node count = 973 took 2 ms
node count = 967 took 5 ms
node count = 964 took 4 ms
node count = 952 took 4 ms
node count = 1 took 0 ms
node count = 957 took 3 ms
node count = 973 took 2 ms
node count = 967 took 2 ms
node count = 964 took 2 ms
node count = 954 took 2 ms
node count = 961 took 2 ms
node count = 957 took 1 ms
node count = 973 took 2 ms
node count = 967 took 1 ms
node count = 964 took 2 ms
node count = 952 took 2 ms
node count = 961 took 1 ms
node count = 958 took 2 ms
node count = 1 took 0 ms
node count = 967 took 1 ms
node count = 964 took 2 ms


package org.neo4j.performance.ahmed;

import org.apache.commons.io.FileUtils;
import org.neo4j.graphdb.*;
import org.neo4j.kernel.EmbeddedGraphDatabase;

import java.io.File;
import java.io.IOException;
import java.util.Random;

public class TraverserTest {

public static final int INT = 1000;

enum Rels implements RelationshipType {
_1, _2, _3, _4, _5, _6;

private static Rels randomRel(Random random) {
final Rels[] values = values();
return values[random.nextInt(values.length)];
}
}

public static void main(String[] args) throws IOException {
final File dir = new File(target/traverse);
FileUtils.deleteDirectory(dir);
final EmbeddedGraphDatabase gdb = new 
EmbeddedGraphDatabase(dir.getAbsolutePath());
final Random random = new Random(0);
createGraph(gdb, random);

for (int run = 0; run  10; run++) {
for (Rels rels : Rels.values()) {
runTraversal(gdb, random, rels);
}
}
}

private static void runTraversal(EmbeddedGraphDatabase gdb, Random random, 
final Rels relType) {
final Node startNode = gdb.getNodeById(random.nextInt(INT));
long start = System.currentTimeMillis();
Traverser traverser = startNode.traverse(Traverser.Order.DEPTH_FIRST, 
StopEvaluator.END_OF_GRAPH, ReturnableEvaluator.ALL, relType, 
Direction.OUTGOING);
int count = 0;
for (Node node : traverser) {
count++;
}
long delta = System.currentTimeMillis() - start;
System.out.println(node count =  + count +  took  + delta +  ms);
}

private static void createGraph(EmbeddedGraphDatabase gdb, final Random 
random) {
final Transaction tx = gdb.beginTx();
createNodes(gdb);
connectNodes(gdb, random);
tx.success();
tx.finish();
}

private static void connectNodes(EmbeddedGraphDatabase gdb, Random random) {
for (int i = 0; i  INT; i++) {
final Node start = gdb.getNodeById(i);
for (int j = 0; j  20; j++) {
connectToOtherNodes(gdb, random, start);
}
}
}

private static void createNodes(EmbeddedGraphDatabase gdb) {
for (int i = 0; i  INT; i++) {
gdb.createNode();
}
}

private static void connectToOtherNodes(EmbeddedGraphDatabase gdb, Random 
random, Node start) {
Node end = gdb.getNodeById(random.nextInt(INT));
final Rels type = Rels.randomRel(random);
if (type.ordinal() % 2 == 0) {
start.createRelationshipTo(end, type);
} else {
end.createRelationshipTo(start, type);
}
}

}

Am 12.08.2011 um 02:55 schrieb ahmed.elsharkasy:

 My graph contains 281 nodes with a total of 350 relationships . average
 outgoing edges per node less than 10 and the same for in going edges
 
 what do you think?
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/cant-use-index-after-commit-tp3233038p3247898.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 

Re: [Neo4j] cant use index after commit

2011-08-11 Thread ahmed.elsharkasy
i knew now what swallows the time , it is graphdb.shutdown i am calling after
the travsersal , it took 500 millisecond to shutdown the db ??!!!

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/cant-use-index-after-commit-tp3233038p3247993.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] cant use index after commit

2011-08-11 Thread ahmed.elsharkasy
This is system related or an issue in neo4j ?

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/cant-use-index-after-commit-tp3233038p3248019.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] some questions : unique property and Rest

2011-08-11 Thread shlomyb
1.Does Neo4J support *unique property*  (Node/Relationship)?
2.How can I wrap a Node in a MyClass and using it with Rest services?
3.Can I use in MyClass some JPA annotaions?

shlomib


--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/some-questions-unique-property-and-Rest-tp3248352p3248352.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] java.lang.OutOfMemoryError: PermGen space

2011-08-11 Thread Tatham Oddie
Howdy,

We've started experiencing reasonably consistent java.lang.OutOfMemoryError 
exceptions.

We're using neo4j-community-1.4.M04-windows.zip, running on Windows 7 x64 for 
development + Windows Azure for production.

Graph access is exclusively via REST. We perform basic CRUD operations and 
Gremlin queries.

The server spins up like so:

12/08/11 2:39:43 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO: 
Starting Neo Server on port [5102] with [80] threads available
12/08/11 2:39:43 PM org.neo4j.server.database.Database INFO: Using database 
at C:\AzureTemp\neo4j-db
12/08/11 2:39:47 PM org.neo4j.server.modules.DiscoveryModule INFO: Mounted 
discovery module at [/]
12/08/11 2:39:48 PM org.neo4j.server.plugins.PluginManager INFO: Loaded 
server plugin CypherPlugin
12/08/11 2:39:48 PM org.neo4j.server.plugins.PluginManager INFO: Loaded 
server plugin GremlinPlugin
12/08/11 2:39:48 PM org.neo4j.server.modules.RESTApiModule INFO: Mounted 
REST API at [/db/data/]
12/08/11 2:39:48 PM org.neo4j.server.modules.ManagementApiModule INFO: 
Mounted management API at [/db/manage/]
12/08/11 2:39:48 PM org.neo4j.server.modules.WebAdminModule INFO: Mounted 
webadmin at [/webadmin]
12/08/11 2:39:48 PM org.neo4j.server.web.Jetty6WebServer INFO: Mounting 
static content at [/webadmin] from [webadmin-html]
12/08/11 2:39:50 PM org.neo4j.server.NeoServerWithEmbeddedWebServer INFO: 
Server started on [http://192.168.10.151:5102/]

Then, after a relatively small number of queries (sub 500? still confirming 
more details), we get this:

Exception in thread RMI RenewClean-[192.168.10.151:31174] 
java.lang.OutOfMemoryError: PermGen space
Exception in thread Statistics Gatherer java.lang.OutOfMemoryError: 
PermGen space

Java.exe is still running, and consuming around 180MB of RAM (with another 3GB 
of physical memory still available on the system). REST API returns 500s and 
the WebAdmin is unavailable.

My questions:

1) Is this just that we've got a configuration setting wrong? In my very 
limited knowledge of Java, I know we can reconfigure the size, but this seems 
to indicate a potentially larger issue.

2) What should I do to gather more information to help diagnose this?


--
Tatham Oddie
au mob: +61 414 275 989, us cell: +1 415 598 8201, skype: tathamoddie
If you're printing this email, you're doing it wrong. This is a computer, not a 
typewriter.

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user