Re: [Neo4j] setRelationshipProperty() in BatchInserter

2012-06-05 Thread Michael Hunger
Can you share the exception?

Michael

Am 05.06.2012 um 16:14 schrieb Sarnath K - ERS, HCLTech:

 All,
 
 We were able to successfully create a Neo4J Graph database (1.7.2) using 
 Batch Insert.
 Able to view the same through the browser (via the REST API)
 
 However, we ran into problems when trying to use setRelationshipProperty 
 API.
 Here is the sequence that leads to the problem:
 
 1.Create a Relationship
 
 2.Add a set of Key-Value Pairs as properties - Let us call this Unique 
 set A
 
 3.Add another set of Key-Value pairs as properties, Let us call this 
 Unique set B
 
 4.A Intersection B is non-null i.e. Sets A and B can have same Keys.
 
 5.When we encounter common keys, we just read existing property value, 
 append the new property value and call setRelationshipProperty() API with 
 the new updated property value
 
 However, Step 5 causes exception in PropertyStore.java
 
 To our naïve eyes, it looks to be a bug.
 Can somebody help us here?
 
 Many Thanks,
 Best Regards,
 Sarnath
 
 
 ::DISCLAIMER::
 
 
 The contents of this e-mail and any attachment(s) are confidential and 
 intended for the named recipient(s) only.
 E-mail transmission is not guaranteed to be secure or error-free as 
 information could be intercepted, corrupted,
 lost, destroyed, arrive late or incomplete, or may contain viruses in 
 transmission. The e mail and its contents
 (with or without referred errors) shall therefore not attach any liability on 
 the originator or HCL or its affiliates.
 Views or opinions, if any, presented in this email are solely those of the 
 author and may not necessarily reflect the
 views or opinions of HCL or its affiliates. Any form of reproduction, 
 dissemination, copying, disclosure, modification,
 distribution and / or publication of this message without the prior written 
 consent of authorized representative of
 HCL is strictly prohibited. If you have received this email in error please 
 delete it and notify the sender immediately.
 Before opening any email and/or attachments, please check them for viruses 
 and other defects.
 
 
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] How to store Facebook user education in neo4j

2012-05-31 Thread Michael Hunger
Yes your suggestion sounds good.

If you're interested in the actual classes (e.g. for connecting other users to 
the same class aka stayfriends) then you'd also model the classes as nodes (but 
only if you really need it in your problem domain, you can also later still 
evolve the model).

For looking up users and places you would use unique index id's.

Traversing is fast as it is the core graphdb operation.

The main performance difference is from where you start the traversal (i.e. the 
user which has just a few rels or the place, which might have many rels) and 
how you continue from there.

If you need at some point you can add additional relationship with just the 
degree's for.

e.g. (user) - PHD - (MIT)

Michael

Am 31.05.2012 um 10:50 schrieb Maaz Bin Tariq:

 I want to store Facebook educations of a user in Neo4j, so that i can query 
 on any attribute combinations.
 Currently Fields I want to save of Facebook education field
 https://graph.facebook.com/me?fields=id,name,educationaccess_token=.
 
 {
 id:1
 name:xyz
 education:[  
 {school:{id:2,name:A},
  degree:{id:3,name:B},
  year:  {id:4,name:C},
  type:X,
 },.]
 }
 
 In MySQL I will create an education table with following table user_id, 
 school_id,degree_id,year_id,type
 Not sure whats the best way to store it in Neo4j. 
 1. possible solution is 
 Node User -(edu relationship) --- Node school
 
 degree,year,type are relationship attributes.
 Not sure it will be be fast if we traverse users on type and degree 
 attributes. (i.e relationship attributes)
 Is there any other or better way?
 
 Thanks
 -Maaz
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] large graph visualizations/analytics

2012-04-11 Thread Michael Hunger
You can also just spin up a 4XL AWS instance (with 68G RAM) for the viz and 
shut it down after you're done.

For analytics you can use Neo4j directly or you export your db into twitters 
cassovary.

For visualization, perhaps you can find something here: 
http://www.mkbergman.com/414/large-scale-rdf-graph-visualization-tools/

What do you want to achieve ? Typical force directed graphs just end up being 
useless hairballs at that size.
Would also be interesting to see if hiveplots are suitable (read his 
argumentation against hairballs).

It might be also sensible to use the analytics to aggregate your graph to a 
semantic denser (but smaller) graph and then visualize that one?

Michael

Am 11.04.2012 um 11:25 schrieb Peter Neubauer:

 Ajinkya,
 just talked to one of the Gephi guys,
 
 2.3M nodes and 60M edges...you should buy another computer with
 at least 60GB of RAM for Gephi.
 
 Cheers,
 
 /peter neubauer
 
 G:  neubauer.peter
 S:  peter.neubauer
 P:  +46 704 106975
 L:   http://www.linkedin.com/in/neubauer
 T:   @peterneubauer
 
 Neo4j- Graphs rule.
 Program or be programmed - Computer Literacy for kids.
 http://foocafe.org/#CoderDojo
 
 
 
 On Wed, Apr 11, 2012 at 10:17 AM, Ajinkya Kale kaleajin...@gmail.com wrote:
 Hi, I am trying to load neo4j db in Gephi on a 64-bit windows system with
 6GB RAM running a 64-bit jvm but it runs out of memory .. i tried to
 allocate more memory through the jvm parameters and ended up allocating the
 maximum possible without any luck.
 My graphdb is of the following dimensions :
 
 nodes 2320895
 type1 relationship edge 50655143
 type2 relationship edge 10632833
 
 Any suggestions on tools/techniques to visualize and run analytics on
 graphdbs of this scale ?
 
 --
 
 Regards,
 Ajinkya
 http://ajinkya.info
 
 .O.
 ..O
 OOO
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please 
 register and consider posting at 
 https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] How to use Java API to talk to Neo4J Server

2012-01-08 Thread Michael Hunger
You might look into the java-rest-binding which provides the neo4j-core-api to 
the remote server.

https://github.com/neo4j/java-rest-binding

As for examples, I'm currently working on a template repository for heroku 
templates that uses this rest-binding with the playframework (my first 
playframework project, so bear with me).
(https://github.com/jexp/shareheroku-java)

Cheers

Michael

Am 08.01.2012 um 14:22 schrieb David Smith:

 My main question here is how do I talk to a standalone Neo4J Server
 using the Java API, can anyone provide a java example?
 Can the java api talk to an already running standalone Neo4J Server?
 
 I have played with EmbeddedGraphDatabase.
 
 If I have a web app (Grails/Groovy - Java), which method of talking to
 Neo4J would I use - EmbeddedGraphDatabase or Standalone Server?
 
 One example I have seen:
 
 AbstractGraphDatabase graphdb = getGraphDb();
 WrappingNeoServerBootstrapper srv;
 srv = new WrappingNeoServerBootstrapper( graphdb );
 srv.start();
 // The server is now running
 // until we stop it:
 srv.stop();
 
 
 How do I create the AbstractGraphDatabase?
 Is this really talking to the standalone server or is getGraphDb just
 instantiating an EmbeddedGraphDatabase and wrapping that to enable the
 web stats?
 
 Is it best to start the server as a service or start it from the web
 app?
 
 Thanks
 David
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] SpringData requires rename of transactionManager

2012-01-02 Thread Michael Hunger
Frank,

could you share more of your project? And also the exceptions that ocurr ?

The neo4j TM is named neo4jTransactionManager only having an Alias to 
transactionManager, imho it should be possible to 
override that alias with another bean definition like yours.

It would be great if you could share the project (or at least the config + a 
minimal test-case) for us to reproduce.

Thanks a lot

MIchael

Am 01.12.2011 um 20:47 schrieb Frank:

 Hi,
 
 I find that I'm unable to integrate SpringDataNeo4j into my existing Spring
 project unless I rename my transaction manager, which is currently declared
 this way:
 
bean id=transactionManager
 class=org.springframework.jdbc.datasource.DataSourceTransactionManager
property name=dataSource ref=sbDataSource /
/bean
 
bean id=transactionTemplate
 class=org.springframework.transaction.support.TransactionTemplate
property name=transactionManager ref=transactionManager /
/bean
 
tx:annotation-driven transaction-manager=transactionManager /
 
 Unless I rename the first bean to something other than transactionManager,
 my own Spring beans fail to load. I'm somewhat hesitant to do this because
 I'm working in a large project with multiple developers and I don't know the
 full impact of renaming this bean. Is there any other way around the
 problem? Can I be certain that neo4j will not interfere with my existing
 JDBC transactions?
 
 I'm also a bit curious/confused as to where the neo4j transactionManager
 bean is coming from. I did not declare any such bean in my Spring
 configuration files. All I declared was this:
 
   neo4j:config graphDatabaseService=graphDatabaseService/
   
   bean id=graphDatabaseService
 class=org.springframework.data.neo4j.rest.SpringRestGraphDatabase
   constructor-arg value=http://localhost:7474/db/data//
   /bean
 
 Finally, I'm wondering why I shouldn't just instantiate a
 SpringRestGraphDatabase object programatically instead of as a Spring bean.
 Is there any particular disadvantage to doing it programatically beyond the
 benefits of having Spring manage the lifecycle?
 
 Thanks for your help.
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/SpringData-requires-rename-of-transactionManager-tp3552635p3552635.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

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] Inheritance in spring-data-neo4j

2011-12-14 Thread Michael Hunger
Nils,

Answered there, copying it here for completeness :)

Michael

If you use videoRepository.findById() it only looks on the video-repository 
level (as it only knows about that). It creates a cypher query that uses:

start n = node:Video(id={0}) return n;

There is the @Indexed(level=IndexType.INSTANCE) attribute that makes the field 
being indexed at the instance-class level and not at the level of the declaring 
class of the field. I'm just thinking about adding another option that says 
IndexType.HIERARCHY that adds an index-entry on all levels.

Could you please raise a JIRA issue for this. 

Thanks a lot

Michael

Am 14.12.2011 um 09:17 schrieb Nils Kaiser:

 Hi,
 
 This is a cross post from 
 http://forum.springsource.org/showthread.php?120071-Inheritance-in-spring-data-neo4j
  
 
 
 I'm using spring-data-neo4j in an object model with inheritance, with a 
 base class Video, a subclass YoutubeVideo and a VideoRepository. The 
 Video base class contains a field id, which uses @Indexed
 
 When I save a Video instance with an id field a call to 
 VideoRepository.findById returns the object.
 
 However, if I save a YoutubeVideo, the same call to 
 VideoRepository.findById returns null.
 
 Why do I get a different behavior here?
 
 Here are the model classes:
 
 
 @NodeEntity
 public class Video {
 @GraphId
 public Long nodeId;
 @Indexed
 public String id;
 @Indexed
 public String title;
 public String description;
 public String originalTitle;
 public String thumbnailUrl;
 }
 public class YoutubeVideo extends Video {
 public String youtubeId;
 }
 
 public interface VideoRepository extends GraphRepositoryVideo, 
 NamedIndexRepositoryVideo,
 RelationshipOperationsRepositoryVideo {
 Video findById(String id);
 }
 
 
 
 Here is the test code I use. The second test fails.
 
 @Test
 public void findVideo() {
Video video = new Video();
 video.setId(test.new);
 
 videoRepository.save(video);
 Video existing = videoRepository.findById(video.getId());
 assertNotNull(existing);
 
 videoRepository.delete(existing);
 existing = videoRepository.findById(video.getId());
 assertNull(existing);
 }
 
 @Test
 public void findVideoSubclass() {
 YoutubeVideo video = new YoutubeVideo();
 video.setId(test.subclass);
 
 videoRepository.save(video);
 Video existing = videoRepository.findById(video.getId());
 assertNotNull(existing); - fails
 
 videoRepository.delete(existing);
 existing = videoRepository.findById(video.getId());
 assertNull(existing);
 }
 
 -- 
 Nils Kaiser
 MSc in Information Systems
 
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] Feedback after evaluation

2011-12-10 Thread Michael Hunger
Hmm I think that works,

but it won't help with the OOM, as groovy compares the script contents to check 
if it is the same script

Michael

Am 10.12.2011 um 03:13 schrieb espeed:

 Michael -
 
 What if each Gremlin script was scoped inside a Groovy function? 
 
 Example: https://gist.github.com/1454298
 
 Would that help keep things clean?
 
 - James
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Feedback-after-evaluation-tp3569774p3574631.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] Feedback after evaluation

2011-12-09 Thread Michael Hunger
you should use native gremlin params where they can be used. otherwise you'll 
blow the scriptengine in the plugin and loose lots of performance

M

mobile mail please excuse brevity and typos

Am 09.12.2011 um 11:16 schrieb espeed ja...@jamesthornton.com:

 On Thursday, December 8, 2011 2:48:59 AM UTC-6, Dmytrii Nagirniak wrote:
 
 Unfortunately I couldn't see a lot of value in the REST API either.
 The core operations that are taken for granted with native bindings
 (traversals using poor Ruby constructs) would require to execute HTTP
 request (that's what SELECT N+1 in SQL world is).
 Or otherwise I would have to wrap all the logic in the traversal queries. It
 would significantly overcomplicate the system with HTTP handling logic.
 
 
 Hi Dmytrii -
 
 Neo4j Server has a built-in Gremlin scripting engine that enables REST
 clients to execute transactions in a single HTTP request.
 
 Gremlin is a domain-specific language for graphs written in Groovy. If you
 were using a relational database, you would use its domain-specific
 language, which is SQL. Same idea.
 
 For the last few weeks, I have been working on Bulbs 0.3, which is a Python
 REST client for Neo4j Server, and it has a library of Gremlin templates in a
 YAML file. 
 
 The Python methods do named variable substitution on the Gremlin templates
 and then execute them via the Neo4j Server Gremlin extension. 
 
 Here's an example:
 
 gremlin.yaml
 https://gist.github.com/1450859
 
 element.py 
 https://gist.github.com/1450871
 
 You can see the create_indexed_vertex Gremlin script has JSON args. Python
 lists and dicts are converted to JSON, and then on the server side, the
 Gremlin script converts them into Groovy maps and lists. 
 
 Marko is working on adding the JSONSlurper library import to Gremlin so you
 won't have to do the import each time
 (https://github.com/tinkerpop/gremlin/issues/259).
 
 
 So I decided to write another REST library
 (http:://github.com/dnagir/morpheus),
 but then gave up realising that you just cannot have a proper abstraction
 over HTTP.
 (I'll probably kill off that repo).
 
 Groovy is pretty simple. Consider reviving Morpheus and using Gremlin for
 scripting -- you'll get all the power of native Ruby and Neo4j without the
 Java.
 
 When Bulbs 0.3 is released, I'll post the full gremlin.yaml, and you should
 be able to use it in Ruby without any mods since it's just YAML.
 
 - James
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Feedback-after-evaluation-tp3569774p3572548.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] Feedback after evaluation

2011-12-09 Thread Michael Hunger
I understood you were just templating the params in there (string replacement) 
which would result in different groovy strings for every set of different 
parameters.

Is this correct?

Michael

Am 09.12.2011 um 11:44 schrieb espeed:

 
 Michael Hunger wrote
 
 you should use native gremlin params where they can be used. otherwise
 you'll blow the scriptengine in the plugin and loose lots of performance
 
 
 Hi Michael -
 
 What do you mean exactly? After the JSON param converts to a map, everything
 is a native Groovy param.
 
 - James
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Feedback-after-evaluation-tp3569774p3572589.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] Feedback after evaluation

2011-12-09 Thread Michael Hunger
Ouch :)

The gremlin plugin (as does the cypher plugin) take an map (a json map) as 
params, each of which which you then can refer to everywhere in the gremlin 
script (key == variable name, value == value).

So no need for JSONSlurper.

The real problem here lies in the fact that each of your statements (with 
different parameters) will cause the groovy-scripting engine to generate a new 
groovy class, which will in turn
* cause PermGen OutOfMemory errors as those can't be garbage collected as long 
as the script engine is around
* will take about factor 100-1000 longer to execute (parsing, class generation, 
loading and such).

For the first issue we have a work-around in the plugin which recreates the 
script-engine every 500 requests (should probably be configurable) but this is 
less than optimal.

The second problem will hit you all the time.

Michael

See: 
http://docs.neo4j.org/chunked/milestone/gremlin-plugin.html#rest-api-send-a-gremlin-script-with-variables-in-a-json-map

Am 09.12.2011 um 20:35 schrieb espeed:

 
 Michael Hunger wrote
 
 I understood you were just templating the params in there (string
 replacement) which would result in different groovy strings for every set
 of different parameters. Is this correct?
 
 
 The string replacement is done on the client side. When the script is
 presented to the extension, it looks like a normal Gremlin script.
 
 For example, the update_indexed_vertex YAML script has three params: nodeId,
 properties, indexName. But all the string replacement is done by the client.
 
 By the time the Gremlin extension gets it, the nodeId is an integer, which
 is used to look up the node object:
 
 node = g.getRawGraph().getNodeById(5)
 
 The properties are a JSON string, which are immediately converted to a
 Groovy map so they can be iterated upon:
 
 MapString, Object properties = slurper.parseText('{age:35,name:James
 Thornton}')
 
 The indexName is a string, which is used to look up the actual index:
 
 index = manager.forNodes('people')
 
 Here is what the Gremlin extension actually sees:
 https://gist.github.com/1452942
 
 Do see an issue with that?
 
 - James
 
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Feedback-after-evaluation-tp3569774p3573842.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] Feedback after evaluation

2011-12-09 Thread Michael Hunger
Because they are internal to the groovy script engine?

And can't be garbage collected as it is still around and holds handles to those 
classes.
Believe me I would love if there was another way.

Cheers

Michael

Am 09.12.2011 um 23:53 schrieb Dmytrii Nagirniak:

 
 
 On 10/12/2011, at 9:03, Michael Hunger michael.hun...@neotechnology.com 
 wrote: 
 For the first issue we have a work-around in the plugin which recreates the 
 script-engine every 500 requests (should probably be configurable) but this 
 is less than optimal.
 
 That is just rediculous workaround as to me! You drop everything that the 
 engine carefully tried to compile and optimize! This defeats the point of the 
 optimization.
 Why not use a priority queue/list/cache and drop the entries that are least 
 used only?
 
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] Feedback after evaluation

2011-12-09 Thread Michael Hunger
Exactly, looks good.

Thanks James

I looked again into the source code of the GroovyScriptEngine and so far there 
is no public way of removing older scripts. They also use a HashMap and not a 
LinkedHashMap with LRU enabled for storing them. 

One solution I could think of is to have two script engines, one for one-off 
shots while will be thrown away regularly. And another which will contain the 
scripts that have been used at least twice (or x-times) and will stay around 
forever (or probably throw an PermGen OOM on usage).

The only other option would be to duplicate the GroovyScriptEngine 
functionality and handle everything ourselves. I don't think that's a suitable 
way to go.

I like neither. And have no resources right now to update the GremlinPlugin, 
feel free to fork update and issue and pull request, or at least a GitHub issue.

Cheers

Michael

Am 10.12.2011 um 01:26 schrieb espeed:

 Michael -
 
 If I understand you correctly, then this modified Gremlin script and request
 format should solve problem 2:
 
 Gremlin Script:
 https://gist.github.com/1453964
 
 Script Engine REST Request that uses params:
 https://gist.github.com/1453966
 
 - James
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Feedback-after-evaluation-tp3569774p3574507.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] Graph algorithms

2011-12-08 Thread Michael Hunger
I recently saw the apache commons graph library but haven't looked into that.

http://commons.apache.org/sandbox/graph/

Probably just missing a neo4j adaptor.

Cheers,

Michael

Am 08.12.2011 um 13:54 schrieb Prajakta Kalmegh:

 I was searching for community/cluster detection or maybe finding betweenness
 centrality support. Is it there already? Can you please point me to classes
 which I can use in writing my own code for the same.
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Graph-algorithms-tp3563943p3570215.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] Feedback after evaluation

2011-12-08 Thread Michael Hunger
Isn't there something like the background jvm thingy that exists for groovy, 
scala and other languages? A server that the current process connects to, sends 
code over and runs it in the JVM?

What happens if your run the 1400 rpec tests several times?

Perhaps we should ask Charles Nutter for his feedback on these issues?

Which older gems were problematic for you?

Michael

Am 08.12.2011 um 21:30 schrieb Andreas Ronge:

 Hi
 
 Thanks for your great feedback !
 The tooling support for JRuby has worked well for me and would
 probably still use JRuby even if there was a good native MRI neo4j
 wrapper.
 But I have a java background and might not be spoiled with that
 instant feedback loop of doing behaviour driven development using MRI
 Ruby. The JVM never has time to warm up when running the RSpec tests.
 I guess it will always be slower than MRI for running tests (but not
 otherwise). Neo4j.rb has 1400 RSpecs (with very few mocks). JRuby will
 run them in about 1-2 minutes.
 I guess the other problems like having a rails console with write
 access to the database is solvable.
 Thanks again for your feedback and I do agree with your criticism but
 for me it's not that problematic.
 
 Cheers
 Andreas
 
 On Thu, Dec 8, 2011 at 9:48 AM, Dmytrii Nagirniak dna...@gmail.com wrote:
 Hi Guys,
 
 Just want to quickly give some feedback on the neo4j after some evaluation.
 
 Overall, I like the neo4j a lot, but have decided not to use it.
 
 Probably the primary reason is the tooling around Ruby. Don't get me wrong. 
 The neo4j.rb is just amazing. It really is.
 I even contributed couple of Pull Requests (and those were accepted).
 
 The problem is in neo4j Java roots. The only option for me was to use JRuby 
 (will say a word on REST later).
 But unfortunately choosing JRuby is just too troublesome and give much more 
 headache comparing to normal C/MRI Ruby.
 
 Everything is so much harder (even speed is x times slower).
 
 On normal (MRI 1.9.3) Ruby I run all the specs immediately, after saving a 
 file. Immediate feedback.
 With JRuby I'd have to wait for almost half a minute. TDD is gone. Not good 
 enough. But this is just the first issues that I faced.
 
 A lot of other libraries just don't work with.
 There are always small walls on my way that I have to break through, that 
 would never happen with normal Ruby.
 It just gives me a lot of pain.
 
 Unfortunately I couldn't see a lot of value in the REST API either.
 The core operations that are taken for granted with native bindings 
 (traversals using poor Ruby constructs) would require to execute HTTP 
 request (that's what SELECT N+1 in SQL world is).
 Or otherwise I would have to wrap all the logic in the traversal queries. It 
 would significantly overcomplicate the system with HTTP handling logic.
 
 Also there are no decent HTTP restful clients. The only one is neography - 
 that works pretty well, but doesn't give me any abstraction similar to 
 neo4j.rb.
 There is also neology. I declare it dead, I couldn't even run tests because 
 a dependent gem was removed from the author's own github repository.
 So I even had no way to fix any issues there.
 
 Last one - architect4r - good idea behind. But the abstractions are leaky. 
 You can't make system more or less performant without resorting to HTTP.
 I also did minor contribution to it (accepted PR). But since then the author 
 never replied to my tweets, neither he replied to emails.
 Maybe he's just sick or something else, but that's what we have.
 And there were failing specs all over the place.
 
 So I decided to write another REST library 
 (http:://github.com/dnagir/morpheus), but then gave up realising that you 
 just cannot have a proper abstraction over HTTP.
 (I'll probably kill off that repo).
 
 
 So all in all, to summarise: I am giving up on neo4j because it forces me 
 into Java world to leverage its full power.
 I could have agreed on that if I would be a Java dev. But there is nothing 
 in this world that can convince me to choose Java instead of Ruby (maybe 
 other langs in the future).
 
 But what DO have to mention is the dedication of people around neo4j. 
 Everybody tried their best to help.
 And that feels like everybody within Neo Technologies has common vision and 
 is really passionate and keen to help.
 I can't remember any other company that would be so dedicated.
 
 I would really love to use neo4j, but unfortunately I can't do that until it 
 will be available as native binding for C Ruby.
 
 And as a lost note, I want to say THANKS to the neo4j community for the 
 great and amazing support you all guys give.
 
 Cheers,
 Dmytrii
 http://www.ApproachE.com
 
 
 
 
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please 
 register and consider posting at 
 https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
 

Re: [Neo4j] Cypher 3 Trees

2011-12-07 Thread Michael Hunger
I would love to see consideration of branch ordering.

Predicate support for trees like we now have for paths.

And returning trees and subgraphs as cypher results.

Can we generalize this discussion to connected subgraphs or is this too early ?

Michael

Am 07.12.2011 um 16:14 schrieb Peter Neubauer:

 Mmh,
 I would like to see that I can specify the stem of the tree as a
 path and then get leaf nodes out from that, something like
 
 START root = node(0)
 MATCH stem=root-(dir?*), stem-[:LEAF]-leaf
 WHERE all(x in nodes(stem)
 WHERE x.importance  30)
 RETURN leaf, stem
 
 Does that make sense?
 
 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
 
 brew install neo4j  neo4j start
 heroku addons:add neo4j
 
 
 
 On Wed, Dec 7, 2011 at 2:53 PM, Andres Taylor
 andres.tay...@neotechnology.com wrote:
 A subset of the graphs are trees, and they have a few problems that are
 specific for them. I'm right now planning what needs to be added to Cypher
 to make it play nice with your tree structures.
 
 I'd love to know if you have hierarchical data, and what queries you do and
 would like to do. Doesn't matter if you use Cypher or not.
 
 Thanks!
 
 Andrés
 ___
 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] Cypher 3 Trees

2011-12-07 Thread Michael Hunger
E.g. a timeline tree with root - centuries - years -  months - days - hours

I want to traverse the tree with cypher in the order of the entries, e.g. to 
extract data in a ordered fashion.

Am 07.12.2011 um 17:05 schrieb Andres Taylor:

 On Wed, Dec 7, 2011 at 4:25 PM, Michael Hunger 
 michael.hun...@neotechnology.com wrote:
 
 I would love to see consideration of branch ordering.
 
 
 What do you mean? An example would be helpful.
 
 
 Predicate support for trees like we now have for paths.
 
 
 Didn't think in these terms. I like it. Do you have any concrete predicates
 in mind?
 
Filter trees by conditions that all/some/no nodes/rels (or all leaves or 
non-leaves) have to fulfill.

 
 And returning trees and subgraphs as cypher results.
 
 Can we generalize this discussion to connected subgraphs or is this too
 early ?
 
 
 I'd love to fork this into a different thread and hear more about your
 thinking here. Would you do the honors?
 
 Andrés
 ___
 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] I need help with this cypher query

2011-12-07 Thread Michael Hunger
Hey André,

you already almost did it, just copying your parts together

start shop=node(123), me=node(321)
match shop-[:sell]-item-[:like]-user,item-[r1?:like]-me
where r1 is null
return item

the missing part was the optional relationship for r1, which allows it to be 
null and you check for those results, where no relationship between me and item 
exists.

HTH

Michael

Am 07.12.2011 um 23:28 schrieb andremetzen:

 I'm trying to create a cypher query. 
 
 I have a shop=node(123) and me=node(321) start nodes. 
 
 I want all items that shop-[:sell]-item-[:like]-user but does not exist
 any r1 me-[r1:like]-item. 
 
 It's that possible with cypher?
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/I-need-help-with-this-cypher-query-tp3568845p3568845.html
 Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
 ___
 NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
 and consider posting at https://groups.google.com/forum/#!forum/neo4j
 
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
NOTICE: THIS MAILING LIST IS BEING SWITCHED TO GOOGLE GROUPS, please register 
and consider posting at https://groups.google.com/forum/#!forum/neo4j

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


Re: [Neo4j] [Neo4j-User] Re: org.neo4j.graphdb.TransactionFailureException: Could not create data source lucene[lucene]

2011-12-06 Thread Michael Hunger
No please _remove_ neo4j-index-1.2-1.2.M06.jar this is an old library, from 
neo4j 1.2.

you just need neo4j-lucene-index-1.6-SNAPSHOT.jar and lucene-corejar

Michael

Am 06.12.2011 um 08:42 schrieb ajinkyar:

 I already have  neo4j-lucene-index-1.6-SNAPSHOT.jar in my classpath. I want
 to use LuceneIndexService which is why I am including
 neo4j-index-1.2-1.2.M06.jar Is there any better way to do this ?
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/org-neo4j-graphdb-TransactionFailureException-Could-not-create-data-source-lucene-lucene-tp3560554p3563695.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] [Neo4j-User] Re: org.neo4j.graphdb.TransactionFailureException: Could not create data source lucene[lucene]

2011-12-06 Thread Michael Hunger
You don't need LuceneIndexService, where did you find the documentation that 
said to use the old index service? We would like to update that.

just 

IndexNode myIndex = graphDb.index().forNodes(indexName);
index.add(node, key, value);
index.get(key,value);
index.query(query);

etc.

see: http://docs.neo4j.org/chunked/milestone/indexing.html

Cheers,

Michael

Am 06.12.2011 um 09:50 schrieb ajinkyar:

 In that case I cannot use LuceneIndexService ... can you please suggest me a
 way so that I can use LuceneIndexService ?
 
 With neo4j-lucene-index-1.6-SNAPSHOT.jar and lucene-core-3.1.0.jar I am not
 able to use LuceneIndexService ..
 
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/org-neo4j-graphdb-TransactionFailureException-Could-not-create-data-source-lucene-lucene-tp3560554p3563787.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] There's already an HA cluster managed by this ZooKeeper cluster

2011-12-06 Thread Michael Hunger
Answer from Mahesh (not getting through nabble):

Hi, 

The issue is with any server that is a part of the cluster. 

It is reproducible at will. 
The method we were following was - 
1) start all three co-ordinators 
2) start all three servers 
3) shut down one server 
4) start the same server again - it fails 

You can take a look at all the three messages.log files here. The file called 
slave2_messages_failing.log is the server that fails to start. 

The other two instances' messages.log files are also present in the same 
location. 


I tried the scenario outlined - 
- Create the cluster from scratch 
- Restart one cluster member 
- It will fail as you have described 
- Wipe that member's database, start it 
- It will successfully join the cluster, as you have described. 
- What happens if you restart it again? 

Even in the above case, the server fails to start. 

The issue can be reproduced on any machine - not necessarily a slave or a 
master. 

Mahesh
Am 05.12.2011 um 15:52 schrieb Chris Gioran:

 Hi,
 
 Two questions, two requests:
 
 1) Does this happen only on one machine or any member of the cluster?
 Is it reproducible at will?
 1) Could you please provide the messages.log for the other two machines as 
 well?
 2) Can you please tell me the result of this scenario:
- Create the cluster from scratch
- Restart one cluster member
  - It will fail as you have described
- Wipe that member's database, start it
  - It will successfully join the cluster, as you have described.
- What happens if you restart it again?
 
 thank you,
 CG
 
 On Mon, Dec 5, 2011 at 2:26 PM, anirudha anir...@thoughtworks.com wrote:
 Link for the messages.log file : https://gist.github.com/1433340
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/There-s-already-an-HA-cluster-managed-by-this-ZooKeeper-cluster-tp3554731p3561268.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


Re: [Neo4j] Clear database over REST

2011-12-06 Thread Michael Hunger
I wrote a plugin for that.

See here:

You can just download the jar, put it in your plugins folder and add it to your 
config.
https://github.com/jexp/neo4j-clean-remote-db-addon
https://github.com/jexp/neo4j-clean-remote-db-addon/downloads

Am 07.12.2011 um 00:11 schrieb Dmytrii Nagirniak:

 Hi,
 
 I wonder what is the easiest and fastest way to clear the database over the 
 REST API.
 
 The purpose is to use it during testing and this needs to be as fast as 
 possible.
 The data volume is not expected to be large, so maybe simple retrieval of all 
 relationships, nodes and then batch-deleting those would be sufficient.
 
 But the question is how do I get all nodes (not necessarily interconnected or 
 attached to ref-node) and relationships?
 
 Cheers,
 Dima
 http://www.ApproachE.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] Clear database over REST

2011-12-06 Thread Michael Hunger
Without shutting down the server?

Only manually deleting the nodes, rels and indexes, 
but then all your nodes have to be indexed (index-lookup) or connected 
(travesal) - to simulate getAllNodes().
And then you can batch-delete them.

You would also want to get all indexes and delete them too.
Am not sure about deleting the auto-indexes.

Should work as well but much slower. The plugin is from the time before the 
batch-API.

The extension also does some hard-core action if your db contains more than 10k 
elements. It just removes the disk-files and reinstates a new graphdb :)

Michael

Am 07.12.2011 um 00:29 schrieb Dmytrii Nagirniak:

 Thanks Michael.
 
 That's definitely the best way to go.
 
 But I wonder if there is a way to do it without plugins.
 
 
 On 07/12/2011, at 10:22 AM, Michael Hunger wrote:
 
 I wrote a plugin for that.
 
 See here:
 
 You can just download the jar, put it in your plugins folder and add it to 
 your config.
 https://github.com/jexp/neo4j-clean-remote-db-addon
 https://github.com/jexp/neo4j-clean-remote-db-addon/downloads
 
 Am 07.12.2011 um 00:11 schrieb Dmytrii Nagirniak:
 
 Hi,
 
 I wonder what is the easiest and fastest way to clear the database over the 
 REST API.
 
 The purpose is to use it during testing and this needs to be as fast as 
 possible.
 The data volume is not expected to be large, so maybe simple retrieval of 
 all relationships, nodes and then batch-deleting those would be sufficient.
 
 But the question is how do I get all nodes (not necessarily interconnected 
 or attached to ref-node) and relationships?
 
 Cheers,
 Dima
 http://www.ApproachE.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
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Clear database over REST

2011-12-06 Thread Michael Hunger
 
 You would also want to get all indexes and delete them too.
 Don't indexes retire when a related node/relationship is gone?

Yes they have read-repair, but some things will hang around and if you for 
instance want to test
e.g. index creation or create an index with the same name but different config 
you might end up running into errors.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Clear database over REST

2011-12-06 Thread Michael Hunger
And if you follow the code, it does the hard-core action if the limit is 
reached.

if ((Long)result.get(nodes)=MAX_NODES_TO_DELETE) {
result.putAll(cleanDbDirectory(database));
}

Michael

Am 07.12.2011 um 00:38 schrieb Krzysztof Raczyński:

 Hello Michael, I glanced through plugin's source code, and spank me if
 i'm wrong, but is the plugging limited to removing only 1k nodes at a
 time?
 
 https://github.com/jexp/neo4j-clean-remote-db-addon/blob/master/src/main/java/org/neo4j/server/extension/test/delete/DeleteDatabaseResource.java#L58
 
 calls
 
 https://github.com/jexp/neo4j-clean-remote-db-addon/blob/master/src/main/java/org/neo4j/server/extension/test/delete/Neo4jDatabaseCleaner.java#L32
 
 With a 1k limit. Maybe it's just a type, and you intended to use the
 parameter-less version of the function?
 
 cheers and thanks for answers
 ___
 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] Anyone try out the PageRank function on Gremlin?

2011-12-05 Thread Michael Hunger
Has anyone looked at the new? apache commons graph library?

Michael

Am 05.12.2011 um 16:38 schrieb Marko Rodriguez:

 Hi,
 
 Anyone try out the PageRank function on Gremlin?
 
 https://github.com/tinkerpop/gremlin/wiki/Working-with-JUNG-Algorithms/0506c193f30abe0bc18d40d7a08c9257d9311b13
 
 How does it perform with just under 100k nodes on a sparse graph (3000
 relationship max, average of 100)?
 
 I've been doing my pagerank via the power method in rb-gsl and while it's
 fine for around 10k items,  it's sucking all the memory on my server when
 trying to do 92k items.
 
 Blueprints ( https://github.com/tinkerpop/blueprints/wiki/JUNG-Ouplementation 
 ) implements the JUNG graph interface and thus, makes any Blueprints-enabled 
 graph database into a JUNG graph. Unfortunately, JUNG was engineered from the 
 perspective of in-memory use. As such, you will be running into memory issues 
 on very large graphs. For example, if you have a 1million+ vertex graph and 
 you are running PageRank on it, then your eigenvector vector is 1million+ 
 entries. JUNG isn't serializing this vector to disk for you---its doing it 
 all in memory. And if you don't have the memory to support a 1million+ vector 
 (i.e. MapVertex,Double), then, well 
 
 So, in short, be wary of doing memory intensive algorithms with JUNG (i.e. 
 understand the intermediate data structures generated from the various 
 supported graph algorithms). For non-memory intensive algorithms like 
 shortest path, it should meet your needs. Into the future, TinkerPop will be 
 filling out Furnace (http://furnace.tinkerpop.com) and this package will 
 provide memory conscious implementations of classic and non-classical graph 
 algorithms.
 
 HTH,
 Marko.
 
 http://markorodriguez.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] What is this query in JavaScript (REST)?

2011-12-05 Thread Michael Hunger
You can execute cypher remotely on the server, which is preferred the way.

http://docs.neo4j.org/chunked/milestone/cypher-plugin.html

As of 1.6.M02 there will also be an endpoint in the core-rest-api:

Michael


Am 06.12.2011 um 02:51 schrieb Dmytrii Nagirniak:

 Hi,
 
 How would I rewrite this Cypher query with JavaScript (so it can be sent to 
 the traversal API)?
 
 START s=node(123) MATCH s-[:users]-[:current]-u WHERE u.email = 'abc' 
 RETURN u
 
 Cheers,
 Dmytrii.
 http://www.ApproachE.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] Relationship indexes

2011-12-04 Thread Michael Hunger
Ok, thanks for pointing that out, I was not aware that it was missing.

Will add the implementation.

Michael

Am 04.12.2011 um 16:57 schrieb Frank:

 Peter:
 
 The function I'm calling isn't implemented. I found it in the source code:
 
 public class RestRelationshipIndex extends RestIndexRelationship
 implements RelationshipIndex {
public RestRelationshipIndex( RestRequest restRequest, String
 indexName, RestAPI restApi ) {
super( restRequest, indexName, restApi );
}
 
public ClassRelationship getEntityType() {
return Relationship.class;
}
 
public org.neo4j.graphdb.index.IndexHitsRelationship get( String s,
 Object o, Node node, Node node1 ) {
throw new UnsupportedOperationException();
}
 
public org.neo4j.graphdb.index.IndexHitsRelationship query( String s,
 Object o, Node node, Node node1 ) {
throw new UnsupportedOperationException();
}
 
public org.neo4j.graphdb.index.IndexHitsRelationship query( Object o,
 Node node, Node node1 ) {
throw new UnsupportedOperationException();
}
 
@Override
public boolean isWriteable() {
return true;
}
 }
 
 On Sun, Dec 4, 2011 at 9:46 AM, Peter Neubauer [via Neo4j Community
 Discussions] ml-node+s438527n3559286...@n3.nabble.com wrote:
 
 Frank,
 Do you have a minimal test case reproducing this?
 
 /peter
 
 Sent from my phone, please excuse typos and autocorrection.
 On Dec 2, 2011 9:12 PM, Frank [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=3559286i=0
 wrote:
 
 Thanks for the reply.
 
 I *think* that what I need is to do is this:
 
 Relationship relationship = relationshipIndex.get(signature,
 signature,
 lastNode, null).getSingle();
 
 If I understand the documentation correctly, this should return only the
 relationships attached to the node lastNode that have the value I'm
 asking for.
 
 Unfortunately, my attempt to use this function results in the following
 exception:
 
 java.lang.UnsupportedOperationException
   at
 
 org.neo4j.rest.graphdb.index.RestRelationshipIndex.get(RestRelationshipIndex.java:42)
 
 
 I'm kind of stuck at this point. Any ideas?
 
 Frank
 
 On Dec 2, 2011, at 1:59 PM, Peter Neubauer [via Neo4j Community
 Discussions] wrote:
 
 Frank,
 Either you could put just some of the rels into the index, or maybe
 have
 an
 additional property in the index for the direction?
 
 /peter
 
 Sent from my phone, please excuse typos and autocorrection.
 On Dec 2, 2011 8:28 PM, Frank [hidden email] wrote:
 
 I'm having some trouble understanding relationship indexes.
 
 I plan to have nodes with many (hundreds, sometimes thousands) of
 relationships to other nodes.
 
 Give node N, I want to be able to quickly locate one of those
 relationships
 given a key. I want to consider only the outgoing relationships of
 that
 node, not all nodes.
 
 Can this be accomplished? The problem I'm seeing is that when I try
 to
 look
 up a relationship from a RelationshipIndex, I don't see how to limit
 that
 lookup to just the outgoing relationships of one node.
 
 --
 View this message in context:
 
 
 http://neo4j-community-discussions.438527.n3.nabble.com/Relationship-indexes-tp3555465p3555465.html
 Sent from the Neo4j Community Discussions mailing list archive at
 Nabble.com.
 ___
 Neo4j mailing list
 [hidden email]
 https://lists.neo4j.org/mailman/listinfo/user
 
 ___
 Neo4j mailing list
 [hidden email]
 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/Relationship-indexes-tp3555465p323.html
 To unsubscribe from Relationship indexes, click here.
 NAML
 
 
 
 --
 View this message in context:
 
 http://neo4j-community-discussions.438527.n3.nabble.com/Relationship-indexes-tp3555465p347.html
 
 Sent from the Neo4j Community Discussions mailing list archive at
 Nabble.com.
 ___
 Neo4j mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=3559286i=1
 https://lists.neo4j.org/mailman/listinfo/user
 
 ___
 Neo4j mailing list
 [hidden email] http://user/SendEmail.jtp?type=nodenode=3559286i=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/Relationship-indexes-tp3555465p3559286.html
 To unsubscribe from Relationship indexes, click 
 herehttp://neo4j-community-discussions.438527.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3555465code=ZnJhbmtAc3R1ZHlibHVlLmNvbXwzNTU1NDY1fDE1MDQ4NTI2NjA=
 .
 

Re: [Neo4j] wiev filtered results in data browser

2011-12-03 Thread Michael Hunger
 node:index:Caller:Number:*

Michael

Am 04.12.2011 um 04:04 schrieb snorlaks:

 Hi,
 
 Ive got Caller index (from Your stackoverflow message:
 http://stackoverflow.com/questions/7794972/neo4j-huge-graph-and-solution)
 and I wrote search query like:
 
 node:index:Caller:Number:*
 
 But I have no results :(
 
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/wiev-filtered-results-in-data-browser-tp3558419p3558428.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] Neo4j Terracotta ?

2011-12-03 Thread Michael Hunger
Did anyone actually try that? It would be interesting.

If so or if you have any comments on this, please help him:
http://stackoverflow.com/questions/5997317/integrating-neo4j-and-terracotta

I listened to a podcast a while ago that was describing using terracotta to 
distribute jdbc access of a database effectively sharing all jdbc-driver caches 
across the cluster minimizing the # of hits to the database by 90%.

Thanks

Michael



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


Re: [Neo4j] wiev filtered results in data browser

2011-12-03 Thread Michael Hunger
You can find the answers to most of your questions in the neo4j manual:

http://docs.neo4j.org/chunked/milestone/indexing-search.html

Cheers

Michael

Am 04.12.2011 um 04:47 schrieb snorlaks:

 Ok,
 Thats perferct.
 
 BTW. Where can I find in documentation information about this topic (index
 queries) so that I wont ask such questions on forum.
 
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/wiev-filtered-results-in-data-browser-tp3558419p3558472.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] Standalone server and transactions

2011-12-02 Thread Michael Hunger
That's why we've enable the
- ruby-extensions for the server.
- and want to provide the same functionality for other dynamic languages

it is not about duplicating functionality but about moving persistence related 
code closer to the db.

Michael

Am 02.12.2011 um 09:43 schrieb Dmytrii Nagirniak:

 Good point. Yes, that certainly is an alternative.
 
 But unfortunately in practice I hardly can imagine .NET, Nodejs, MRI Ruby
 (non Java basically) guys to start duplicating the logic for the plugin.
 Not even taking into account additional complexity, including unit testing.
 
 Similar thing ships with SQL Server. But it was used only by .NET people
 and extremely rarely.
 On Dec 2, 2011 6:57 PM, Michael Hunger michael.hun...@neotechnology.com
 wrote:
 
 No, the alternative there is to provide a server-side extension that
 encapsulates your business logic as an endpoint running inside of a tx.
 
 Cheers
 
 Michael
 
 Am 02.12.2011 um 08:30 schrieb Dmytrii Nagirniak:
 
 
 On 02/12/2011, at 4:48 PM, Jim Webber wrote:
 
 1. Neo4j works as a standalone (or clustered) server which is
 accessible through the REST API.
 
 That's the point. There is not standalone version with native bindings.
 You either run embedded and lock the whole database to the particular
 app, or you go with REST that doesn't support transactions (batch !=
 transaction)...
 
 2. Neo4j is ACID transactional with each HTTP request to the server
 being internally scoped in a single transaction.
 Unfortunately it is not always enough, even when using batch API.
 
 Here is the use-case:
 1. Query for a nodes/rels.
 2. Run some custom logic on the client.
 3. Update nodes/rels appropriately.
 
 This is the most common way of using databases. And currently it is not
 possible to wrap it in a transaction.
 
 So the only alternative in this case is to use native binding, which may
 not be available to all. And means we are back at point 1.
 
 Do you see what I mean here?
 It's a trade-off: ACID vs DB with multiple clients.
 
 
 A way of doing transactions over REST would be nice. But it will be
 extremely hard to implement due to the stateless nature of HTTP.
 I can see something like this in API:
 
 POST /transaction?timeout=2
 # Returns the ID of the transaction for the future
 
 # then use the normal API...
 
 
 PUT /transactions/1234/commit
 # or
 PUT /transactions/1234/rollback
 # or
 DESTROY /transactions/1234
 # or automatically rollback after 2 secs
 
 
 But I am not sure this can work reliably and performant enough with HTTP.
 
 Cheers.
 
 
 
 ___
 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
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] WADL specification is the complete reference for all HTTP interactions with Neo4j?

2011-12-02 Thread Michael Hunger
The WADL is generated by Jersey which uses the metadata that it generates from 
the annotated REST-Endpoints.

So it is always up to date: http://localhost:7474/db/data/application.wadl

The Neo4j REST API is designed with discoverability in mind, so that you can 
start with a GET / and from there discover URIs to do other stuff. Examples 
below uses URIs for examples; they are subject to change in the future, so for 
future-proofness discover URIs where possible, instead of relying on current 
layout. The default representation is json, both for responses and for data 
sent with POST/PUT requests.
Below follows a listing of ways to interact with the REST API. You can also see 
a (at runtime) generated description of the API be pointing your browser to the 
(exact URI may vary)http://localhost:7474/db/data/application.wadl
To interact with the JSON interface you must explicitly set request header 
Accept:application/json for those requests that responds with data. You should 
also set header Content-Type:application/json if your request sends data, for 
example when you're creating a relationship.
Am 02.12.2011 um 11:49 schrieb Peter Neubauer:

 Johnny,
 at which URI si the WADL hosted? Would like to look at the code, or
 you could dig into the code yourself if you don't want to wait.
 
 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
 
 brew install neo4j  neo4j start
 heroku addons:add neo4j
 
 
 
 On Thu, Dec 1, 2011 at 1:28 AM, yobi johnny@yobistore.com wrote:
 I have noticed that you provide a runtime generated WADL specification for
 the HTTP API.
 
 I'm going to create a WADL to Node.js SDK converter so I don't have to
 create the functionality and change things manually each time you have a new
 release with changes to the HTTP API.
 a
 But before I do that I wanna be sure that this WADL specification is always
 an _up to date_ spec for _all_ HTTP interactions.
 
 Could someone confirm this?
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/WADL-specification-is-the-complete-reference-for-all-HTTP-interactions-with-Neo4j-tp3550226p3550226.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


Re: [Neo4j] possibility to merge some neo4j databases?

2011-12-02 Thread Michael Hunger
Sure the limitations apply, but as only the target database would be corrupted 
and none of the ones
being used for the import that should be ok.

That is actually like a nice lab-day project.

I'll add it to the list.

Michael

Am 29.11.2011 um 15:18 schrieb Craig Taverner:

 There are two approaches I can think of:
 - use a better index for mapping ids. Lucent is too slow. Memory hashtables
 are memory bound.Peter has been investigating alternative dbs like bdb. I
 tried, but did not finish a hashmap of cached arrays, and Chris wrote his
 big data import project on github, which is a hashmap of cached hashmaps.
 Many promising solutions, but none yet complete. All Target the general
 case of id mapping.
 - for this specific case, merging small databases, I had an idea a couple
 of years ago which I still think will work. Bulk appending entire
 databases, by offsetting all internal ids by the current max id. I remember
 the reason Johan did not like this idea was that it suffered from the same
 flaws as the batch inserter, locking the entire db, no rollback and risk of
 entire db corruption. For people happy with the batch inserter, perhaps
 this is still an option, but unlikely to get prioritized by the neo team
 because if the corruption risks. It would, however, perform spectacularly
 well since the id map is a trivial function.
 
 Personally I hope someone completes Chris persistent hashmap or a similar
 solution. Id maps are a recurring theme and would be very valuable.
 On Nov 29, 2011 12:07 PM, osallou olivier.sal...@gmail.com wrote:
 
 Hi,
 I need to batch insert millions of data in neo4j.
 It is quite difficult to keep all in a Map to get node ids, so it needs
 frequent lookups in index to get some node ids for relationships, and
 result is quite low.
 
 Is there any way to build several neo4j databases (independantly) then
 to merge them? (I could build many small db in parallel)
 
 Thanks
 
 Olivier
 
 --
 View this message in context:
 http://neo4j-community-discussions.438527.n3.nabble.com/possibility-to-merge-some-neo4j-databases-tp3544694p3544694.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


Re: [Neo4j] Standalone server and transactions

2011-12-02 Thread Michael Hunger
What should be improved.

You can also print the page as pdf and annotate what should be better / 
different.

Yes packaged as gem and published to the server with a Gemfile.

Thanks a lot

Michael

Am 02.12.2011 um 13:36 schrieb Dmytrii Nagirniak:

 I may be missing something, but it can't see exactly how to link up your code 
 with the server.
 Should the extension be packaged as a gem and published publicly?
 
 That Wiki entry is a little bit poorly written IMO. Sorry for saying that :-( 
 
 
 On 02/12/2011, at 8:42 PM, Michael Hunger wrote:
 
 http://wiki.neo4j.org/content/Ruby-script_extension
 
 
 Am 02.12.2011 um 10:32 schrieb Dmytrii Nagirniak:
 
 
 That's why we've enable the
 - ruby-extensions for the server.
 
 Haven't seen anything about it. Could you please give some more info on 
 that (links maybe)?
 
 it is not about duplicating functionality but about moving persistence 
 related code closer to the db.
 
 It is a long topic on itself: Where the business logic belongs to - the 
 server or the client.
 
 But the point is that far the most common use-case is to write the business 
 logic on the client, not on the server.
 
 The business logic on the server has already failed multiple times in the 
 history (think of stored procedures on the RDBMS).
 
 Server side logic works well when the DB is part of the app (e.g. embedded) 
 and server/client code is often indistinguishable.
 
 
 OTOH
 it is about keeping the database primitives at the database level and 
 exposing domain level data and operations.
 (which makes your protocol smaller, faster, less diluted, better 
 understandable and focused).
 
 After all with NOSQL you have much more often that you move code to the data 
 (think map-reduce - no one complains there). 
 
 
 
 
 
 Am 02.12.2011 um 09:43 schrieb Dmytrii Nagirniak:
 
 Good point. Yes, that certainly is an alternative.
 
 But unfortunately in practice I hardly can imagine .NET, Nodejs, MRI Ruby
 (non Java basically) guys to start duplicating the logic for the plugin.
 Not even taking into account additional complexity, including unit 
 testing.
 
 Similar thing ships with SQL Server. But it was used only by .NET people
 and extremely rarely.
 On Dec 2, 2011 6:57 PM, Michael Hunger 
 michael.hun...@neotechnology.com
 wrote:
 
 No, the alternative there is to provide a server-side extension that
 encapsulates your business logic as an endpoint running inside of a tx.
 
 Cheers
 
 Michael
 
 Am 02.12.2011 um 08:30 schrieb Dmytrii Nagirniak:
 
 
 On 02/12/2011, at 4:48 PM, Jim Webber wrote:
 
 1. Neo4j works as a standalone (or clustered) server which is
 accessible through the REST API.
 
 That's the point. There is not standalone version with native bindings.
 You either run embedded and lock the whole database to the particular
 app, or you go with REST that doesn't support transactions (batch !=
 transaction)...
 
 2. Neo4j is ACID transactional with each HTTP request to the server
 being internally scoped in a single transaction.
 Unfortunately it is not always enough, even when using batch API.
 
 Here is the use-case:
 1. Query for a nodes/rels.
 2. Run some custom logic on the client.
 3. Update nodes/rels appropriately.
 
 This is the most common way of using databases. And currently it is not
 possible to wrap it in a transaction.
 
 So the only alternative in this case is to use native binding, which may
 not be available to all. And means we are back at point 1.
 
 Do you see what I mean here?
 It's a trade-off: ACID vs DB with multiple clients.
 
 
 A way of doing transactions over REST would be nice. But it will be
 extremely hard to implement due to the stateless nature of HTTP.
 I can see something like this in API:
 
 POST /transaction?timeout=2
 # Returns the ID of the transaction for the future
 
 # then use the normal API...
 
 
 PUT /transactions/1234/commit
 # or
 PUT /transactions/1234/rollback
 # or
 DESTROY /transactions/1234
 # or automatically rollback after 2 secs
 
 
 But I am not sure this can work reliably and performant enough with 
 HTTP.
 
 Cheers.
 
 
 
 ___
 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
 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] SO Question for Pythonistas: ORM for Neo4j ?

2011-12-02 Thread Michael Hunger
Please help answering him,

thanks a lot.

http://stackoverflow.com/questions/8356626/orm-with-graph-databases-like-neo4j-in-python

i wonder wether there is a solution (or a need for) an ORM with Graph-Database 
(f.e. Neo4j). I'm tracking relationships (A is related to B which is related to 
A via C etc., thus constructing a large graph) of entities (including 
additional attributes for those entities) and need to store them in a DB, and i 
think a graph database would fit this task perfectly.

Now, with sql-like DBs, i use sqlalchemyś ORM to store my objects, especially 
because of the fact that i can retrieve objects from the db and work with them 
in a pythonic style (use their methods etc.).

Is there any object-mapping solution for Neo4j or other Graph-DB, so that i can 
store and retrieve python objects into and from the Graph-DB and work with them 
easily?

Or would you write some functions or adapters like in the python sqlite 
documentation 
(http://docs.python.org/library/sqlite3.html#letting-your-object-adapt-itself) 
to retrieve and store objects?
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] REST API - always batch?

2011-12-01 Thread Michael Hunger
I think especially for atomic create operations that will be solved by a GEOFF 
import plugin in the future.

which allows for updates/insertions of subgraphs.

https://github.com/nigelsmall/py2neo/wiki/GEOFF

Michael

Am 01.12.2011 um 09:03 schrieb Dmytrii Nagirniak:

 Thanks Peter.
 
 I was asking because of the request to support batching in neography:
 https://github.com/maxdemarzi/neography/issues/16
 
 I sounds like the normal API is obsolete then :)
 
 It encourages non-transactional operations. I think the batch-ing should be 
 promoted a little bit more.
 
 Check the availability and place the reservation if something is still 
 available is pretty hard to implement without it.
 Not sure if batching supports conditional operations though. Does it?
 
 Is there anything that would be impossible/slow etc to do with batching?
 I mean, there must be some drawbacks :)
 
 Cheers.
 
 On 01/12/2011, at 6:08 PM, Peter Neubauer wrote:
 
 Dmytri,
 sounds like an interesting plan! I don't think there is anything
 directly that I can see, except a bug,
 https://github.com/neo4j/community/issues/113 with \\ which you
 might watch our for, reported by Josh Adell.
 
 Let us know how it works out!
 
 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
 
 brew install neo4j  neo4j start
 heroku addons:add neo4j
 
 
 
 On Thu, Dec 1, 2011 at 5:53 AM, Dmytrii Nagirniak dna...@gmail.com wrote:
 Hi,
 
 I wonder what the disadvantages would be if every request to the server 
 would always be a batch (even for simple GETs)?
 
 This would make it easier to use the API from the application.
 
 How bad is this idea?
 
 Cheers,
 Dima
 http://www.ApproachE.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
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] CQL find by name

2011-12-01 Thread Michael Hunger
Actually they map to two different calls of the neo4j core API.

The first one is a exact lookup for the value.

The second one takes an arbitrary query string and executes it against an 
index, so it is much more powerful.
(But also dependend on the index-provider)

Main difference is that the query string has to be parsed by the index.
And around parameters, first one is better if you want to have the lookup 
variable fixed.

start node=node:index(key={param})
start node=node:index({param})

Cheers

Michael

Am 01.12.2011 um 03:56 schrieb yobi:

 I have seen both this:
 
 START root=node:node_auto_index(name = 'FileRoot')
 
 and this used:
 
 START root=node:node_auto_index('name: FileRoot')
 
 Isn't the second one more appropriate since the first one could be mixed up
 with an assignment and the second one looks more like a key:value pair. More
 simple to get and you don't have to change syntax style when you are using
 *.
 
 START root=node:node_auto_index('name: FileRoot*')
 
 Correct me if I am missing something.
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/CQL-find-by-name-tp3550446p3550446.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] spring data neo4j Relationships

2011-12-01 Thread Michael Hunger
Martin,

are you using the simple mapping (w/o AJ) or the advanced AspectJ mapping?

I assume the simple mapping:

There are several ways of persisting a RelationshipEntity()

* (template or repository).createRelationshipBetween()
* (template or repository).save(new Role(movie, actor, rolenName));
* node-entity with @Fetch @RelatedToVia SetRole roles=new HashSetRole();

actor = (template or repository).findOne(actorId); // or other loading 
mechanisms
actor.roles.add(new Role(movie, actor, rolenName));
(template or repository).save(actor)

if you are not using the first approach, you have to provide a RelationshipType 
for Role 
* as part of the @RelationshipEntity(type=TYPE) annotation
* or as a @RelationshipType String type; field

We can also have a skype call if you want to clarify things.

HTH,

Michael

Am 01.12.2011 um 12:49 schrieb Martin Junghanns:

 Hey,
 
 after reading the docs and looking at the examples, I give up trying to 
 find a solution for myself. The problem is the following: How are 
 @RelationshipEntity classes persistet? I have the same stucture as in 
 the Movies Example: the classes Actor -- Role -- Movie. When adding a 
 new Role to an Actor and saving the Actor Entity using the 
 ActorRepository, the new edges are not persisted in the database. Do I 
 have to persist the Role Entities manually? If yes, what Repository 
 shall I use for that?
 
 this is part of my Actor class
 
 @GraphId
 private Long id;
 
 // 1:n relation
 @RelatedToVia
 CollectionTMS_Rel OpTmRs;
// 1:1 relation to store the latest link ... this works and the 
 ede is persistet
 private TMS OpTmRs_Latest;
 
 
 this is part of my Role class
 
 @GraphId
 Long id;
 
 @StartNode
 WTUR wturInstance;
 @EndNode
 TMS tmsInstance;
 
 long timestamp;
 
 and finally this is the other end of the edge, my Movie class
 
 @GraphId
 private Long id;
 
 @RelatedTo(type = TMS_REL, direction = INCOMING)
 SetWTUR wturs;
 
 @RelatedToVia(type = TMS_REL, direction = INCOMING)
 IterableTMS_Rel tmsRels;
 
 So, all single edges work perfectly, but the sets don't. Hope someone 
 can help me out with that
 
 
 Greetings, Martin
 ___
 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] Will there ever be a native SDK for Node.js?

2011-12-01 Thread Michael Hunger
Actually that is true with many technologies.

to provide a REST-Endpoint Neo4j-Servers you can use:

* jruby with sinatra/rails
* python
* as you said SDN
* playframework and scala
* clojure (and whatever rest-framework on top)
* or even pure netty based high performance servers
* or other java REST API's on top of the core-API

IMHO more important is the protocol between your frontend and the 
neo4j-rest-endpoints, those should speak domain language and protocol and not 
necessarily nodes and relationships :)

Cheers

Michael

Am 01.12.2011 um 13:34 schrieb Tero Paananen:

 With REST, you have a separate server. Thus multiple applications
 can use. Or you can access it directly through normal web browser
 to fix your data.
 Or even run background jobs against that server. All that is
 not possible with native.
 
 I wouldn't say that. It's not possible using Neo4J APIs
 directly, but with Spring Data for Neo4J and the rest of
 the Spring framework (as an example) it's pretty damn
 easy to provide remote access to a Neo4J data store.
 
   -TPP
 ___
 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] NullPointerException in ExecutingRestRequest

2011-12-01 Thread Michael Hunger
Hi Frank,

this is really weird. Your server is missing the exploratory URL for the 
reference node.
The (Spring)RestGraphDatabaseService uses this URL to get the URL for the 
ReferenceNode.

I don't know why your sever is missing that. 

I just downloaded 1.5 community for unix and started the server, it reports the 
reference_node url as expected:

ynagzet:neo4j-community-1.5 mh$ curl http://localhost:7474/db/data/
{
  relationship_index : http://localhost:7474/db/data/index/relationship;,
  node : http://localhost:7474/db/data/node;,
  relationship_types : http://localhost:7474/db/data/relationship/types;,
  neo4j_version : 1.5,
  batch : http://localhost:7474/db/data/batch;,
  extensions_info : http://localhost:7474/db/data/ext;,
  node_index : http://localhost:7474/db/data/index/node;,
  reference_node : http://localhost:7474/db/data/node/0;,
  extensions : {
CypherPlugin : {
  execute_query : 
http://localhost:7474/db/data/ext/CypherPlugin/graphdb/execute_query;
},
GremlinPlugin : {
  execute_script : 
http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script;
}
  }
}

Am 01.12.2011 um 17:53 schrieb Frank:

 Hi Michael,
 
 My curl result looks like this:
 
 $ curl http://localhost:7474/db/data/ -i
 HTTP/1.1 200 OK
 Content-Length: 680
 Content-Encoding: UTF-8
 Content-Type: application/json
 Access-Control-Allow-Origin: *
 Server: Jetty(6.1.25)
 
 {
  relationship_index : http://localhost:7474/db/data/index/relationship;,
  node : http://localhost:7474/db/data/node;,
  relationship_types : http://localhost:7474/db/data/relationship/types;,
  neo4j_version : 1.5,
  batch : http://localhost:7474/db/data/batch;,
  extensions_info : http://localhost:7474/db/data/ext;,
  node_index : http://localhost:7474/db/data/index/node;,
  extensions : {
CypherPlugin : {
  execute_query : 
 http://localhost:7474/db/data/ext/CypherPlugin/graphdb/execute_query;
},
GremlinPlugin : {
  execute_script : 
 http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script;
}
  }
 }
 
 I installed what I thought was the latest version of the server.
 
 My Maven dependency tree is enourmous because the rest of my application uses 
 a lot of things. I think this is the part you're interested in, though.
 
 [INFO] +- 
 org.springframework.data:spring-data-neo4j:jar:2.0.0.BUILD-SNAPSHOT:compile
 [INFO] |  +- org.springframework:spring-beans:jar:3.0.6.RELEASE:compile
 [INFO] |  +- org.springframework:spring-aspects:jar:3.0.6.RELEASE:compile
 [INFO] |  +- 
 org.springframework.data:spring-data-commons-core:jar:1.2.0.M2:compile
 [INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.6.1:compile
 [INFO] |  +- cglib:cglib:jar:2.2:compile
 [INFO] |  +- org.neo4j:neo4j:jar:1.5:compile
 [INFO] |  |  +- org.neo4j:neo4j-kernel:jar:1.5:compile
 [INFO] |  |  |  \- 
 org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
 [INFO] |  |  +- org.neo4j:neo4j-lucene-index:jar:1.5:compile
 [INFO] |  |  +- org.neo4j:neo4j-graph-algo:jar:1.5:compile
 [INFO] |  |  +- org.neo4j:neo4j-udc:jar:1.5:compile
 [INFO] |  |  +- org.neo4j:neo4j-graph-matching:jar:1.5:compile
 [INFO] |  |  \- org.neo4j:neo4j-jmx:jar:1.5:compile
 [INFO] |  +- org.neo4j:neo4j-cypher-dsl:jar:1.5:compile
 [INFO] |  +- 
 org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile
 [INFO] |  \- javax.validation:validation-api:jar:1.0.0.GA:compile
 [INFO] +- 
 org.springframework.data:spring-data-neo4j-rest:jar:2.0.0.BUILD-SNAPSHOT:compile
 [INFO] |  +- org.neo4j:neo4j-rest-graphdb:jar:1.5:compile
 [INFO] |  |  \- org.neo4j:server-api:jar:1.5:compile
 [INFO] |  | +- javax.ws.rs:jsr311-api:jar:1.1.1:compile
 [INFO] |  | \- commons-configuration:commons-configuration:jar:1.6:compile
 [INFO] |  |\- 
 commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
 [INFO] |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.6.1:compile
 [INFO] |  +- com.sun.jersey:jersey-server:jar:1.4:compile
 [INFO] |  |  \- com.sun.jersey:jersey-core:jar:1.4:compile
 [INFO] |  \- com.sun.jersey:jersey-client:jar:1.4:compile
 
 
 
 On Nov 30, 2011, at 8:37 PM, Michael Hunger [via Neo4j Community Discussions] 
 wrote:
 
 Frank, 
 
 sorry to hear that. 
 
 I just tried it and it works as expected. 
 
final SpringRestGraphDatabase gdb = new 
 SpringRestGraphDatabase(http://localhost:7474/db/data/;); 
final Node node = gdb.getReferenceNode(); 
assertEquals(0,node.getId()); 
 
 What version of the Neo4j-Server are you using? Could you please also show 
 the output of mvn dependency:tree ? 
 
 Thanks a lot 
 
 Michael 
 
 if you execute it via curl, what are the results? 
 
 ynagzet:spring-data-neo4j mh$ curl http://localhost:7474/db/data/ -i 
 HTTP/1.1 200 OK 
 Content-Length: 620 
 Content-Encoding: UTF-8 
 Content-Type: application/json 
 Access-Control-Allow-Origin: * 
 Server: Jetty(6.1.25) 
 
 { 
  relationship_index : http://localhost:7474/db/data/index/relationship;, 
  node : http

Re: [Neo4j] NullPointerException in ExecutingRestRequest

2011-12-01 Thread Michael Hunger
Did you by chance delete the reference node too? (aka. node 0) 

I tried it and it seems to be the reason.

After deleting the reference node it is no longer shown in the graph 
representation.

I will add an appropriate Exception to java-rest-graphdb

Cheers,

Michael

Am 01.12.2011 um 19:20 schrieb Frank:

 Interesting. I did create and delete a few nodes manually via the Web 
 interface right when I first installed the server. Maybe there's some bug 
 related to that. In any case, it seems to be working now that I reinstalled 
 the server with 1.6.
 
 On Dec 1, 2011, at 12:12 PM, Michael Hunger [via Neo4j Community Discussions] 
 wrote:
 
 Hi Frank, 
 
 this is really weird. Your server is missing the exploratory URL for the 
 reference node. 
 The (Spring)RestGraphDatabaseService uses this URL to get the URL for the 
 ReferenceNode. 
 
 I don't know why your sever is missing that. 
 
 I just downloaded 1.5 community for unix and started the server, it reports 
 the reference_node url as expected: 
 
 ynagzet:neo4j-community-1.5 mh$ curl http://localhost:7474/db/data/
 { 
  relationship_index : http://localhost:7474/db/data/index/relationship;, 
  node : http://localhost:7474/db/data/node;, 
  relationship_types : http://localhost:7474/db/data/relationship/types;, 
  neo4j_version : 1.5, 
  batch : http://localhost:7474/db/data/batch;, 
  extensions_info : http://localhost:7474/db/data/ext;, 
  node_index : http://localhost:7474/db/data/index/node;, 
  reference_node : http://localhost:7474/db/data/node/0;, 
  extensions : { 
CypherPlugin : { 
  execute_query : 
 http://localhost:7474/db/data/ext/CypherPlugin/graphdb/execute_query; 
}, 
GremlinPlugin : { 
  execute_script : 
 http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script; 
} 
  } 
 } 
 
 Am 01.12.2011 um 17:53 schrieb Frank: 
 
 Hi Michael, 
 
 My curl result looks like this: 
 
 $ curl http://localhost:7474/db/data/ -i 
 HTTP/1.1 200 OK 
 Content-Length: 680 
 Content-Encoding: UTF-8 
 Content-Type: application/json 
 Access-Control-Allow-Origin: * 
 Server: Jetty(6.1.25) 
 
 { 
 relationship_index : http://localhost:7474/db/data/index/relationship;, 
 node : http://localhost:7474/db/data/node;, 
 relationship_types : http://localhost:7474/db/data/relationship/types;, 
 neo4j_version : 1.5, 
 batch : http://localhost:7474/db/data/batch;, 
 extensions_info : http://localhost:7474/db/data/ext;, 
 node_index : http://localhost:7474/db/data/index/node;, 
 extensions : { 
   CypherPlugin : { 
 execute_query : 
 http://localhost:7474/db/data/ext/CypherPlugin/graphdb/execute_query; 
   }, 
   GremlinPlugin : { 
 execute_script : 
 http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script; 
   } 
 } 
 } 
 
 I installed what I thought was the latest version of the server. 
 
 My Maven dependency tree is enourmous because the rest of my application 
 uses a lot of things. I think this is the part you're interested in, 
 though. 
 
 [INFO] +- 
 org.springframework.data:spring-data-neo4j:jar:2.0.0.BUILD-SNAPSHOT:compile 
 [INFO] |  +- org.springframework:spring-beans:jar:3.0.6.RELEASE:compile 
 [INFO] |  +- org.springframework:spring-aspects:jar:3.0.6.RELEASE:compile 
 [INFO] |  +- 
 org.springframework.data:spring-data-commons-core:jar:1.2.0.M2:compile 
 [INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.6.1:compile 
 [INFO] |  +- cglib:cglib:jar:2.2:compile 
 [INFO] |  +- org.neo4j:neo4j:jar:1.5:compile 
 [INFO] |  |  +- org.neo4j:neo4j-kernel:jar:1.5:compile 
 [INFO] |  |  |  \- 
 org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile 
 [INFO] |  |  +- org.neo4j:neo4j-lucene-index:jar:1.5:compile 
 [INFO] |  |  +- org.neo4j:neo4j-graph-algo:jar:1.5:compile 
 [INFO] |  |  +- org.neo4j:neo4j-udc:jar:1.5:compile 
 [INFO] |  |  +- org.neo4j:neo4j-graph-matching:jar:1.5:compile 
 [INFO] |  |  \- org.neo4j:neo4j-jmx:jar:1.5:compile 
 [INFO] |  +- org.neo4j:neo4j-cypher-dsl:jar:1.5:compile 
 [INFO] |  +- 
 org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final:compile
  
 [INFO] |  \- javax.validation:validation-api:jar:1.0.0.GA:compile 
 [INFO] +- 
 org.springframework.data:spring-data-neo4j-rest:jar:2.0.0.BUILD-SNAPSHOT:compile
  
 [INFO] |  +- org.neo4j:neo4j-rest-graphdb:jar:1.5:compile 
 [INFO] |  |  \- org.neo4j:server-api:jar:1.5:compile 
 [INFO] |  | +- javax.ws.rs:jsr311-api:jar:1.1.1:compile 
 [INFO] |  | \- 
 commons-configuration:commons-configuration:jar:1.6:compile 
 [INFO] |  |\- 
 commons-beanutils:commons-beanutils-core:jar:1.8.0:compile 
 [INFO] |  +- org.codehaus.jackson:jackson-jaxrs:jar:1.6.1:compile 
 [INFO] |  +- com.sun.jersey:jersey-server:jar:1.4:compile 
 [INFO] |  |  \- com.sun.jersey:jersey-core:jar:1.4:compile 
 [INFO] |  \- com.sun.jersey:jersey-client:jar:1.4:compile 
 
 
 
 On Nov 30, 2011, at 8:37 PM, Michael Hunger [via Neo4j Community 
 Discussions] wrote: 
 
 Frank, 
 
 sorry to hear that. 
 
 I just tried it and it works

Re: [Neo4j] py2neo - GEOFF enhancements

2011-12-01 Thread Michael Hunger
Nigel,

is it possible to also do index-lookups in geoff?
and use those as nodes or rels or even as hooks for later on?

I'm also toying with two other ideas:
#1 using indexes as the third primitive besides nodes and rels in geoff just 
with a different delimeter (e.g. | as you already have) 
#2 giving indexes a similar semantics as relationships to category nodes (which 
is the same for in-graph indexes, where the index-name is the category-type and 
indexed key-values are properties on the relationship or relationships)

I'm not really satisfied with the syntaxes I came up with and would like to 
brainstorm that.

|index| -{foo:bar} -(bert)


some ideas for alternative index syntaxes
#add
|index:{foo:bar}|+={foo}
# replace
|index:{foo:bar}|={foo}
# remove
|index:{foo:bar}|-={foo}

#query
|index:{foo:bar}| -[:KNOWS]-(bert)
|index:querystring| -[:KNOWS]-(bert)

Am 01.12.2011 um 01:32 schrieb Nigel Small:

 Peter: I am happy with the current state of the neo4j-geoff code so feel it
 should be stable enough to adopt when you wish to do so. I have also made a
 couple of recent updates to the documentation, most notably the GEOFF.md
 file.
 
 Cheers
 
 Nige
 
 *Nigel Small*
 Phone: +44 7814 638 246
 Blog: http://nigelsmall.name/
 GTalk: ni...@nigelsmall.name
 MSN: nasm...@live.co.uk
 Skype: technige
 Twitter: @technige https://twitter.com/#%21/technige
 LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
 On 29 November 2011 23:33, Michael Hunger
 michael.hun...@neotechnology.comwrote:
 
 #1 Thanks
 #2 You're probably right
 
 #3 You can do the index lookup outside and pass in the IndexHitsNode as
 being and Iterator
 #3 I rather thought of {name} for |people| - {name: {hook}} as a shortcut
 for that
 
 Michael
 
 But #2 and #3 are probably overkill anyway.
 
 Cheers
 
 Michael
 
 Am 29.11.2011 um 23:59 schrieb Nigel Small:
 
 Hi Michael
 
 Probably better to just return the full map and let the client code deal
 with it ? (If it isn't interested it would either just ignore the return
 result or discard it quickly).
 Done. Now works as:
 
 MapString,PropertyContainer entities =
 GEOFFLoader.loadIntoNeo4j(reader,
 db, hooks);
 Node nodeFoo = (Node) entities.get((foo));
 Node nodeBar = (Node) entities.get((bar));
 
 Intention behind longs, is when I get them from an external source then
 they can be used to be look up nodes during import.
 This can be done but not sure it's the right place... I'm cautious about
 using IDs directly as they aren't very portable. Also, it's not intuitive
 whether an ID is for a node or relationship. Would like to get a few
 votes
 on this - I'm happy to be outvoted if the consensus is to do it!
 
 Also can hooks be used for index lookups? (Just asking)
 Are you thinking of something like {People:name=bert}? If so, this is
 quite a distance from where we are currently since every token can only
 refer to a single entity, whereas an index lookup could return multiple
 results.
 
 Nige
 
 *Nigel Small*
 Phone: +44 7814 638 246
 Blog: http://nigelsmall.name/
 GTalk: ni...@nigelsmall.name
 MSN: nasm...@live.co.uk
 Skype: technige
 Twitter: @technige https://twitter.com/#%21/technige
 LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
 On 29 November 2011 22:09, Michael Hunger
 michael.hun...@neotechnology.comwrote:
 
 Hmm good question, that means the namespace keeps everything around
 until
 it is gc'ed ?
 
 Probably better to just return the full map and let the client code deal
 with it ? (If it isn't interested it would either just ignore the return
 result or discard it quickly).
 
 Intention behind longs, is when I get them from an external source then
 they can be used to be look up nodes during import.
 
 Also can hooks be used for index lookups? (Just asking)
 
 Thanks a lot
 
 Michael
 
 Am 29.11.2011 um 22:58 schrieb Nigel Small:
 
 Hi Michael
 
 Doesn't handle iterables (yet) but should be quite easy to add in. What
 purpose did you have behind longs?
 
 I've just committed a few new methods allowing the Neo4jNamespace
 returned
 from a loadIntoNeo4j call to be used to retrieve new entities by name
 (or a
 map of such). The new methods are:
 
 public Node getPreexistingNode(String name)
 public MapString, Node getPreexistingNodes(String... names)
 public Node getNewlyCreatedNode(String name)
 public MapString, Node getNewlyCreatedNodes(String... names)
 public Relationship getPreexistingRelationship(String name)
 public MapString, Relationship getPreexistingRelationships(String...
 names)
 public Relationship getNewlyCreatedRelationship(String name)
 public MapString, Relationship getNewlyCreatedRelationships(String...
 names)
 
 One of the tests in GraphDescriptionTest illustrates simple usage,
 thus:
 
 Neo4jNamespace ns = GEOFFLoader.loadIntoNeo4j(reader, db, hooks);
 Node nodeFoo = ns.getNewlyCreatedNode(foo);
 Node nodeBar = ns.getNewlyCreatedNode(bar);
 
 Hope this helps - I'll have a play with iterables next.
 
 Cheers
 
 Nige
 
 *Nigel Small*
 Phone: +44 7814 638

Re: [Neo4j] py2neo - GEOFF enhancements

2011-12-01 Thread Michael Hunger
Peter and I have been discussing what interchange format we'd like to have for 
applications feeding data into a graph.

And geoff seems to be quite a good choice.

Modifying and accessing indexes (much like in-file-hooks) would be a part of 
that.

So what I imagine is a set of connectors to outside services which are 
producing geoff which is then consumed by a server plugin (e.g. for hosted 
neo4j services on heroku). Much like STDIN and STDOUT between unix command line 
tools.

Having a declarative format that aligns more with cypher is preferable to a 
imperative format like the REST API or Gremlin. 

That's why I would also like to look into aligning the syntax with the cypher 
syntax, actually I'm more fond of the iconographic syntax but there are some 
drawbacks on readability for people.

That's some of the reasoning behind it.

Cheers

Michael

Am 02.12.2011 um 01:49 schrieb Nigel Small:

 Hi Michael
 
 GEOFF was originally conceived as a graph serialisation format and, as
 such, was intended to represent a snapshot of entities at a particular
 point in time instead of, as you are discussing, a programmatic set of
 actions (add, replace, remove, etc). That said, these ideas are still worth
 exploring...
 
 First off, since hooks are the variables of GEOFF, it would seem
 consistent to use those for assigning the return values of index lookups
 and queries. Something like the following could be used to perform an index
 query, assign the result to a hook and use that hook to build a
 relationship:
 
 {foo} := |index| @ {key: value}
 {foo}-[:KNOWS]-(bar)
 
 Actually, since the index query may result in multiple returned entities,
 we might want to limit to the first item returned:
 
 {foo} := |index| @ {key:value}
 {foo.1}-[:KNOWS]-(bar)
 
 Using the other operators for adding, removing and replacing index entries,
 this would make...
 
 # add node bert to index at foo:bar
 |index| @ {foo: bar} += (bert)
 
 # remove node bert from index at foo:bar
 |index| @ {foo: bar} -= (bert)
 
 # replace node with bert in index at foo:bar
 |index| @ {foo: bar} := (bert)
 
 So essentially, we would be looking at at least the following requirements:
 
   1. Allow hooks to hold multiple entities instead of just a single entity
   2. Allow assignment to hooks
   3. Implement an @ operator to allow inline index queries
   4. Implement assignment, addition and removal operators to indexes
 
 These ideas would turn GEOFF into much more of a programming language than
 a notation for serialisation: a big change and one which would potentially
 require another significant rewrite. I'm not against doing this but I'm
 wondering if this is a valuable direction to go in and whether, if we were
 to do this, it would be better to start from first principles instead.
 Would this fill a gap that none of the other current options can?
 Cheers
 
 Nige
 
 *Nigel Small*
 Phone: +44 7814 638 246
 Blog: http://nigelsmall.name/
 GTalk: ni...@nigelsmall.name
 MSN: nasm...@live.co.uk
 Skype: technige
 Twitter: @technige https://twitter.com/#%21/technige
 LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
 On 1 December 2011 21:47, Michael Hunger
 michael.hun...@neotechnology.comwrote:
 
 Nigel,
 
 is it possible to also do index-lookups in geoff?
 and use those as nodes or rels or even as hooks for later on?
 
 I'm also toying with two other ideas:
 #1 using indexes as the third primitive besides nodes and rels in geoff
 just with a different delimeter (e.g. | as you already have)
 #2 giving indexes a similar semantics as relationships to category nodes
 (which is the same for in-graph indexes, where the index-name is the
 category-type and indexed key-values are properties on the relationship or
 relationships)
 
 I'm not really satisfied with the syntaxes I came up with and would like
 to brainstorm that.
 
 |index| -{foo:bar} -(bert)
 
 
 some ideas for alternative index syntaxes
 #add
 |index:{foo:bar}|+={foo}
 # replace
 |index:{foo:bar}|={foo}
 # remove
 |index:{foo:bar}|-={foo}
 
 #query
 |index:{foo:bar}| -[:KNOWS]-(bert)
 |index:querystring| -[:KNOWS]-(bert)
 
 Am 01.12.2011 um 01:32 schrieb Nigel Small:
 
 Peter: I am happy with the current state of the neo4j-geoff code so feel
 it
 should be stable enough to adopt when you wish to do so. I have also
 made a
 couple of recent updates to the documentation, most notably the GEOFF.md
 file.
 
 Cheers
 
 Nige
 
 *Nigel Small*
 Phone: +44 7814 638 246
 Blog: http://nigelsmall.name/
 GTalk: ni...@nigelsmall.name
 MSN: nasm...@live.co.uk
 Skype: technige
 Twitter: @technige https://twitter.com/#%21/technige
 LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
 On 29 November 2011 23:33, Michael Hunger
 michael.hun...@neotechnology.comwrote:
 
 #1 Thanks
 #2 You're probably right
 
 #3 You can do the index lookup outside and pass in the IndexHitsNode
 as
 being and Iterator
 #3 I rather thought of {name} for |people| - {name: {hook}} as a
 shortcut
 for that
 
 Michael
 
 But #2

Re: [Neo4j] Named matched with depth gives error

2011-12-01 Thread Michael Hunger
download the 1.6 SNAPSHOT from neo4j.org/downloads

mobile mail please excuse brevity and typos

Am 02.12.2011 um 01:27 schrieb dnagir dna...@gmail.com:

 I fixed this 
 yesterdayhttps://github.com/neo4j/community/commit/37c2867871c7d953c2021177d0b72cd8ba825be0.
  
 
 Thanks a lot for that.
 How can I get the build that includes the fix? (Sorry for the question, but 
 just starting with noe4j).
 
 Sorry you ran into it... 
 NP.
 
 Cheers.
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Named-matched-with-depth-gives-error-tp3548195p3553337.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] Standalone server and transactions

2011-12-01 Thread Michael Hunger

Am 01.12.2011 um 23:03 schrieb zolv:

 Hi
 
 I have read as much I was able to read about Neo4j with the topic I wrote
 below.
 
 My imaginations of DB server (doesn't matter RDBMS or NoSQL) is that the
 crucial things for DB server is interesting from development point of view
 are (musts!):
 1. DB server must be able to work as standalone server

Neo4j comes as stand-alone server accessible via an REST API. 
You can add other API's on top of the embedded Graph Database yourself by using 
Plugins / Extensions.

 2. DB server must provide transactions.
Neo4j is one of the few NOSQL solutions that offers ACID capabilities and 
transactions.

 Can anybody guide me through these 2 things in Neo4j world?
 
 Ad 1.
 There are lots of examples to work with Neo4j as embedded. Actually these
 examples works, I already made some application that was operating quite
 good (embedded Neo4j was started/stopped by Singleton EJB). The only problem
 is that I can use DB via application (x)or Neoclipse. Never both at the same
 time. This is very annoying to stop the app and connect via Neoclipse and
 vice versa.

Neoclipse can access a neo4j-database in readonly mode which is possible at the 
same time.

 
 Ad2. So first thing what I wanted to do was start Neo4j as standalone
 server. The problem was thtat the only entry point to Neo4j server
 is...HTTP REST. This lib (as I know) is not managed by Neo4j
 project/fellows but some external fellow created it. I say - OK, let it

What lib are you referring to? A client library? (this one? 
https://github.com/neo4j/java-rest-binding)

There are REST clients for many languages and it is fairly easy to write your 
own.
Still, the solution that is most flexible and performant is either to embed 
neo4j and expose domain protocol endpoints in your own server or write a server 
plugin/extension that provides those.

 be. But the first thing what was written there was transactions are not
 supported. Only batch operations but from my point of view this is a bit
 tricky solution for transactions.

Each HTTP request is a single transaction. Other approaches that handles 
transaction over the wire individually and longer running are planned. 

 Am I missing something?
 I hope I do, because in this situation, Neo4j isn't actually interesting DB
 server/solution...but I want it to be.

I would like to know some more detailed reasons for that, so far we haven't 
received this kind of response.

Thanks a lot

Michael
 
 Standalone server and transactions or GTFO.
 
 Cheers
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Standalone-server-and-transactions-tp3553058p3553058.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] Standalone server and transactions

2011-12-01 Thread Michael Hunger
No, the alternative there is to provide a server-side extension that 
encapsulates your business logic as an endpoint running inside of a tx.

Cheers

Michael

Am 02.12.2011 um 08:30 schrieb Dmytrii Nagirniak:

 
 On 02/12/2011, at 4:48 PM, Jim Webber wrote:
 
 1. Neo4j works as a standalone (or clustered) server which is accessible 
 through the REST API.
 
 That's the point. There is not standalone version with native bindings.
 You either run embedded and lock the whole database to the particular app, or 
 you go with REST that doesn't support transactions (batch != transaction)...
 
 2. Neo4j is ACID transactional with each HTTP request to the server being 
 internally scoped in a single transaction.
 Unfortunately it is not always enough, even when using batch API.
 
 Here is the use-case:
 1. Query for a nodes/rels.
 2. Run some custom logic on the client.
 3. Update nodes/rels appropriately.
 
 This is the most common way of using databases. And currently it is not 
 possible to wrap it in a transaction.
 
 So the only alternative in this case is to use native binding, which may not 
 be available to all. And means we are back at point 1.
 
 Do you see what I mean here?
 It's a trade-off: ACID vs DB with multiple clients.
 
 
 A way of doing transactions over REST would be nice. But it will be extremely 
 hard to implement due to the stateless nature of HTTP.
 I can see something like this in API:
 
 POST /transaction?timeout=2
 # Returns the ID of the transaction for the future
 
 # then use the normal API...
 
 
 PUT /transactions/1234/commit
 # or
 PUT /transactions/1234/rollback
 # or
 DESTROY /transactions/1234
 # or automatically rollback after 2 secs
 
 
 But I am not sure this can work reliably and performant enough with HTTP.
 
 Cheers.
 
 
 
 ___
 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] Using Neo4j as a document database (SO-Question)

2011-11-30 Thread Michael Hunger
Dear Graphistas,

if you have experience with that  topic, could you please answer him.
I think, real world answers help more than my general ones.

Thanks a lot

Michael

http://stackoverflow.com/questions/8332647/is-it-possible-to-use-graph-database-as-a-document-oriented-database

Suppose I have a large ammount of heterogeneous JSON documents (i.e. named 
key-value mappings) and a hierarchy of classes (i.e. named sets) that these 
documents are attached to. I need to set up a data structure that will allow:

• CRUD operations on JSON documents.
• Retrieving JSON documents by ID really quickly.
• Retrieving all JSON documents that are attached to a certain class 
really quickly.
• Editing class hierarchy: adding/deleting classes, rearranging them.
I've initially came up with the idea of storing JSON documents in a 
document-oriented database (like CouchDB or MongoDB) and storing class 
hierarchy in a graph database (like Neo4j). 1, 2 and 4 are then figured out 
naturally, and 3 solved by maintaining list of attached document IDs for every 
class in the graph.

But then I figured that a graph database could actually do the 
document-oriented part of retrieving JSON documents by ID. At a first glance 
this seems true, but I'm still concerned about 2 and 3. Is there a graph 
database that is able to retrieve documents (nodes) at a speed 
document-oriented db's serve documents? How fast will it serve 3-like queries? 
I've heard a little bit about graph databases being slow, reification problem, 
etc.

Is there a graph database that is also as comfortable for casual retrieving 
objects by ID, as CouchDB, for example? What is the difference between using 
document-oriented and graph database for storing, retrieving and editing 
JSON-like objects?



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


Re: [Neo4j] Spring integration problem

2011-11-30 Thread Michael Hunger
Hi Frank,

Which version of Srping Data Neo4j (and which version of Spring) are you 
running?

It say it misses one of the Spring classes:
 org/springframework/beans/factory/xml/NamespaceHandlerSupport

Which is normally included in spring-beans-3.0.6-RELEASE.jar

Can you show the output of mvn dependency:tree

Thanks a lot

Michael

Please try the latest version of SDN - 2.0.0.RC1.

Am 30.11.2011 um 20:30 schrieb Frank:

 Hi,
 
 I would like to use the Spring integration feature described on the
 springdataNeo4j page.
 
 My project already uses both Spring and Maven, and I am familiar with how to
 set up dependencies and Spring beans. I already have the neo4j server
 running on my localhost and I've been able to test it via the browser
 interface, so I know that part works.
 
 Unfortunately, despite carefully following the tutorial's instructions, and
 carefully examining everything I'm doing including making sure that every
 possible dependency is declared correctly, I cannot get Spring to load the
 graph database service due to an exception Invalid NamespaceHandler class.
 
 This is my Spring configuration file:
 
 ?xml version=1.0 encoding=UTF-8?
 beans 
   xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:neo4j=http://www.springframework.org/schema/data/neo4j;
xsi:schemaLocation=http://www.springframework.org/schema/beans
   http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
   http://www.springframework.org/schema/data/neo4j
   http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd;
   
   neo4j:config graphDatabaseService=graphDatabaseService/
   
   bean id=graphDatabaseService
 class=org.springframework.data.neo4j.rest.SpringRestGraphDatabase
   constructor-arg value=http://localhost:7474/db/data//
   /bean
   
 /beans
 
 This is the full stack trace of the exception:
 
 11/30/2011 13:07:34 [INFO] main (XmlBeanDefinitionReader.java:315) - Loading
 XML bean definitions from class path resource [neo4j.xml]
 org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
 exception parsing XML document from class path resource [neo4j.xml]; nested
 exception is org.springframework.beans.FatalBeanException: Invalid
 NamespaceHandler class
 [org.springframework.data.neo4j.config.DataGraphNamespaceHandler] for
 namespace [http://www.springframework.org/schema/data/neo4j]: problem with
 handler class file or dependent class; nested exception is
 java.lang.NoClassDefFoundError:
 org/springframework/beans/factory/xml/NamespaceHandlerSupport
   at
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
   at
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
   at
 org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
   at
 org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
   at
 org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
   at
 org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
   at
 org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
   at
 org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)
   at
 org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)
   at
 org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
   at
 org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
   at
 org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
   at
 org.springframework.context.support.ClassPathXmlApplicationContext.init(ClassPathXmlApplicationContext.java:139)
   at
 org.springframework.context.support.ClassPathXmlApplicationContext.init(ClassPathXmlApplicationContext.java:93)
   at neo4j.Populate.init(Populate.java:32)
   at neo4j.Populate.main(Populate.java:18)
 Caused by: org.springframework.beans.FatalBeanException: Invalid
 NamespaceHandler class
 [org.springframework.data.neo4j.config.DataGraphNamespaceHandler] for
 namespace [http://www.springframework.org/schema/data/neo4j]: problem with
 handler class file or dependent class; nested exception is
 java.lang.NoClassDefFoundError:
 

Re: [Neo4j] Cypher Query Optimizing

2011-11-30 Thread Michael Hunger
Martin,

would you be so kind as to test the current neo4j-1.6 snapshot with your query?

We did some changes in cypher and would like to see how that affects your query.

Thanks a lot

Michael

Am 30.11.2011 um 18:34 schrieb Martin Junghanns:

 @Tero @Krzysztof
 thx for your fast replies.
 
 @Krzysztof
 for me it was not fairly well known. I will also check out the 
 traverser api.
 
 @Tero
 I tried the same query using the internal id instead of my mapping index 
 (lucene)
 
 orig:
 START n=node:words(w_id = '137') MATCH n-[:CO_S]-m, n-[:CO_S]- t, 
 m-[r:CO_S]- t return m.w_id, t.w_id, r.sig, r.freq
 took: 662ms (average of 100 runs after 10 warmups)
 
 new:
 START n=node(119) MATCH n-[:CO_S]-m, n-[:CO_S]- t, m-[r:CO_S]- t 
 return m.w_id, t.w_id, r.sig, r.freq
 took: 644ms (average of 100 runs after 10 warmups)
 
 So it doesn't seem to be much more faster not using the index for node 
 lookup.
 
 I will check out your posts concerning Lucene Index.
 
 Greetings, Martin
 
 Am 30.11.2011 18:08, schrieb Krzysztof Raczyński:
 It is fairly well known that cypher queries are not (yet) optimised.
 If speed is a concern for you, try using traversal API, i can confirm
 it is much faster than cypher.
 
 cheers
 ___
 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] NullPointerException in ExecutingRestRequest

2011-11-30 Thread Michael Hunger
Frank,

sorry to hear that. 

I just tried it and it works as expected.

final SpringRestGraphDatabase gdb = new 
SpringRestGraphDatabase(http://localhost:7474/db/data/;);
final Node node = gdb.getReferenceNode();
assertEquals(0,node.getId());

What version of the Neo4j-Server are you using? Could you please also show the 
output of mvn dependency:tree ?

Thanks a lot

Michael

if you execute it via curl, what are the results?

ynagzet:spring-data-neo4j mh$ curl http://localhost:7474/db/data/ -i
HTTP/1.1 200 OK
Content-Length: 620
Content-Encoding: UTF-8
Content-Type: application/json
Access-Control-Allow-Origin: *
Server: Jetty(6.1.25)

{
  relationship_index : http://localhost:7474/db/data/index/relationship;,
  node : http://localhost:7474/db/data/node;,
  relationship_types : http://localhost:7474/db/data/relationship/types;,
  neo4j_version : 1.6.M01,
  batch : http://localhost:7474/db/data/batch;,
  extensions_info : http://localhost:7474/db/data/ext;,
  node_index : http://localhost:7474/db/data/index/node;,
  reference_node : http://localhost:7474/db/data/node/0;,
  extensions : {
GremlinPlugin : {
  execute_script : 
http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script;
}
  }
}ynagzet:spring-data-neo4j mh$ curl http://localhost:7474/db/data -i
HTTP/1.1 302 Found
Location: http://localhost:7474/db/data/
Content-Length: 0
Server: Jetty(6.1.25)


Am 01.12.2011 um 00:19 schrieb Frank:

 The server is running on localhost and can be hit from a browser. The
 server's configuration was modified to allow requests from any IP address,
 although all of my attempts are from the localhost anyway.
 
 I've tried this with and without a trailing slash on the URI, no difference.
 
 Code:
 
 GraphDatabase graphDb = new
 SpringRestGraphDatabase(http://localhost:7474/db/data;);
 graphDb.getReferenceNode();
 
 Result:
 
 java.lang.NullPointerException
   at
 org.neo4j.rest.graphdb.ExecutingRestRequest.uriWithoutSlash(ExecutingRestRequest.java:78)
   at
 org.neo4j.rest.graphdb.ExecutingRestRequest.init(ExecutingRestRequest.java:72)
   at
 org.neo4j.rest.graphdb.ExecutingRestRequest.with(ExecutingRestRequest.java:149)
   at org.neo4j.rest.graphdb.entity.RestEntity.init(RestEntity.java:52)
   at org.neo4j.rest.graphdb.entity.RestNode.init(RestNode.java:47)
   at org.neo4j.rest.graphdb.RestAPI.getReferenceNode(RestAPI.java:168)
   at
 org.neo4j.rest.graphdb.RestGraphDatabase.getReferenceNode(RestGraphDatabase.java:71)
   at neo4j.Populate.init(Populate.java:35)
   at neo4j.Populate.main(Populate.java:18)
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/NullPointerException-in-ExecutingRestRequest-tp3550067p3550067.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] Will there ever be a native SDK for Node.js?

2011-11-30 Thread Michael Hunger
if you just want to use javascript you can look into rhino.

for the REST APO there neo4j,js and juggledb or using the http calls directly


hth
michael

mobile mail please excuse brevity and typos

Am 01.12.2011 um 07:06 schrieb Dmytrii Nagirniak dna...@gmail.com:

 
 On 01/12/2011, at 4:32 PM, yobi wrote:
 
 What are the advantages of using HTTP directly over native SDK like the Java
 one?
 You have to understand that native runs as as part of the same process. And 
 that's why it's supposed to be faster.
 Running as part of the app means that you lock the database to one single app 
 (you can't just go and fix production data).
 
 With REST, you have a separate server. Thus multiple applications can use. Or 
 you can access it directly through normal web browser to fix your data.
 Or even run background jobs against that server. All that is not possible 
 with native.
 
 
 Don't they have a native SDK for Python and Ruby as well (although I think
 they are just wrappers for tje HTTP API?)
 No. Saying native it means that it is native to Java only.
 So as long as you are on JVM, you can use the native SDK.
 
 There are versions of Ruby (JRuby) and Python (Jypthon) that are built 
 specifically to target JVM. And that's why you can use it.
 But if you want to use normal Ruby or Python, your only option is REST.
 
 Same applies to your case with Nodejs.  
 
 ___
 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] cypher question - subqueries possible?

2011-11-29 Thread Michael Hunger
Shouldn't rel2 then be an optional relationship? Otherwise IMHO it can never be 
null.


 START c=...
 MATCH c-[rel1:MyRel]-a, c-[rel2?:MyRel]-b
 WHERE rel2 is null
 RETURN c

Am 29.11.2011 um 13:00 schrieb D. Frej:

 I would recommend the following
 
 START c=...
 MATCH c-[rel1:MyRel]-a, c-[rel2:MyRel]-b
 WHERE rel2 is null
 RETURN c
 
 even though it seems it little strange
 
 
 
 Am 29.11.2011 03:03, schrieb KanTube:
 while not ideal you could do
 
 START
 a=node:node_auto_index(NodeType=A),b=node:node_auto_index(NodeType=B)
 MATCH a-[:MyRel]-c-[r?:MyRel]-b
 RETURN c, count(r)
 
 and in your code you could filter for count(r) = 0
 
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/cypher-question-subqueries-possible-tp3543685p3544033.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


Re: [Neo4j] py2neo - GEOFF enhancements

2011-11-29 Thread Michael Hunger
does it also handle iterables of nodes/rels (and probably Longs?)

while thinking about it
it would be great if the loader could also return a map of variables of the 
things generated to be used further in processing

that could also interesting for cascading  geoff and/or cypher

cool stuff big thanks 

michael

mobile mail please excuse brevity and typos

Am 29.11.2011 um 16:18 schrieb Peter Neubauer 
peter.neuba...@neotechnology.com:

 That sounds great! Let me know when you are stable, and I will see if
 I can do some more on the server plugin side, so we can shoot in
 things there!
 
 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  - NOSQL for the Enterprise.
 http://startupbootcamp.org/- Öresund - Innovation happens HERE.
 
 
 
 On Mon, Nov 28, 2011 at 9:52 PM, Nigel Small ni...@nigelsmall.name wrote:
 Hi Peter
 
 Bulk of the work is now done on the Java version of the GEOFF enhancements.
 There have been some significant changes to the classes and a number of
 extra tests inserted. The signature of the load method has now been
 extended to:
 
 public static Neo4jNamespace loadIntoNeo4j(Reader reader,
 GraphDatabaseService graphDB, MapString, ? extends PropertyContainer
 hooks)
 
 ...where the final parameter expects a Map full of names
 Nodes/Relationships which may then be referenced from within the GEOFF
 source.
 
 Let me know how you get on and give me a shout if I've forgotten anything
 :-)
 
 Cheers
 
 Nige
 
 *Nigel Small*
 Phone: +44 7814 638 246
 Blog: http://nigelsmall.name/
 GTalk: ni...@nigelsmall.name
 MSN: nasm...@live.co.uk
 Skype: technige
 Twitter: @technige https://twitter.com/#%21/technige
 LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
 On 23 November 2011 10:12, Peter Neubauer pe...@neubauer.se wrote:
 
 Looks great to me Nigel! I think this is a very good first step on
 parameters. Let me know when you are done with the Java code, would
 like to bring this into the @Graph annotations after our next
 milestone release, 1.6.M01.
 
 /peter
 
 On Tue, Nov 22, 2011 at 10:14 PM, Nigel Small ni...@nigelsmall.name
 wrote:
 Hi all
 
 I have just completed a set of GEOFF enhancements within py2neo (as yet
 only available from GitHub). Named parameters (hooks) and composite
 descriptors are now supported, please see the following sample file for
 an
 illustration of the new capabilites:
 
 
 https://github.com/nigelsmall/py2neo/blob/master/src/py2neo-examples/geoff/node-hooks.geoff
 
 In addition, a change has been made for index entries to use |foo| syntax
 instead of {foo} syntax as previously (although the old syntax will still
 work for now).
 
 Finally, there is a new wiki page detailing the current format in full:
 
 https://github.com/nigelsmall/py2neo/wiki/GEOFF
 
 I will now start planning the set of work required for the neo4j-geoff
 project to bring that up to the same level.
 
 Cheers
 
 Nige
 
 *Nigel Small*
 Phone: +44 7814 638 246
 Blog: http://nigelsmall.name/
 GTalk: ni...@nigelsmall.name
 MSN: nasm...@live.co.uk
 Skype: technige
 Twitter: @technige https://twitter.com/#!/technige
 LinkedIn: http://uk.linkedin.com/in/nigelsmall
 ___
 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
 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] cypher question - subqueries possible?

2011-11-29 Thread Michael Hunger
wow, cool

I played once with parsing jaca ast's and putting the in neo4j to answer 
similar question (also looking at metrics/dependency graphs)

please write it up!

Michael

mobile mail please excuse brevity and typos

Am 29.11.2011 um 13:59 schrieb jschweigl johann.schwe...@gmail.com:

 Thanks for all the replies. To explain what I am doing: I'm harvesting
 information from the software engineering tool some guys here are using:
 Excel (gawk!). Excel sheets are parsed and converted to graphs,
 incrementally enriched with properties as I digest subsequent sheets so that
 at the end I get a database of everything which I intend to use for export
 into something useful like Enterprise Architect from Sparx.
 
 The queries I write should do some kind of QA, showing inconsistencies
 introduced by typos in the sheets or incorrect parsing of free text in the
 cells. The model excerpt we are looking at is
 
 http://neo4j-community-discussions.438527.n3.nabble.com/file/n3545086/mockups.png
  
 
 There are some phenomena I do not understand regarding the query syntax and
 the resulting nodes:
 
 - Query 6 lists all mockups with no relations: 27 items, fine
 - Query 7 lists all mockups linked to a scenario but not linked to any
 subprocess: 53
 - Query 8 lists all mockups linked to a subprocess but not linked to any
 scenario: 53. Exactly the same ones
 - Query 9 lists all mockups linked to both at least one subprocess and
 scenario: 53. Again, exactly the same ones
 
 Query 10 and 11 are the same as 9 and 10, but written according to the hints
 from the forum. 
 - Query 10 returns no nodes, which I believe is correct, at least according
 to an overview supplied with the Excel sheet and a few random samples
 - Query 11 returns a node with _id and mockupName being null - huh? I'm
 using a quickly hacked POJO mapping layer. jo4neo only works up to neo 1.4
 so I came up with my own which does the absolute minimum I needed for the
 job, but as _id is the primary key, I'm pretty sure I don't store such
 nodes. A bug is always possible, but 
 - Query 19 lists all mockup nodes and there is no one with null in both
 fields.
 
 The math: there are 27 unlinked nodes, queries 7, 8, and 9 retrieve the very
 same 53 nodes which I believe to be linked to both scenarios and
 subprocesses so either the query or the result must be wrong and query 19
 delivers a total of 80 nodes. 27 + 53 = 80.
 
 As I already said I'm not familiar with neo and cypher yet, but I do not see
 the semantic difference between queries 7 and 8 vs. 10 and 11, yet the
 results differ significantly, and this even between 10 and 11.
 
 As an overview, here are the queries and the (shortened) output:
 
 
 6: Unused mockups
 START mock=node:nodeIndex(_simpleType = 'Mockup') MATCH
 ()-[r?:HAS_MOCKUP]-mock WHERE r IS NULL RETURN distinct mock._id,
 mock.mockupName ORDER BY mock.mockupName
 ++
 | mock._id | mock.mockupName |
 ++
 | e80cdb81-9283-3279-9ec4-1c27ace2a3fd | K01-05  |
 | 5095c15a-3230-3b5a-aa03-acd45057470b | K01-07-0|
 ...
 | 6ba433d8-5989-399a-b463-8a088eafe756 | P2-P04-8-2  |
 | b3209a20-2081-3444-9047-4615bc6b95b3 | RAO-4-2 |
 ++
 27 rows, 37 ms
 
 7: Mockup linked to scenario not used by any subprocess
 START scenario=node:nodeIndex(_simpleType = 'Scenario'),
 sub=node:nodeIndex(_simpleType = 'Subprocess') MATCH
 scenario-[:HAS_MOCKUP]-mock-[r?:HAS_MOCKUP]-sub WHERE r IS NULL RETURN
 distinct mock._id, mock.mockupName ORDER BY mock.mockupName
 ++
 | mock._id | mock.mockupName |
 ++
 | 81a05542-99b2-3672-8498-a31770562416 | K00-1-1 |
 | 7bc08fcc-6380-3ba3-810c-b61d85e9d5d4 | K00-2-2 |
 ...
 | 0adf74e4-b28f-3301-b903-c65697129c24 | P2-P05-2-1  |
 | 4db08241-c9d7-3ac4-a453-6e8b5957efdb | P2-P05-2-2  |
 ++
 53 rows, 739 ms
 
 8: Mockup linked to subprocess not used by any scenario
 START scenario=node:nodeIndex(_simpleType = 'Scenario'),
 sub=node:nodeIndex(_simpleType = 'Subprocess') MATCH
 sub-[:HAS_MOCKUP]-mock-[r?:HAS_MOCKUP]-scenario WHERE r IS NULL RETURN
 distinct mock._id, mock.mockupName ORDER BY mock.mockupName
 ++
 | mock._id | mock.mockupName |
 ++
 | 81a05542-99b2-3672-8498-a31770562416 | K00-1-1 |
 | 7bc08fcc-6380-3ba3-810c-b61d85e9d5d4 | K00-2-2 |
 ...
 | 0adf74e4-b28f-3301-b903-c65697129c24 | P2-P05-2-1  |
 | 4db08241-c9d7-3ac4-a453-6e8b5957efdb | P2-P05-2-2  |
 ++
 53 rows, 987 ms
 

Re: [Neo4j] application architecture to deliver big list of data

2011-11-29 Thread Michael Hunger
It depends on your usecase, most end-users are fine with inconsistencies (as 
they are part of real life).

- first approach adds too much overhead
- second approach will also run into inconsistencies as neo4j's transaction 
isolation is read-comitted 

so it would be most sensible to cater for the inconsistencies in your API.

Michael

Am 29.11.2011 um 18:58 schrieb D. Frej:

 Hi,
 
 I have an architectural question regarding an applicaiton using neo4j. 
 This is the situation: it is a application with the functionality to 
 show big data in list form. However, when delivering the data in two 
 steps and records are deleted meanwhile the list might be incosistent... 
 What is the best way (best practise?) to do this?
 
 - putting all records in a collection and return them all at once?
 - keep the transaction open and assigened to the session?
 - deliver the data in several steps and risk inconsistency?
 
 Any experience? Any suggestions?
 
 Didi
 ___
 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] py2neo - GEOFF enhancements

2011-11-29 Thread Michael Hunger
Hmm good question, that means the namespace keeps everything around until it is 
gc'ed ?

Probably better to just return the full map and let the client code deal with 
it ? (If it isn't interested it would either just ignore the return result or 
discard it quickly).

Intention behind longs, is when I get them from an external source then they 
can be used to be look up nodes during import.

Also can hooks be used for index lookups? (Just asking)

Thanks a lot

Michael

Am 29.11.2011 um 22:58 schrieb Nigel Small:

 Hi Michael
 
 Doesn't handle iterables (yet) but should be quite easy to add in. What
 purpose did you have behind longs?
 
 I've just committed a few new methods allowing the Neo4jNamespace returned
 from a loadIntoNeo4j call to be used to retrieve new entities by name (or a
 map of such). The new methods are:
 
 public Node getPreexistingNode(String name)
 public MapString, Node getPreexistingNodes(String... names)
 public Node getNewlyCreatedNode(String name)
 public MapString, Node getNewlyCreatedNodes(String... names)
 public Relationship getPreexistingRelationship(String name)
 public MapString, Relationship getPreexistingRelationships(String...
 names)
 public Relationship getNewlyCreatedRelationship(String name)
 public MapString, Relationship getNewlyCreatedRelationships(String...
 names)
 
 One of the tests in GraphDescriptionTest illustrates simple usage, thus:
 
 Neo4jNamespace ns = GEOFFLoader.loadIntoNeo4j(reader, db, hooks);
 Node nodeFoo = ns.getNewlyCreatedNode(foo);
 Node nodeBar = ns.getNewlyCreatedNode(bar);
 
 Hope this helps - I'll have a play with iterables next.
 
 Cheers
 
 Nige
 
 *Nigel Small*
 Phone: +44 7814 638 246
 Blog: http://nigelsmall.name/
 GTalk: ni...@nigelsmall.name
 MSN: nasm...@live.co.uk
 Skype: technige
 Twitter: @technige https://twitter.com/#%21/technige
 LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
 On 29 November 2011 15:58, Michael Hunger
 michael.hun...@neotechnology.comwrote:
 
 does it also handle iterables of nodes/rels (and probably Longs?)
 
 while thinking about it
 it would be great if the loader could also return a map of variables of
 the things generated to be used further in processing
 
 that could also interesting for cascading  geoff and/or cypher
 
 cool stuff big thanks
 
 michael
 
 mobile mail please excuse brevity and typos
 
 Am 29.11.2011 um 16:18 schrieb Peter Neubauer 
 peter.neuba...@neotechnology.com:
 
 That sounds great! Let me know when you are stable, and I will see if
 I can do some more on the server plugin side, so we can shoot in
 things there!
 
 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  - NOSQL for the Enterprise.
 http://startupbootcamp.org/- Öresund - Innovation happens HERE.
 
 
 
 On Mon, Nov 28, 2011 at 9:52 PM, Nigel Small ni...@nigelsmall.name
 wrote:
 Hi Peter
 
 Bulk of the work is now done on the Java version of the GEOFF
 enhancements.
 There have been some significant changes to the classes and a number of
 extra tests inserted. The signature of the load method has now been
 extended to:
 
 public static Neo4jNamespace loadIntoNeo4j(Reader reader,
 GraphDatabaseService graphDB, MapString, ? extends PropertyContainer
 hooks)
 
 ...where the final parameter expects a Map full of names
 Nodes/Relationships which may then be referenced from within the GEOFF
 source.
 
 Let me know how you get on and give me a shout if I've forgotten
 anything
 :-)
 
 Cheers
 
 Nige
 
 *Nigel Small*
 Phone: +44 7814 638 246
 Blog: http://nigelsmall.name/
 GTalk: ni...@nigelsmall.name
 MSN: nasm...@live.co.uk
 Skype: technige
 Twitter: @technige https://twitter.com/#%21/technige
 LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
 On 23 November 2011 10:12, Peter Neubauer pe...@neubauer.se wrote:
 
 Looks great to me Nigel! I think this is a very good first step on
 parameters. Let me know when you are done with the Java code, would
 like to bring this into the @Graph annotations after our next
 milestone release, 1.6.M01.
 
 /peter
 
 On Tue, Nov 22, 2011 at 10:14 PM, Nigel Small ni...@nigelsmall.name
 wrote:
 Hi all
 
 I have just completed a set of GEOFF enhancements within py2neo (as
 yet
 only available from GitHub). Named parameters (hooks) and composite
 descriptors are now supported, please see the following sample file
 for
 an
 illustration of the new capabilites:
 
 
 
 https://github.com/nigelsmall/py2neo/blob/master/src/py2neo-examples/geoff/node-hooks.geoff
 
 In addition, a change has been made for index entries to use |foo|
 syntax
 instead of {foo} syntax as previously (although the old syntax will
 still
 work for now).
 
 Finally, there is a new wiki page detailing the current format in
 full:
 
 https://github.com/nigelsmall/py2neo/wiki/GEOFF
 
 I will now start planning the set of work

Re: [Neo4j] EJB3 and Legacy applications

2011-11-29 Thread Michael Hunger
You might look at Spring Data Neo4j or jo4neo for that.

I had a fake EntityManager in SDN once for Spring ROO (it should be still 
somewhere in the history) but it didn't take care of JPA annotations. If you 
want to give it a try, you're free to engage :) But I don't think it is worth 
the effort. Rather embrace the rich domain as it is.
Cheers

Michael

Am 29.11.2011 um 23:22 schrieb nrkkalyan:

 Hey,
 
 Thank you for the reply.
 I am sorry I was not clear with the below statement :
 
 #1  If not then I think wouldn't it be good to support them
 #2 s every organization may not want to go for Spring-Data or want to
 migrate to Neo4J just because its more efficient than RDBMS
 
 What I meant was supporting JPA annotations in Neo4j will give more
 opportunity for organizations to consider migrating their data from RDBMS to
 Neo4J.
 I think Hibernate OGM is somewhat similar I am looking for. I will try to
 explore too on this and return.
 
 No doubt Neo4J provides more richer domain model than RDBMS. But to gain a
 broad market we(Neo4J Community) must consider  
 
 I spent around 30 hours in understanding Neo4J and other related stuff and
 planning to spend more and more to dig down Neo4J. My motto is to replace
 Oracle or any RDBMS with Graph DB and I found Neo4J is perfect.
 
 Now I am working on a solution where I can migrate my old swing
 application(SqlLite as backend) to Neo4J.
 Thus I don't want to change any business logic, all I want to change is
 database.
 
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/EJB3-and-Legacy-applications-tp3540750p3546684.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] py2neo - GEOFF enhancements

2011-11-29 Thread Michael Hunger
#1 Thanks
#2 You're probably right

#3 You can do the index lookup outside and pass in the IndexHitsNode as being 
and Iterator
#3 I rather thought of {name} for |people| - {name: {hook}} as a shortcut for 
that

Michael

But #2 and #3 are probably overkill anyway.

Cheers

Michael

Am 29.11.2011 um 23:59 schrieb Nigel Small:

 Hi Michael
 
 Probably better to just return the full map and let the client code deal
 with it ? (If it isn't interested it would either just ignore the return
 result or discard it quickly).
 Done. Now works as:
 
 MapString,PropertyContainer entities = GEOFFLoader.loadIntoNeo4j(reader,
 db, hooks);
 Node nodeFoo = (Node) entities.get((foo));
 Node nodeBar = (Node) entities.get((bar));
 
 Intention behind longs, is when I get them from an external source then
 they can be used to be look up nodes during import.
 This can be done but not sure it's the right place... I'm cautious about
 using IDs directly as they aren't very portable. Also, it's not intuitive
 whether an ID is for a node or relationship. Would like to get a few votes
 on this - I'm happy to be outvoted if the consensus is to do it!
 
 Also can hooks be used for index lookups? (Just asking)
 Are you thinking of something like {People:name=bert}? If so, this is
 quite a distance from where we are currently since every token can only
 refer to a single entity, whereas an index lookup could return multiple
 results.
 
 Nige
 
 *Nigel Small*
 Phone: +44 7814 638 246
 Blog: http://nigelsmall.name/
 GTalk: ni...@nigelsmall.name
 MSN: nasm...@live.co.uk
 Skype: technige
 Twitter: @technige https://twitter.com/#%21/technige
 LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
 On 29 November 2011 22:09, Michael Hunger
 michael.hun...@neotechnology.comwrote:
 
 Hmm good question, that means the namespace keeps everything around until
 it is gc'ed ?
 
 Probably better to just return the full map and let the client code deal
 with it ? (If it isn't interested it would either just ignore the return
 result or discard it quickly).
 
 Intention behind longs, is when I get them from an external source then
 they can be used to be look up nodes during import.
 
 Also can hooks be used for index lookups? (Just asking)
 
 Thanks a lot
 
 Michael
 
 Am 29.11.2011 um 22:58 schrieb Nigel Small:
 
 Hi Michael
 
 Doesn't handle iterables (yet) but should be quite easy to add in. What
 purpose did you have behind longs?
 
 I've just committed a few new methods allowing the Neo4jNamespace
 returned
 from a loadIntoNeo4j call to be used to retrieve new entities by name
 (or a
 map of such). The new methods are:
 
 public Node getPreexistingNode(String name)
 public MapString, Node getPreexistingNodes(String... names)
 public Node getNewlyCreatedNode(String name)
 public MapString, Node getNewlyCreatedNodes(String... names)
 public Relationship getPreexistingRelationship(String name)
 public MapString, Relationship getPreexistingRelationships(String...
 names)
 public Relationship getNewlyCreatedRelationship(String name)
 public MapString, Relationship getNewlyCreatedRelationships(String...
 names)
 
 One of the tests in GraphDescriptionTest illustrates simple usage, thus:
 
 Neo4jNamespace ns = GEOFFLoader.loadIntoNeo4j(reader, db, hooks);
 Node nodeFoo = ns.getNewlyCreatedNode(foo);
 Node nodeBar = ns.getNewlyCreatedNode(bar);
 
 Hope this helps - I'll have a play with iterables next.
 
 Cheers
 
 Nige
 
 *Nigel Small*
 Phone: +44 7814 638 246
 Blog: http://nigelsmall.name/
 GTalk: ni...@nigelsmall.name
 MSN: nasm...@live.co.uk
 Skype: technige
 Twitter: @technige https://twitter.com/#%21/technige
 LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
 On 29 November 2011 15:58, Michael Hunger
 michael.hun...@neotechnology.comwrote:
 
 does it also handle iterables of nodes/rels (and probably Longs?)
 
 while thinking about it
 it would be great if the loader could also return a map of variables of
 the things generated to be used further in processing
 
 that could also interesting for cascading  geoff and/or cypher
 
 cool stuff big thanks
 
 michael
 
 mobile mail please excuse brevity and typos
 
 Am 29.11.2011 um 16:18 schrieb Peter Neubauer 
 peter.neuba...@neotechnology.com:
 
 That sounds great! Let me know when you are stable, and I will see if
 I can do some more on the server plugin side, so we can shoot in
 things there!
 
 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  - NOSQL for the Enterprise.
 http://startupbootcamp.org/- Öresund - Innovation happens HERE.
 
 
 
 On Mon, Nov 28, 2011 at 9:52 PM, Nigel Small ni...@nigelsmall.name
 wrote:
 Hi Peter
 
 Bulk of the work is now done on the Java version of the GEOFF
 enhancements.
 There have been some significant changes to the classes and a number
 of
 extra tests inserted

Re: [Neo4j] UnsupportedOperationException on RestNode.traverse

2011-11-29 Thread Michael Hunger
traverse on the nodes is the old traverser API which is not supported there.

please use

restgraphdatabase.traversal() to create a RestTraversalDescription.

Michael


mobile mail please excuse brevity and typos

Am 30.11.2011 um 03:58 schrieb e0d edward.zarecor+ne...@alleyoop.com:

 Upon migrating my graph database from an embedded one to a neo4j server
 instance, I'm getting an UnsupportedOperationException calling traverse on a
 RestNode.
 
 Given that the body of the implementation in RestNode is:
 
throw new UnsupportedOperationException();
 
 this isn't a big surprise.  I'm using following jar
 neo4j-rest-graphdb-1.5-SNAPSHOT-sources.jar.
 
 This is a spring data project by the way.  Is this a snapshot issue or is
 there a different strategy I should be using for traversing in a server
 environment?
 
 Thanks.
 
 e0d.
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/UnsupportedOperationException-on-RestNode-traverse-tp3547185p3547185.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] Using in-memory DB for unit tests

2011-11-29 Thread Michael Hunger
you can also use
rel.getOtherNode(startNode)

Michael

mobile mail please excuse brevity and typos

Am 30.11.2011 um 06:03 schrieb Jim Webber j...@neotechnology.com:

 Hi Jon,
 
// This one results in a not found exception on the 'asn' property.
@Test
public void testIncoming()
{
 
Node network = svc.createNode();
Node as = svc.createNode();
as.setProperty( asn, 123 );
 
as.createRelationshipTo( network, DynamicRelationshipType.withName( 
 AS ) );
 
System.out.println( network.getSingleRelationship( 
 IPAddressRelationshipType.AS, Direction.INCOMING )
.getStartNode()
// It's the start node of the incoming relationship, which is 
 the same as the end node of the outgoing relationship
.getProperty( asn ) );
 
}
 
 
 You got the start and end node wrong - I changed that and your test ran just 
 fine.
 
 Good luck with your first project - I hope it's as enjoyable as my first 
 Neo4j project :-)
 
 Jim
 ___
 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] EJB3 and Legacy applications

2011-11-27 Thread Michael Hunger
Hey,

I've planned to look at Hibernate OGM as a side project but there are no plans 
for when it will happen.

Could you please explain what you mean by  ?

#1  If not then I think wouldn't it be good to support them
#2 s every organization may not want to go for Spring-Data or want to migrate 
to Neo4J just because its more efficient than RDBMS

for your second question:

Neo4j supports much richer domain models than relational databases. Putting a 
such domain model in a relational database would lead to sparse table with 
non-enforced foreign key constraints (optional properties and optional 
relationships)
So it is not likely that you would want to migrate your domain model 1:1 from a 
relational db to Neo4j.
Rather create your _real_ domain model and store that in Neo4j (lots of data 
and relationships from the real domain get dropped b/c they don't really fit in 
the more strict and limited rdbms schema).

That said, there is a SQL Loader tool written by Peter Neubauer, that _can_ be 
used to convert relational databases to neo4j.

Michael

Am 27.11.2011 um 21:37 schrieb nrkkalyan:

 Hi,
 
 No doubt Neo4J is future. 
 I have 2 questions.
 *First:*
 I was wondering if JPA annotations are supported in Neo4J. If not then I
 think wouldn't it be good to support them as every organization may not want
 to go for Spring-Data or want to migrate to Neo4J just because its more
 efficient than RDBMS, as they have already invested lot of resources
 building clients and other business logic.
 
 *Secondly* most of the legacy applications are tightly coupled to RDBMS and
 Sql like syntax and if there is some tool available which can migrate data
 and structure from RDBMS to Neo4J then the days are not far when there will
 be no Oracle or SQLServer or any RDBMS at all. 
 
 Please let me know if you need more clarification..
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/EJB3-and-Legacy-applications-tp3540750p3540750.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] Neo4j Data Capacities

2011-11-24 Thread Michael Hunger
Correct,

is this an issue for your domain/data model?

If so could you something about your use-case / context?

Thanks a lot

Michael

Am 24.11.2011 um 13:55 schrieb bm3780:

 I've read that Neo4j has data capacity limitations
 (http://docs.neo4j.org/chunked/milestone/capabilities-capacity.html).  I
 would like to confirm my understandings that the node, properties, and
 relationships limitations are for each type (e.g. AND condition), not an
 either/or  (e.g. OR condition).
 
 Neo4j can hold:
   * ~34 billions nodes, AND
   * ~34 billion relationships, AND
   * ~68 billion properties
 
 So I could theoretically have a single graph with 34 billion nodes, where
 each node had two properties and a single relationship.
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Data-Capacities-tp3533552p3533552.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] Neo4j Data Capacities

2011-11-24 Thread Michael Hunger
If your data exceeds those amounts, then polyglot persistence is probably the 
way to go.

Is the other part of your data also interconnected and rich or is it just the 
social part?

All that not only depends on the storage but also a lot on the use-cases and 
scenarions how you are going to use that data in the future.

What kinds of apps, services, user(-requests) you have to server.

If you need any support for a PoC don't hesitate to contact us.

Cheers,

Michael
Am 24.11.2011 um 14:13 schrieb bm3780:

 I'm struggling to determine whether graph is a good fit for my domain.  Most
 of my application is structured data.  However, there are some parts that
 are of a social nature and a graph seems like a good match.  I guess my fear
 is having all of the data in a single store, such as a graph, would cause
 problems down the road due to the limitations.
 
 Potentially I need to go down the path of polyglot persistence...storing
 just the social aspect of my data in the graph and storing the other data in
 a document store.  I was try trying to simply our architecture by using only
 a graph, which would make OM much easier down the road.
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Data-Capacities-tp3533552p3533597.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] Neo4j sponsoring the global day of code retreat

2011-11-23 Thread Michael Hunger
I'm happy to announce that Neo Technology sponsors the Global Day of Code 
Retreat as a Continent Sponsor.

Quote from Corey Haines (http://coderetreat.org)

Global Day of Coderetreat is a world-wide event celebrating passion and 
software craftsmanship. 
Over 2000 passionate software developers around the world (90 cities) will 
spend the day practicing the craft of 
software development using the coderetreat format. 


So please have a look, if there is a code retreat near you, feel free to join 
on Dec. 3rd. It's a lot of fun!

(if you like to, you can also organize a coderetreat on your own and join the 
movement)

Cheers

Michael, excited.

http://www.infoq.com/news/2011/11/global_day_of_code_retreat
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] How to boost performance?

2011-11-23 Thread Michael Hunger
Vinicius,

first: did you have any issues importing the data into Neo4j?
second: your example used cypher which is not optimized for performance (yet!). 
This is in our plans for the next two releases of neo4j.

So if you want to see the real performance of neo4j, please use the traversal 
framework or the core-API:

Cypher  Traversals:

// define
cypherQuery = cypherParser.parse(start n=node({start_node}) match n--()--x 
return x)
traversalQuery = 
Traversal.description().evaluator(Evaluators.atDepth(2)).expand(Traversal.expanderForAllTypes(Direction.OUTGOING))

// execute
for (Node n : cypherQuery.execute({start_node:startNode})) { ... }
for (Node n : traversalQuery.traverse(startNode).nodes()) { ... }

If you're interested in the paths, remove the .nodes() call at the traverser

In java core-api code:

Node start=db.getNodeById(3);

for (Relationship rel=start.getRelationships()) {
Node second = rel.getOtherNode(start);
for (Relationship rel=second.getRelationships()) {
Node third = rel.getOtherNode(second);
// do something with the 3 nodes, 2 relationships which form your path
}
}

In the REST API the traversal would look like: (see 
http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html#rest-api-traversal-using-a-return-filter)
* POST http://localhost:7474/db/data/node/3/traverse/node
* Accept: application/json
* Content-Type: application/json 

{
  relationships : [ {direction : out } ],
  max_depth : 3
}


Am 23.11.2011 um 11:54 schrieb Vinicius Carvalho:

 Hi there, I've posted a few days ago about the POC I'm doing here at my
 company. I have some initial numbers and I'd like to ask for some help here
 in order to promote neo4j here in LMI Ericsson.
 
 I've loaded a mySQL db with a really simple entity, that pretty much only
 represents a node and relations (only properties it has is an UID and x/y
 space coordinate for each node)
 
 The DB contains 250.000 cells and 19. relations stored in a myISAM table,
 indexed only by it's primary key. Please find the DDL for the two tables.
 
 CREATE TABLE  `pci`.`cells` (
  `id` varchar(32) collate utf8_bin NOT NULL,
  `x_pos` double default NULL,
  `y_pos` double default NULL,
  `pci` smallint(6) default '0',
  PRIMARY KEY  (`id`)
 )
 
 CREATE TABLE  `pci`.`relations` (
  `id` int(11) NOT NULL auto_increment,
  `source` varchar(32) collate utf8_bin default NULL,
  `target` varchar(32) collate utf8_bin default NULL,
  PRIMARY KEY  (`id`),
  KEY `src_idx` (`source`),
  KEY `src_target` (`target`)
 )
 
 So as you can see, a simple secondary table contains the relationship with
 source and targets pointing to the cells table.
 
 I've loaded this exact same DB into a neoserver running on the same
 machine: A Blade with 26 cpus (6 cores each) and 16gb RAM.
 
 One of the requirements we have is to find all associations of my
 associations. Something that in neo I did like this:
 
 START n = node(3)
 MATCH n--()--(x)
 return x
 
 For this specific node it returns 6475 nodes.
 
 I have tested this before using Hibernate in two modes: without a L2 cache,
 and with an L2 Cache (Ehcache standalone no replication).
 Here's a snippet of the code that loads it, so you can understand what's
 going under the hood:
 
 
 @Override
 public ListCell loadCellWithRealtions(String... ids) {
 Session session = (Session) em.getDelegate();
 Criteria c = session.createCriteria(Cell.class)
 .setFetchMode(incomingRelations, FetchMode.SELECT)
 .setFetchMode(outgoingRelations, FetchMode.SELECT)
 .add(Restrictions.in(id, Arrays.asList(ids)));
 ListCell results = c.list();
 for(Cell cell : results){
 Hibernate.initialize(cell.getIncomingRelations());
 Hibernate.initialize(cell.getOutgoingRelations());
 }
 return results;
 }
 
 @Override
 public ListCell loadCellWithNeighbourRelations(String... ids) {
 ListCell cells = loadCellWithRealtions(ids);
 for(Cell c : cells){
 for(Relation r : c.getIncomingRelations()){
 Hibernate.initialize(r.getSource().getIncomingRelations());
 Hibernate.initialize(r.getSource().getOutgoingRelations());
 }
 for(Relation r : c.getOutgoingRelations()){
 Hibernate.initialize(r.getTarget().getIncomingRelations());
 Hibernate.initialize(r.getTarget().getOutgoingRelations());
 }
 }
 return cells;
 }
 
 
 
 So the first method executes one query and 2 subselects to find a cell and
 all relations, the second method, iterate over each relation and do the
 same. So I pretty much will have something like 3+r*3 selects on db, where
 r is the number of relations right.
 
 Ok, to be a bit fair with the tests, I've ran this for the same node 10
 times (get a chance to warm the caches), exclude the longest and smallest
 result, and then took a mean of it. Here's the results:
 
 EhCache: 70ms
 Plain Hibernate: 550ms
 
 I still don't have a version of neo4j code running integrated in the app
 server, but the idea is to use REST API. Running the query on the REST API
 took over 2 seconds on average, but due the large size of the 

Re: [Neo4j] How to boost performance?

2011-11-23 Thread Michael Hunger
Please use EmbeddedGraphDatabase, 

EmbeddedReadOnlyGraphDatabase caches a snapshot of the data in its caches and 
doesn't get update-changes.

Michael

Am 23.11.2011 um 14:39 schrieb Vinicius Carvalho:

 Hi Michael, thanks. The data load was fine, I've used your script with the
 BathInserter. Memory footprint was really slow, I think the peak was 200mb
 of heap usage. I did something really retarded and left a logger.info,
 which slowed things a bit, but the process was really smooth.
 
 Many thanks on the help with the query. I'll try this, I'm putting the
 readonlyembedded neo inside our app right now. I expect to see some good
 performance boost :)
 
 Best Regards
 
 On Wed, Nov 23, 2011 at 12:12 PM, Michael Hunger 
 michael.hun...@neotechnology.com wrote:
 
 Vinicius,
 
 first: did you have any issues importing the data into Neo4j?
 second: your example used cypher which is not optimized for performance
 (yet!). This is in our plans for the next two releases of neo4j.
 
 So if you want to see the real performance of neo4j, please use the
 traversal framework or the core-API:
 
 Cypher  Traversals:
 
 // define
 cypherQuery = cypherParser.parse(start n=node({start_node}) match
 n--()--x return x)
 traversalQuery =
 Traversal.description().evaluator(Evaluators.atDepth(2)).expand(Traversal.expanderForAllTypes(Direction.OUTGOING))
 
 // execute
 for (Node n : cypherQuery.execute({start_node:startNode})) { ... }
 for (Node n : traversalQuery.traverse(startNode).nodes()) { ... }
 
 If you're interested in the paths, remove the .nodes() call at the
 traverser
 
 In java core-api code:
 
 Node start=db.getNodeById(3);
 
 for (Relationship rel=start.getRelationships()) {
   Node second = rel.getOtherNode(start);
   for (Relationship rel=second.getRelationships()) {
   Node third = rel.getOtherNode(second);
   // do something with the 3 nodes, 2 relationships which form your
 path
   }
 }
 
 In the REST API the traversal would look like: (see
 http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html#rest-api-traversal-using-a-return-filter
 )
   * POST http://localhost:7474/db/data/node/3/traverse/node
   * Accept: application/json
   * Content-Type: application/json
 
 {
 relationships : [ {direction : out } ],
 max_depth : 3
 }
 
 
 Am 23.11.2011 um 11:54 schrieb Vinicius Carvalho:
 
 Hi there, I've posted a few days ago about the POC I'm doing here at my
 company. I have some initial numbers and I'd like to ask for some help
 here
 in order to promote neo4j here in LMI Ericsson.
 
 I've loaded a mySQL db with a really simple entity, that pretty much only
 represents a node and relations (only properties it has is an UID and x/y
 space coordinate for each node)
 
 The DB contains 250.000 cells and 19. relations stored in a myISAM table,
 indexed only by it's primary key. Please find the DDL for the two tables.
 
 CREATE TABLE  `pci`.`cells` (
 `id` varchar(32) collate utf8_bin NOT NULL,
 `x_pos` double default NULL,
 `y_pos` double default NULL,
 `pci` smallint(6) default '0',
 PRIMARY KEY  (`id`)
 )
 
 CREATE TABLE  `pci`.`relations` (
 `id` int(11) NOT NULL auto_increment,
 `source` varchar(32) collate utf8_bin default NULL,
 `target` varchar(32) collate utf8_bin default NULL,
 PRIMARY KEY  (`id`),
 KEY `src_idx` (`source`),
 KEY `src_target` (`target`)
 )
 
 So as you can see, a simple secondary table contains the relationship
 with
 source and targets pointing to the cells table.
 
 I've loaded this exact same DB into a neoserver running on the same
 machine: A Blade with 26 cpus (6 cores each) and 16gb RAM.
 
 One of the requirements we have is to find all associations of my
 associations. Something that in neo I did like this:
 
 START n = node(3)
 MATCH n--()--(x)
 return x
 
 For this specific node it returns 6475 nodes.
 
 I have tested this before using Hibernate in two modes: without a L2
 cache,
 and with an L2 Cache (Ehcache standalone no replication).
 Here's a snippet of the code that loads it, so you can understand what's
 going under the hood:
 
 
 @Override
 public ListCell loadCellWithRealtions(String... ids) {
 Session session = (Session) em.getDelegate();
 Criteria c = session.createCriteria(Cell.class)
 .setFetchMode(incomingRelations, FetchMode.SELECT)
 .setFetchMode(outgoingRelations, FetchMode.SELECT)
 .add(Restrictions.in(id, Arrays.asList(ids)));
 ListCell results = c.list();
 for(Cell cell : results){
 Hibernate.initialize(cell.getIncomingRelations());
 Hibernate.initialize(cell.getOutgoingRelations());
 }
 return results;
 }
 
 @Override
 public ListCell loadCellWithNeighbourRelations(String... ids) {
 ListCell cells = loadCellWithRealtions(ids);
 for(Cell c : cells){
 for(Relation r : c.getIncomingRelations()){
 Hibernate.initialize(r.getSource().getIncomingRelations());
 Hibernate.initialize(r.getSource().getOutgoingRelations());
 }
 for(Relation r : c.getOutgoingRelations()){
 Hibernate.initialize(r.getTarget().getIncomingRelations());
 Hibernate.initialize

Re: [Neo4j] How to boost performance?

2011-11-23 Thread Michael Hunger
Just make sure that it is just a snapshot of the data and doesn't update its 
caches.

Otherwise you will run into synchronization issues.

See also this thread and Tobias' explanations around it:
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Synchronization-of-EmbeddedReadOnlyGraphDatabase-Bug-td3174626.html#a3213450

Michael

Am 23.11.2011 um 15:05 schrieb Vinicius Carvalho:

 But wouldn't it mean that I need to have exclusive lock on the db? I would
 like to keep the server running pointing at the same data directory.
 
 Regards
 
 On Wed, Nov 23, 2011 at 1:50 PM, Michael Hunger 
 michael.hun...@neotechnology.com wrote:
 
 Please use EmbeddedGraphDatabase,
 
 EmbeddedReadOnlyGraphDatabase caches a snapshot of the data in its caches
 and doesn't get update-changes.
 
 Michael
 
 Am 23.11.2011 um 14:39 schrieb Vinicius Carvalho:
 
 Hi Michael, thanks. The data load was fine, I've used your script with
 the
 BathInserter. Memory footprint was really slow, I think the peak was
 200mb
 of heap usage. I did something really retarded and left a logger.info,
 which slowed things a bit, but the process was really smooth.
 
 Many thanks on the help with the query. I'll try this, I'm putting the
 readonlyembedded neo inside our app right now. I expect to see some good
 performance boost :)
 
 Best Regards
 
 On Wed, Nov 23, 2011 at 12:12 PM, Michael Hunger 
 michael.hun...@neotechnology.com wrote:
 
 Vinicius,
 
 first: did you have any issues importing the data into Neo4j?
 second: your example used cypher which is not optimized for performance
 (yet!). This is in our plans for the next two releases of neo4j.
 
 So if you want to see the real performance of neo4j, please use the
 traversal framework or the core-API:
 
 Cypher  Traversals:
 
 // define
 cypherQuery = cypherParser.parse(start n=node({start_node}) match
 n--()--x return x)
 traversalQuery =
 
 Traversal.description().evaluator(Evaluators.atDepth(2)).expand(Traversal.expanderForAllTypes(Direction.OUTGOING))
 
 // execute
 for (Node n : cypherQuery.execute({start_node:startNode})) { ... }
 for (Node n : traversalQuery.traverse(startNode).nodes()) { ... }
 
 If you're interested in the paths, remove the .nodes() call at the
 traverser
 
 In java core-api code:
 
 Node start=db.getNodeById(3);
 
 for (Relationship rel=start.getRelationships()) {
  Node second = rel.getOtherNode(start);
  for (Relationship rel=second.getRelationships()) {
  Node third = rel.getOtherNode(second);
  // do something with the 3 nodes, 2 relationships which form your
 path
  }
 }
 
 In the REST API the traversal would look like: (see
 
 http://docs.neo4j.org/chunked/snapshot/rest-api-traverse.html#rest-api-traversal-using-a-return-filter
 )
  * POST http://localhost:7474/db/data/node/3/traverse/node
  * Accept: application/json
  * Content-Type: application/json
 
 {
 relationships : [ {direction : out } ],
 max_depth : 3
 }
 
 
 Am 23.11.2011 um 11:54 schrieb Vinicius Carvalho:
 
 Hi there, I've posted a few days ago about the POC I'm doing here at my
 company. I have some initial numbers and I'd like to ask for some help
 here
 in order to promote neo4j here in LMI Ericsson.
 
 I've loaded a mySQL db with a really simple entity, that pretty much
 only
 represents a node and relations (only properties it has is an UID and
 x/y
 space coordinate for each node)
 
 The DB contains 250.000 cells and 19. relations stored in a myISAM
 table,
 indexed only by it's primary key. Please find the DDL for the two
 tables.
 
 CREATE TABLE  `pci`.`cells` (
 `id` varchar(32) collate utf8_bin NOT NULL,
 `x_pos` double default NULL,
 `y_pos` double default NULL,
 `pci` smallint(6) default '0',
 PRIMARY KEY  (`id`)
 )
 
 CREATE TABLE  `pci`.`relations` (
 `id` int(11) NOT NULL auto_increment,
 `source` varchar(32) collate utf8_bin default NULL,
 `target` varchar(32) collate utf8_bin default NULL,
 PRIMARY KEY  (`id`),
 KEY `src_idx` (`source`),
 KEY `src_target` (`target`)
 )
 
 So as you can see, a simple secondary table contains the relationship
 with
 source and targets pointing to the cells table.
 
 I've loaded this exact same DB into a neoserver running on the same
 machine: A Blade with 26 cpus (6 cores each) and 16gb RAM.
 
 One of the requirements we have is to find all associations of my
 associations. Something that in neo I did like this:
 
 START n = node(3)
 MATCH n--()--(x)
 return x
 
 For this specific node it returns 6475 nodes.
 
 I have tested this before using Hibernate in two modes: without a L2
 cache,
 and with an L2 Cache (Ehcache standalone no replication).
 Here's a snippet of the code that loads it, so you can understand
 what's
 going under the hood:
 
 
 @Override
 public ListCell loadCellWithRealtions(String... ids) {
 Session session = (Session) em.getDelegate();
 Criteria c = session.createCriteria(Cell.class)
 .setFetchMode(incomingRelations, FetchMode.SELECT)
 .setFetchMode(outgoingRelations, FetchMode.SELECT)
 .add(Restrictions.in

Re: [Neo4j] How to boost performance?

2011-11-23 Thread Michael Hunger
You might run into uniqueness constraints.

There are different uniqueness constraints that can be specified for a 
traversal, meaning how often is a node visited during one.
(see here: 
http://components.neo4j.org/neo4j/1.6-SNAPSHOT/apidocs/org/neo4j/kernel/Uniqueness.html)

You probably want to specify .uniqueness(Uniqueness.NODE_PATH)


And the java code is missing getRelationships(DIrection.OUTGOING) (twice!), 
sorry.

HTH

Michael

Am 23.11.2011 um 16:09 schrieb Vinicius Carvalho:

 Hi Michael, this is going to be a newbie question, so please forgive me:
 
 I've re ran the tests with your examples, and using a embedded database.
 First thing: Whooping FAST! Mind blowing :D - 5ms
 
 But ... I got different results, same time though which is great, proves
 the exact thing that happened on my local machine 1k nodes 5ms 250k nodes
 5ms :D
 
 Using cypher on the console
 start n = node(3) match n--()--(x) return x
 
 I got 6475 nodes, which seems to be right, as every node have around 80
 relations, so 80*80 would give me this.
 
 Using your first example (I probably got it wrong) with the new traversal:
 
 Node startNode = db.getNodeById(Long.valueOf(id));
 TraversalDescription traversalQuery =
 Traversal.description().evaluator(Evaluators.atDepth(2)).expand(Traversal.expanderForAllTypes(Direction.OUTGOING));
 long start = System.currentTimeMillis();
 for(Node n : traversalQuery.traverse(startNode).nodes()){
 count++;
 }
 long end = System.currentTimeMillis();
 return Fetched  + count +  nodes in  + (end-start) +  ms;
 
 It returns 196 nodes in 5ms
 
 And using the second one:
 
 Node startNode=db.getNodeById(3);
 long start = System.currentTimeMillis();
 for (Relationship rel : startNode.getRelationships()) {
   Node other = rel.getOtherNode(startNode);
   for(Relationship rr : other.getRelationships()){
   count++;
   }
 }
 long end = System.currentTimeMillis();
 return Fetched  + count +  nodes in  + (end-start) +  ms;
 
 Returns 25896 nodes in 5ms as well.
 
 Just trying to understand why I've got different results, again really
 newbie question, I'll dive into the docs of traversal a bit further, but if
 you could share a thought here would be great.
 
 Thanks
 
 
 On Wed, Nov 23, 2011 at 2:21 PM, Vinicius Carvalho
 java.vinic...@gmail.comwrote:
 
 Tks, for this test it's just a readonly graph now, so I don't think I'll
 run into synchronization issues. As we proceed with tests, I do hope that
 we will have one day is a HA version of neo4j. And as Jim's said in that
 thread, use it for other to read the graph.
 
 Regards
 
 
 On Wed, Nov 23, 2011 at 2:15 PM, Michael Hunger 
 michael.hun...@neotechnology.com wrote:
 
 Just make sure that it is just a snapshot of the data and doesn't update
 its caches.
 
 Otherwise you will run into synchronization issues.
 
 See also this thread and Tobias' explanations around it:
 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Synchronization-of-EmbeddedReadOnlyGraphDatabase-Bug-td3174626.html#a3213450
 
 Michael
 
 Am 23.11.2011 um 15:05 schrieb Vinicius Carvalho:
 
 But wouldn't it mean that I need to have exclusive lock on the db? I
 would
 like to keep the server running pointing at the same data directory.
 
 Regards
 
 On Wed, Nov 23, 2011 at 1:50 PM, Michael Hunger 
 michael.hun...@neotechnology.com wrote:
 
 Please use EmbeddedGraphDatabase,
 
 EmbeddedReadOnlyGraphDatabase caches a snapshot of the data in its
 caches
 and doesn't get update-changes.
 
 Michael
 
 Am 23.11.2011 um 14:39 schrieb Vinicius Carvalho:
 
 Hi Michael, thanks. The data load was fine, I've used your script with
 the
 BathInserter. Memory footprint was really slow, I think the peak was
 200mb
 of heap usage. I did something really retarded and left a logger.info
 ,
 which slowed things a bit, but the process was really smooth.
 
 Many thanks on the help with the query. I'll try this, I'm putting the
 readonlyembedded neo inside our app right now. I expect to see some
 good
 performance boost :)
 
 Best Regards
 
 On Wed, Nov 23, 2011 at 12:12 PM, Michael Hunger 
 michael.hun...@neotechnology.com wrote:
 
 Vinicius,
 
 first: did you have any issues importing the data into Neo4j?
 second: your example used cypher which is not optimized for
 performance
 (yet!). This is in our plans for the next two releases of neo4j.
 
 So if you want to see the real performance of neo4j, please use the
 traversal framework or the core-API:
 
 Cypher  Traversals:
 
 // define
 cypherQuery = cypherParser.parse(start n=node({start_node}) match
 n--()--x return x)
 traversalQuery =
 
 
 Traversal.description().evaluator(Evaluators.atDepth(2)).expand(Traversal.expanderForAllTypes(Direction.OUTGOING))
 
 // execute
 for (Node n : cypherQuery.execute({start_node:startNode})) { ... }
 for (Node n : traversalQuery.traverse(startNode).nodes()) { ... }
 
 If you're interested in the paths, remove the .nodes() call at the
 traverser
 
 In java core-api code:
 
 Node start=db.getNodeById(3

Re: [Neo4j] Batch uploading to REST server

2011-11-22 Thread Michael Hunger
I think the main overhead comes from parsing the JSON (it's not streamed 
parsing imho).

That's why I suggest you try to split your big file into smaller ones (e.g. 
your 1.5k ones or half the size).

And then execute multiple requests in parallel to the neo4j server to import 
the data.
With your 8cores you should be able to run at least 16 parallel requests 
(probably even 32).

Otherwise I agree with Peter and would love to see your file (you can also send 
it off-list to either of us).

Cheers

Michael

Am 22.11.2011 um 14:19 schrieb Peter Neubauer:

 Hi there,
 
 On Tue, Nov 15, 2011 at 6:50 PM, vistorve ayuskaus...@compete.com wrote:
 I setup visualvm with a jmx connection to the server running neo4j I wasn't
 able to CPU profiling working, it had an error message saying
 getThreadCpuTime was expecting long but got something else. I do have thread
 and heap dumps though if those would be useful.
 Would like to see the error here, might be a bug?
 
 
 When I was running the batch upload I saw that the CPU usage never went over
 one core ~15% total cpu usage.
 
 Also I noticed that when I did a batch job of 1.5k nodes, 3k relationships
 the network usage would spike and be consistent and then fall for the upload
 and then spike and fall again for the read back from the server. However
 when I did 15k nodes and 30k relationships the network would spike, fall and
 then have short regular spike of only a couple KB/s. Is there some internal
 paging going on with the REST server, why doesn't it transfer the file all
 at once and then process it?
 
 I think there might be something happening internally, maybe a GC,
 before continuing to read the input stream from the socket. However,
 can't see that in the code, it's probably best to get a testcase from
 you on this?
 
 The 1.5k job took about 25 seconds, the 15k job took 1220 seconds.
 
 Below is the configuration I have for the server, the machine itself has
 32GB of ram and 8 64bit cores:
 -XX:+DisableExplicitGC
 -XX:+UseParallelGC
 -XX:+UseNUMA
 -Xss1024m
 -Xms2048m
 -Xmx4056m
 
 Neo4j properties:
 neostore.nodestore.db.mapped_memory=300M
 neostore.relationshipstore.db.mapped_memory=600M
 neostore.propertystore.db.mapped_memory=600M
 neostore.propertystore.db.strings.mapped_memory=1024M
 neostore.propertystore.db.arrays.mapped_memory=1024M
 cache_type=strong
 use_memory_mapped_buffers=false
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Batch-uploading-to-REST-server-tp340p3510431.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


Re: [Neo4j] Loading large dataset

2011-11-21 Thread Michael Hunger
Vinicius,

as Peter said, good idea.

Please try to avoid lucene index lookups during the import (use a hashmap cache 
String, Node or String,Long instead).

If you want to have ultrafast import, please use the batch-inserter API,

for an example look here: https://gist.github.com/1375679

Cheers

Michael
 
Am 21.11.2011 um 11:06 schrieb Vinicius Carvalho:

 Hi there! Continuing our trials with neo4j, I need to load a reasonable
 amount of data (250k nodes + 20M relationships) into a neo server.
 
 This data lives in a mySQL db and a mongodb.
 
 For obvious reasons I'm not going to use the REST API for that, but I'd
 also would like to avoid using a plugin (I need some more control using
 Spring beans).
 
 So my question is:
 
 Would it be a bad idea, turning off the neo4j server, and running a java
 app with an embedded neo4j instance pointing to the storage of the server,
 load it up with all data, and then restart the server? I just wanna be
 clear that I'm not doing something stupid or ugly here :)
 
 Also, our IDs are all varchars (they came from mongo, so it's a big HEX
 String), is it possible to use a different ID besides long on neo? Or will
 I need to create a property and index it for retrieval?
 
 Many thanks
 ___
 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] Loading large dataset

2011-11-21 Thread Michael Hunger
Sounds great, if you need any help just ping me.

Yes read performance should soar,

are the numbers you provided (250k nodes + 20M relationships) your real dataset
or what is the data amount that you think you see in production.

You can also answer that off-list :) (to Peter and me).

Cheers

Michael

Am 21.11.2011 um 12:11 schrieb Vinicius Carvalho:

 Thank you both for helping out. This list is just the best :D
 
 Michael I was considering that, now that you said, I'm definitely going to
 do it, use a hashmap to store the nodes as they get inserted, and then
 lookup there to create the relations.
 
 I'll have a look at the batch-inserter thanks.
 
 I'm doing a POC at LMI Ericsson, I strongly belive that neo4j is the answer
 for our network topology storage, not relational data. I just need to show
 some numbers to get more ppl on board, I have *no* doubt that traversing
 the network will be 1000x faster on neo than doing hundreds of SQL joins :)
 
 Regards
 
 On Mon, Nov 21, 2011 at 10:42 AM, Michael Hunger 
 michael.hun...@neotechnology.com wrote:
 
 Vinicius,
 
 as Peter said, good idea.
 
 Please try to avoid lucene index lookups during the import (use a hashmap
 cache String, Node or String,Long instead).
 
 If you want to have ultrafast import, please use the batch-inserter API,
 
 for an example look here: https://gist.github.com/1375679
 
 Cheers
 
 Michael
 
 Am 21.11.2011 um 11:06 schrieb Vinicius Carvalho:
 
 Hi there! Continuing our trials with neo4j, I need to load a reasonable
 amount of data (250k nodes + 20M relationships) into a neo server.
 
 This data lives in a mySQL db and a mongodb.
 
 For obvious reasons I'm not going to use the REST API for that, but I'd
 also would like to avoid using a plugin (I need some more control using
 Spring beans).
 
 So my question is:
 
 Would it be a bad idea, turning off the neo4j server, and running a java
 app with an embedded neo4j instance pointing to the storage of the
 server,
 load it up with all data, and then restart the server? I just wanna be
 clear that I'm not doing something stupid or ugly here :)
 
 Also, our IDs are all varchars (they came from mongo, so it's a big HEX
 String), is it possible to use a different ID besides long on neo? Or
 will
 I need to create a property and index it for retrieval?
 
 Many thanks
 ___
 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
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Exporting Neo4j subgraphs to graphml/gexf....

2011-11-21 Thread Michael Hunger
It is probably best to export a set of paths as a subgraph as they are returned 
from cypher and the traversal framework.

And it is trivial to handle a single node as Path[0] or Path[1]
and a single relationship as Path[1].

I don't think that it would be a part of core but rather a additional library.

Perhaps something like graph-collections. 

We could also integrate the geoff support in there, which would mean:
* geoff
* graphml
* gefx
* graphviz

support.

I would encourage the community to go ahead with this and we would support it 
as part of our community effort.
We can host the repository at github.com/neo4j (or neo4j-contrib) and make you 
contributors.

We should also look into what the tinkerpop stack already provides and not 
duplicate too many things.

Cheers

Michael


Am 21.11.2011 um 12:54 schrieb Pablo Pareja:

 Hi,
 
 I was wondering whether there's (or are any plans to implement) any way to
 export sub-graphs to graphml/gexf files?
 I did a quick google search and found this:
 
 http://stackoverflow.com/questions/2204440/convert-neo4j-db-to-xml
 
 However I think it'd be better being able to do this as part of Neo4j core
 API,  so that once you are situated in an specific node/relationship of the
 graph you could just export its neighborhood (specifying some parameters
 like depth) to one of these formats.
 Cheers,
 
 Pablo
 
 -- 
 Pablo Pareja Tobes
 
 My site http://about.me/pablopareja
 LinkedInhttp://www.linkedin.com/in/pabloparejatobes
 Twitter   http://www.twitter.com/pablopareja
 
 Creator of Bio4j -- http://www.bio4j.com
 
 http://www.ohnosequences.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] Getting unrelated

2011-11-21 Thread Michael Hunger
Can you show the relevant parts of your class definitions?

@NodeEntity
class Collection {
@RelatedTo(type=PART_OF, Direction.INCOMING)
SetEntry entries;
}

@NodeEntity class Entry {}

you can do:

CollectionEntry allEntries = template.repositoryFor(Entry.class).findAll()

SetEntry entries = collection.getEntries();
allEntries.removeAll(entries);

Or as Peter noted you could use cypher and optional relationships. A query like:


start collection = node(id), entry = node(ids)
match collection-[r?:PART_OF]-entry
where r is NULL
return entry

for the start clause you might also use index-lookups for collection, like this 
or similar
start collection = node:Collection(name={param})

if you want to have all objects of a certain type (as they are index as part of 
the TypeRepresentationStrategy, which is the indexing one by default).
entry = node:__types__(className=com.example.Entry)

Cheers

Michael

Am 21.11.2011 um 17:14 schrieb Spektrum:

 Suppose there are two types of nodes: Entry node and Collection node, glued
 by PART_OF relationship.
 How can I get entry nodes which DO NOT belong to the specified collection? 
 P.S. I'm using Spring Data Neo4j
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Getting-unrelated-tp3525157p3525157.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] Neo4j server plugin

2011-11-20 Thread Michael Hunger
no they are in
org.neo4j.app:server:1.5

mobile mail please excuse brevity and typos

Am 20.11.2011 um 13:29 schrieb Shireesh ashirees...@gmail.com:

 Hi Michael,
 
 I was not able to get the specific classes ( DatabaseActions and
 TraverserReturnType) in server-api-1.4.2 jar
 Can you guide me in getting the dependency jar for DatabaseActions and
 TraverserReturnType classes.
 
 Thanks,
 Shireesh.
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-server-plugin-tp3521193p3522610.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] Neo4j server plugin

2011-11-20 Thread Michael Hunger
right you don't need those classes just an inspiration from the code

mobile mail please excuse brevity and typos

Am 20.11.2011 um 14:19 schrieb Jim Webber j...@neotechnology.com:

 Hi Shrieesh,
 
 Take a look here:
 
 http://mvnrepository.com/artifact/org.neo4j/server-api/1.5
 
 You'll get the Maven/Ivy/whatever config you need for those dependencies.
 
 Jim
 ___
 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] Recommended server configurations

2011-11-19 Thread Michael Hunger
the batch API also has batch insertion operations

could describe your domain model w/ estimated counts of entities and 
cardinalities.

snd equally important the typical usecases and what percentages of the dataset 
they would touch

mobile mail please excuse brevity and typos

Am 18.11.2011 um 22:56 schrieb José Devezas joseluisdeve...@gmail.com:

 You can use Neo Technology's Hardware Sizing Calculator to estimate the
 CPU, RAM and disk space needed for your set up prediction:
 http://neotechnology.com/calculator/trial.html
 
 If you're not doing a batch insertion, the REST API would be fine I guess,
 specially if you put the database on a separate machine.
 
 On Fri, Nov 18, 2011 at 8:02 PM, Jacob Hansson 
 jacob.hans...@neotechnology.com wrote:
 
 On Fri, Nov 18, 2011 at 7:21 PM, gustavoboby gustavob...@gmail.com
 wrote:
 
 Hi people's,
 
 I'm creating a social network with a larg number of expected hits and i
 need
 help with
 the server recommended configurations:
 
 1 - Operating system (Linux or Windows? What specifically?)
 
 
 If you have the choice, Linux is preferable. We fully support both
 platforms, but generally get higher performance on Linux, and less
 problems.
 
 
 2 - Hardware (How much Memory necessary?)
 
 
 This completely depends on how much data you intend to store. Can you
 provide an estimation of how big your dataset would be? Number of nodes,
 number of relationships per nodes, and how many properties (on both nodes
 and relationships), and what types of property values.
 
 
 
 You think the use of Neo4j REST API will cause problem? I use it to
 develop
 my Asp.Net
 applications
 
 
 It depends on how you use it. Generally, you will get reasonable insert
 speed if the client you use supports the batch operations part of the REST
 API, query speed will depend on the query of course. You will get
 significantly better performance with the embedded database right now, but
 that is only available in JVM languages and Python.
 
 
 I am open to suggestions!!
 
 I thank the help.
 
 --
 View this message in context:
 
 http://neo4j-community-discussions.438527.n3.nabble.com/URGENT-Recommended-server-configurations-tp3519328p3519328.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
 
 
 
 
 --
 Jacob Hansson
 Phone: +46 (0) 763503395
 Twitter: @jakewins
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
 
 
 
 
 -- 
 José Devezas - http://www.josedevezas.com
 MSc Informatics and Computing Engineering
 Social Media and Network Theory Research
 ___
 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] Neo4j server plugin

2011-11-19 Thread Michael Hunger
Your plugin should get the start and end node via the plugin API:
http://docs.neo4j.org/chunked/snapshot/server-plugins.html (see the GetAll.java 
example).

And then execute something like this (from DatabaseActions.traverse()).
using: TraverserReturnType.FullPath

public ListRepresentation traverse( long startNode,
MapString, Object description, TraverserReturnType returnType )
{
Node node = graphDb.getNodeById( startNode );

ListRepresentation result = new ArrayListRepresentation();

TraversalDescription traversalDescription = 
TraversalDescriptionBuilder.from( description );
for ( Path position : traversalDescription.traverse( node ) )
{
MappingRepresentation representation = returnType.toRepresentation( 
position );
if ( representation != null )
{
result.add( representation );
}
}

return new ListRepresentation( returnType.repType, result );
}

HTH

Michael

Am 19.11.2011 um 17:53 schrieb Shireesh:

 Hi All,
 
 I am new to neo4j and been trying to use server plugin.
 
 Iam working on getting all paths between two nodes using GraphAlgoFactory
 getAllPaths.
 
 The problem is i need the same response as we get when using Neo4j server
 api Traversal fullpath.
 /fullpath - contains full representations of all nodes and relationships/
 
 
 Thankz in advance.
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-server-plugin-tp3521193p3521193.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] Batch Insert : poooor performance

2011-11-18 Thread Michael Hunger
Please try not to use lucene for lookups during batch-inserts just index your 
nodes (for later use) but use a custom, in memory cache for the insertion 
process.

customID - nodeId, like MapString,Long.

Using lucene for lookups takes up to 1000 times longer during batch - inserts 
(probably, as the merge threads in the background have to finish up before you 
can include their
results in the query).

the luceneBatchInserterIndex.setCacheCapacity() seems not to work as expected, 
we will investigate that.

Cheers

Michael

Here is the original post:

Hi, 
I am in almost the same case as a previous post concerning Batch Insert poor 
performance 
but, I still can figure out how to do it correctly with good performances. 

Nodes: 30 millions 
Relationships : 250 millions 

I am on a MacOSX 10.7.1, 4 cpus, 8Go RAM 
1) Insert Nodes : 
JVM -server -d64 -Xmx4G -XX:+UseParNewGC -XX:+UseNUMA -XX:+UseConcMarkSweepGC 
from 80 000 down to 50 000 inserts / seconds with properties (customID,url) 
with LuceneIndexing on customID and url 
a bit disappointing 

2) Insert Relationships 
JVM -server -d64 -Xmx6G -XX:+UseParNewGC -XX:+UseNUMA -XX:+UseConcMarkSweepGC 
Index cache capacity 30 000 000 (whole nodes) on customID 
neostore.nodestore.db.mapped_memory=300M 
neostore.relationshipstore.db.mapped_memory=1G 
neostore.propertystore.db.mapped_memory=2.2G 
neostore.propertystore.db.strings.mapped_memory=100M 
neostore.propertystore.db.arrays.mapped_memory=10M 

= insertion rate ~ 50 relationships / seconds 
and going down ... 

(many many tests ... but always very poor performances) 

Do you have any idea, on how to have this work correctly ? 

I am really stuck here 

if you want to have a look at my code : no issues ! :) 

Many many thanks for your help 

Am 18.11.2011 um 12:47 schrieb Krzysztof Raczyński:

 Btw, inserting 600k nodes over REST with about 8 properties in batches
 of 100 takes 20-30minutes for me. It's not awesomely fast, but it's
 not slow either. What settings are affecting insertion speeds, Peter?
 ___
 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] Help Needed: Creating a Neo4j Cheat Sheet / Reference Card

2011-11-17 Thread Michael Hunger
Dear Graphistas,

today we would like to ask for your contribution in our efforts to create an 
introductional reference card for Neo4j.

We would like to publish it as a 6 page DZone Ref-Card but also include the 
content in our distribution / website.

We feel many people are overwhelmed when it comes to get started with Neo4j and 
also many mailing list/Stack Overflow questions
could be answered by pointing to that refcard.

We started collecting topics and content in a google document but think that 
the perspective of the community is much more useful than the one of the 
Neo4j core devteam because of its broader perspective.

Please come over here: 
https://docs.google.com/document/d/1TAPFgz4s5BxXmEJfOB0I4rIPu11syyCJmSCFJ_EXiaw/edit

and add/edit/comment what you think is important for someone coming to neo4j or 
using neo4j for the first months.

Thanks so much

Michael

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


Re: [Neo4j] Newbie question on server topology

2011-11-17 Thread Michael Hunger
If you're using spring you can also look into Spring Data Neo4j 
(http://spring.neo4j.org) 

(see the docs here: 
http://static.springsource.org/spring-data/data-graph/snapshot-site/reference/html/#reference:neo4j-server)

and its use of the SpringRestGraphDatabase and/or the java-rest-binding 
(https://github.com/neo4j/java-rest-binding).

You could also add a domain level server-extension to the neo4j server that 
talks a application specific protocol (instead of the generic REST protocol).

The best way is to do a PoC for your use-case(s) and measure the ease of use + 
performance for your domain model + data.

Haven't seen the RESTDataService you referenced, do you have any docs on that?

Cheers

Michael

Am 17.11.2011 um 14:34 schrieb Vinicius Carvalho:

 Hi there! I've being playing around with neo4j for a few weeks now. I'm
 using embedded graph db, and the data lives inside my developer machine.
 But now I need to turn things into a more production like stage.
 
 Coming from a traditional SQL world where we have our clusters of DB
 running in some servers and all AppServers accessing remotely via jdbc
 connections. I'm wondering what is the best approach with neo4j?
 
 Is REST the way to go when we have a separation from AppServers and the
 node servers? I've seen some ppl saying that one could use HA and have DBs
 collocated on each machine and have the HA capabilities to sync the
 storage, but I'd like to avoid this approach at all, we don't want to have
 graphdb servers and appservers on the same machine (not my call this
 decision unfortunately)
 
 It seems to me that Spring has some nice RESTDataService that wraps the
 REST API, so I'm considering going that way.
 
 Just wondering what would be a recommend strategy for this.
 
 Regards
 ___
 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] Neo4j HA and Spring Data Graph 1.1

2011-11-17 Thread Michael Hunger
Hi Karthik,

You have to do the normal Neo4j HA setup 
(http://docs.neo4j.org/chunked/snapshot/ha.html).

* add the additional dependencies to your project org.neo4j:neo4j-ha:1.5
* running 3 coordinators (either download neo4j-enterprise and use 
start-coordinator or start the zookeeper instances programmatically)
* configure Spring Data Neo4j to use the HighlyAvailableGraphDatabase and 
provide the necessary config

bean id=haDatabase class=org.neo4j.kernel.HighlyAvailableGraphDatabase
destroy-method=shutdown
constructor-arg index=0 value=target/config-test/
constructor-arg index=1
map
entry key=ha.server_id value=1/
entry key=ha.server value=localhost:6001/
entry key=ha.coordinators 
value=localhost:2181,localhost:2182,localhost:2183/
/map
/constructor-arg
/bean

neo4j:config graphDatabaseService=haDatabase/


If you have any further questions, please ask

Cheers

Michael

Am 17.11.2011 um 21:45 schrieb kv8:

 We have an Spring Data Graph implementation that is currently working great
 with the embedded neo4j database. We want to try out the HA setup and my
 understanding is you can run HA in embedded mode. 
 
 Assuming you have the HA configuration setup, would configuring the
 graphDatabaseService bean to use the HighlyAvailableGraphDatabase is all you
 need to do ?  I will keep you guys posted with my progress. 
 
 Thanks much,
 Karthik
 
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-HA-and-Spring-Data-Graph-1-1-tp3517015p3517015.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] Neo4j-Scala Wrapper 0.1.0 released

2011-11-17 Thread Michael Hunger
There is also Adriano's Scala Cypher DSL:
https://github.com/adrianoalmeida7/cypher-typesafe-scala

Michael

Am 17.11.2011 um 22:00 schrieb Andres Taylor:

 On Thu, Nov 17, 2011 at 9:55 PM, Peter Neubauer 
 peter.neuba...@neotechnology.com wrote:
 
 Actually,
 it might be an idea to look at this kind of DSL for Cypher, much along
 the (Scala) lines of Rickards Java-DSL,
 
 http://rickardoberg.wordpress.com/2011/11/14/creating-a-dsl-for-cypher-graph-queries/
 instead of trying to mimic literal Cypher Strings.
 
 
 Personally, I like Scala DSLs.
 
 IMVHO - Java DSLs look like they do because Java doesn't allow anything
 else, not because they are the best way to express a DSL. To forgo the very
 expressive possibilities that Scala opens up makes little sense to me. And,
 if you like the Cypher-DSL, you can already use it from Scala.
 
 But that's just me...
 
 Andrés
 ___
 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] Suggestions on materials for learning graph theory

2011-11-15 Thread Michael Hunger
Thanks for all the feedback, very helpful information.

Do you think after finishing the book, you could write up a blog post about the 
literature you've been suggested so far and
what you found helpful for people starting to dive into graphs, that would be a 
valuable resource. This and the last email
could be already a good starting point for the post.

Thanks a lot

Michael

Am 15.11.2011 um 22:30 schrieb S3Logic:

 Hey guys,
 
 I just wanted to follow up on this. After some more digging, I had some
 people suggest Introductory Graph Theory by Gary Chartrand. It seems to be
 an excellent text for a beginner, but I will update this post once I get
 through the rest of the book.
 
 Also, Max and Rick's suggestions were excellent. Marko's article 'The Graph
 Traversal Pattern' helped me fill in some gaps that, as a result, helped me
 to understand the Gremlin syntax better. I also just got my copy of Puzzles
 and Graphs. It was quite difficult to find, but this book is a ton of fun
 and it's a really really fun way to exercise some of the concepts I'm
 learning about. The book itself is worth buying and when you're done it's a
 unique vintage book to put on your shelf. There is a pdf online that's
 provided by the government so I'm assuming it's legal  but it only has 8-58
 pages (in the wrong order) and I can confirm that you lose some valuable
 pages:  http://www.eric.ed.gov/PDFS/ED035552.pdf. I reached out to the
 National Council of Teachers of Mathematics to suggest they publish the book
 again :)
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Suggestions-on-materials-for-learning-graph-theory-tp3490877p3510999.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] Confirming existence of relationship between two nodes

2011-11-13 Thread Michael Hunger
What version of Neo4j are you using? This query is valid syntax for 1.4.x and 
1.5.M01.

Later you would want to use:

 start a=node:nodeIndex(identifier='0') return a

And if you do in Java:
Node node = gds.index().forNodes(nodeIndex).get(identifier,0).getSingle()

then node is the user you want?

I'm not sure if that makes a difference, did you index your identifiers as 
Strings or numeric values?

Cheers

Michael

Am 14.11.2011 um 03:20 schrieb Gulshan Singh:

 Thanks, Cypher is pretty much what I was looking for. I'm a new user with
 neo4j, so I'm a little confused on how to integrate it with my application.
 
 I need to get a user from an index. This is how I've tried to do it,
 
 Query query = parser.parse(start a=(nodeIndex, identifier, '0') return a);
 ExecutionResult result = new ExecutionEngine(graphDb).execute(query);
 
 a returns with no nodes. I am positive that a node with an identifier of 0
 was added to my index and it is indexed properly (I can grab that user in
 Java from the index). This identifier is different than the neo4j default
 ids.
 
 
 On Sat, Nov 12, 2011 at 9:05 AM, D. Frej dieter_f...@gmx.net wrote:
 
 what about using e.g. a cypher query to get only thow nodes that have a
 relationship of RelType in between? What that be an option?
 
 
 
 Am 12.11.2011 02:04, schrieb gsingh93:
 I have two nodes, NodeA and NodeB, that are related by the relationship
 of
 type RelType. Is there a way I can confirm that these two nodes have this
 relationship? At the moment, I have to create an Iterable of
 relationships
 of that type connected to NodeA using getRelationships(RelType), and
 then I
 have to loop through each relationship and check the other node to see
 if at
 least one matches NodeB. This seems very inefficient to me. I'm hoping
 there
 is a built in method to check this for me, although I couldn't find one.
 I'm
 using Java.
 
 --
 View this message in context:
 http://neo4j-community-discussions.438527.n3.nabble.com/Confirming-existence-of-relationship-between-two-nodes-tp3501458p3501458.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
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Spring Forum Question: Best option for server based in memory data model with lots of calculations?

2011-11-12 Thread Michael Hunger
Hi,

there has been a question on the spring forums about a good nosql database fit 
for a workflow / task management application. If anyone has some experience in 
that are and would like to pitch in it would be highly appreciated.

Thanks a lot

Michael

 davout has just replied to a thread you have subscribed to entitled - Best 
 option for server based in memory data model with lots of calculations? - in 
 the NoSQL forum of Spring Community Forums.
 
 This thread is located at:
 http://forum.springsource.org/showthread.php?117415-Best-option-for-server-based-in-memory-data-model-with-lots-of-calculationsgoto=newpost
 
 Here is the message that has just been posted:
 ***
 The calculations will be on demand.  
 
 For the sake of this discussion assume that the data model is a type of 
 project gantt chart, where subordinate tasks are linked and have various 
 starting and finishing dependencies.  One basic requirement will be the need 
 to support different planning scenarios, where for scenario 'A' the tasks 
 have one set of inter dependencies, and for scenario 'B' a different set.  
 The calculation engine has to review all the tasks to determine overall 
 project timelines, costs, critical paths etc.
 
 The user will have the ability to change any task level detail and/or 
 dependency in any of the scenarios with a desire to see the top level results 
 across all scenarios in real time.
 ***

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


Re: [Neo4j] Cypher: relationship between nodes as condition in WHERE

2011-11-12 Thread Michael Hunger
you can have optional checks for properties

mobile mail please excuse brevity and typos

Am 12.11.2011 um 15:16 schrieb D. Frej dieter_f...@gmx.net:

 ok, in my scenario it did not work due to a WHERE clause I had also 
 included in my query (in short: it lead to a SyntaxException as node 
 where checked for a property that not all nodes have).
 
 Thanks anyway
 
 
 
 Am 11.11.2011 22:43, schrieb Andres Taylor:
 On Fri, Nov 11, 2011 at 8:28 PM, D. Frejdieter_f...@gmx.net  wrote:
 
 Hi,
 
 how can I put the condition relationship between two nodes in the
 WHERE clause of a Cypher statement?
 
 I have the following Cypher (simplified):
 
 START p=...
 MATCH p-...path...-(d1), p-...differentpath...-(d2)
 
 and I only want those d1 and d2 nodes that have a relationship.
 
 I tried
 MATCH p-...path...-(d1), p-...differentpath...-(d2)--(d1)
 
 Why is this not working? Can you share the real query with us? This
 pseudo-query looks like it should work.
 
 Andrés
 ___
 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] overriding protected I underlyingObjectToObject(T object) return null

2011-11-11 Thread Michael Hunger
Jack,

can you provide some more context?
Where do you want to use it and what is what you are trying to achieve?

Thanks a lot

Michael

Am 11.11.2011 um 11:51 schrieb jbeau:

 Hello all,
 
 I stuck with returning null in underlyingObjectToObject.
 
 First of all, I have this class:
 
 public class ClosableIterableAdapterI, T extends IterableWrapperI, T
 implements IClosableIterable {
 
private final ClosableIterableT closableNodeIterable;
 
public static IF, TY ClosableIterableAdapterIF, TY
 from(ClosableIterableTY it) {
return new ClosableIterableAdapterIF, TY(it);
}
 
public ClosableIterableAdapter(ClosableIterableT closableNodeIterable)
 {
super(closableNodeIterable);
this.closableNodeIterable = closableNodeIterable;   
}
 
@SuppressWarnings(unchecked)
@Override
protected I underlyingObjectToObject(T object) {
// if (true) return (I) object;
// if (false) return null;
}
 
 So long ... it works. But the returned null values destroy my resulting
 collection. How can I remove them? I mean how I can avoid to return them?
 
 Thx a lot for every hint.
 Jack
 
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/overriding-protected-I-underlyingObjectToObject-T-object-return-null-tp3499362p3499362.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] persist() undefined

2011-11-11 Thread Michael Hunger
Hi,

How did you import the project? (STS 2.8 has imho some issues with the m2e 
plugin)

You might try to use the 2.0.0-SNAPSHOT of SDN, we are aiming to release the 
RC1 later today.

1) make sure that the project has the Aspectj nature switched on, it should 
show in the context-menu of the project and also a little AJ on the project icon
2) please have a look in your Project-Property AspectJ - Aspect-Path if both 
(spring-aspects and spring-data-neo4j-aspects) are listed there.
3) issue a clean of the project

Please report back if those things didn't help

Sorry for the inconvenience

Michael

Am 10.11.2011 um 20:13 schrieb Gr3y:

 Hello
 
 I'm having trouble getting STS to acknowledge that the method persist() on
 an nodeentity is valid.
 I'm using STS 2.8 which to my knowledge has the newest AJDT plugin.
 
 I don't know much about Neo4j yet, and I'm also a beginner with Spring, so
 maybe I forgot something.
 
 My project is controlled by maven, and is setup like so:
 
 Dependency:
 dependency
   groupIdorg.springframework.data/groupId
   artifactIdspring-data-neo4j/artifactId
   version2.0.0.M1/version
 /dependency
 
 Plugin:
 plugin
   groupIdorg.codehaus.mojo/groupId
   artifactIdaspectj-maven-plugin/artifactId
   version1.4/version
   configuration
   outxmltrue/outxml
   aspectLibraries
   aspectLibrary
   groupIdorg.springframework/groupId
   artifactIdspring-aspects/artifactId
   /aspectLibrary
   aspectLibrary
   groupIdorg.springframework.data/groupId
   artifactIdspring-data-neo4j/artifactId
   /aspectLibrary
   /aspectLibraries
   source1.6/source
   target1.6/target
   /configuration
   executions
   execution
   goals
   goalcompile/goal
   goaltest-compile/goal
   /goals
   /execution
   /executions
   dependencies
   dependency
   groupIdorg.aspectj/groupId
   artifactIdaspectjrt/artifactId
   version1.6.12.M1/version
   /dependency
   dependency
   groupIdorg.aspectj/groupId
   artifactIdaspectjtools/artifactId
   version1.6.12.M1/version
   /dependency
   /dependencies
 /plugin
 
 My entities are of course flagged with @NodeEntity
 
 Can anyone help me out?
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/persist-undefined-tp3497682p3497682.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] overriding protected I underlyingObjectToObject(T object) return null

2011-11-11 Thread Michael Hunger
Hey Jack, 

actually it is Dresden(Striesen) right now :)

you might look into org.neo4j.helpers.collection.FilteringIterable, which takes 
a predicate to allow you arbitrary filtering.


class FilteringClosableIterableT extends FilteringIterableT 
implements ClosableIterableT {
private final ClosableIterableT source;

public FilteringClosableIterable(ClosableIterableT source, 
PredicateT predicate) {
super(source, predicate);
this.source = source;
}

@Override
public void close() {
source.close();
}
}

ClosableIterablePerson people = ...
new FilteringClosableIterablePerson(people, new PredicatePerson() {
@Override
public boolean accept(Person item) {
return item != null;
}
});


Regarding Multi-Tenancy:

I spend some time thinking about multi-tenancy on the core-API level of Neo4j 
which should be more widely applicable.

something like new SingleTenantGraphDatabase(graphDatabaseService, tenantId);

which should just wrap all core-api methods to filter the stuff, for indexing 
there is the option of creating separate indexes with the tenant-Id as an 
suffix or prefix or filtering at the query level (probably the previous).

For all the other methods you just put a property on nodes and relationships 
that points to the tenant (which you have to filter out in the 
property-container methods).

And probably create different reference-nodes for each tenant.

That should be it.

Am 11.11.2011 um 12:07 schrieb jbeau:

 Hello Michael,
 
 greetings to the Neustadt :)
 
 I try to realize a multi tenancy environment and started with a first
 approach. In a abstract repository I call methods like this:
 
 @Override
 public IClosableIterable findByName(final String name) {
 return
 ClosableIterableAdapter.from(getGraphRepository().findAllByPropertyValue(name,
 name));
 }
 
 In the ClosableIterableAdapter I posted above I want to avoid putting all
 entities into the iterator, which are not valid for the current tenant. The
 underlyingObjectToObject() forces to return something. In my case, the non
 valid entities are null. I guess it's not a good idea, to filter them later.
 I think I have to avoid to put them into the iterator here.
 
 Thx for help
 Jack
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/overriding-protected-I-underlyingObjectToObject-T-object-return-null-tp3499362p3499393.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] persist() undefined

2011-11-11 Thread Michael Hunger
That should be enough.

Can you share your maven config?

Did you build your project upon on of the example projects (like 
helloworld-aspects or cineasts-aspects) ?

If not, try to import on those into STS and see if the same issues  arise.

Michael

Am 11.11.2011 um 13:14 schrieb Gr3y:

 Hey 
 
 You are helping me out, no need to be sorry about anything. :) 
 
 I imported the project via ImportMaven project 
 
 1) This should be on. There is a little AJ in the project icon (slightly
 concealed behind the M icon though). 
 2) Both spring-aspects and spring-data-neo4j-aspects are listed. 
 3) I often clean, and it unfortunately didn't help. :\ 
 
 I tried the SNAPSHOT, and it didnt work either. 
 
 Does the aspects need xml configuration or something, cause I have none of
 that. 
 My entities look like this: 
 ... 
 @NodeEntity 
 public class Visitor implements IVisitor { 
 ... 
 
 This should be enough to make SDN magic work? 
 
 Thanks for helping Michael!
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/persist-undefined-tp3497682p3499530.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] py2neo 0.982

2011-11-11 Thread Michael Hunger
Nigel,

Sounds good, although I'd rather have named parameters as well, otherwise 
parameter indexes will easily get unwieldy.

I would like to propose to use the same syntax cypher uses for parameters 
(that's also the syntax used by the batch-inserter)

aka. {0} and {name}

 (dad)-[:FATHER_OF]-(son2)
 {1}-[:FAMILY]-(dad)

Might be a bit confusing wrt the json, But I want consistency :)

Interesting part would also be when those parameters not only refer to a single 
node or relationship but an collections of those.

So one could take the output of a traversal or cypher query (with aliases or 
position) and pass them into the geoff reader which then connects or updates 
all of them appropriately.

Allowing us to do mass-updates or structural connections in one go.

(dad)-[:FATHER_OF]-{children}
{children} {lastname : Small}

Btw. that reminds me of a version of the geoff syntax that might compact many 
files:
 (dad) {name:Nigel}
 (son1) {name:Joshua}
 (son2) {name:Stephen}
 (dad)-[:FATHER_OF]-(son1,son2)
 (son1,son2) {lastname,Small)

Michael

Am 12.11.2011 um 00:07 schrieb Nigel Small:

 Hi Peter
 
 Imagine we are trying to inject a simple graph, such as the following:
 
 (dad) {name:Nigel}
 (son1) {name:Joshua}
 (son2) {name:Stephen}
 (dad)-[:FATHER_OF]-(son1)
 (dad)-[:FATHER_OF]-(son2)
 
 Currently, this would be loaded into graphspace without any attachment to
 existing structures; a join would have to be made *after* the load.
 
 If we instead consider parameterising the load, e.g. loadIntoNeo4j(reader,
 graphDB, someNode, otherNode, ...), we can reference the supplied nodes
 from within the GEOFF data. I think that ($n) notation would be quite
 useful here as it is already familiar from bash etc. This might therefore
 turn the above subgraph into:
 *
 
 (dad) {name:Nigel}
 (son1) {name:Joshua}
 (son2) {name:Stephen}
 (dad)-[:FATHER_OF]-(son1)
 (dad)-[:FATHER_OF]-(son2)
 ($1)-[:FAMILY]-(dad)
 
 ...such that ($1) refers to the first supplied parameter, ($2) would be the
 second and so on. ($0) could possibly refer to the reference node of the
 destination graph, by definition.
 
 Hope this makes sense! What do you reckon?
 
 *
 *Nigel Small*
 Phone: +44 7814 638 246
 Blog: http://nigelsmall.name/
 GTalk: ni...@nigelsmall.name
 MSN: nasm...@live.co.uk
 Skype: technige
 Twitter: @technige https://twitter.com/#!/technige
 LinkedIn: http://uk.linkedin.com/in/nigelsmall
 
 
 
 On 11 November 2011 22:10, Peter Neubauer
 peter.neuba...@neotechnology.comwrote:
 
 Nigel,
 On Thu, Nov 10, 2011 at 11:01 PM, Nigel Small ni...@nigelsmall.name
 wrote:
 We could possibly create some form of syntax which would designate a
 this
 node, e.g. (@). This could allow a file to reference it's external
 context,
 in this case the node to which we are submitting the subgraph.
 What would this look like?
 
 /peter
 ___
 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] Sampling a Neo4j instance?

2011-11-10 Thread Michael Hunger
Probably using an index for your nodes (could be an auto-index).

And then using an random shuffling of the results? You can pass in a lucene 
query object or query string to index.query(queryOrQueryObject).

Sth like this 
http://stackoverflow.com/questions/7201638/lucene-2-9-2-how-to-show-results-in-random-order

perhaps there is also some string based lucene query/sort syntax for it.

Michael

Am 10.11.2011 um 11:01 schrieb Chris Gioran:

 Answers inline.
 
 2011/11/9 Anders Lindström andli...@hotmail.com:
 
 Thanks to the both of you. I am very grateful that you took your time to put 
 this into code -- how's that for community!
 I presume this way of getting 'highId' is constant in time? It looks rather 
 messy though -- is it really the most straightforward way to do it?
 
 This is the safest way to do it, that takes into consideration crashes
 and HA cluster membership.
 
 Another way to do it is
 
 long highId = db.getConfig().getIdGeneratorFactory().get( IdType.NODE
 ).getHighId();
 
 which can return the same value with the first, if some conditions are
 met. It is shorter and cast-free but i'd still use the first way.
 
 getHighId() is a constant time operation for both ways described - it
 is just a field access, with an additional long comparison for the
 first case.
 
 I am thinking about how efficient this will be. As I understand it, the 
 sampling misses come from deleted nodes that once was there. But if I 
 remember correctly, Neo4j tries to reuse these unused node indices when new 
 nodes are added. But is an unused node index _guaranteed_ to be used given 
 that there is one, or could inserting another node result in increasing 
 'highId' even though some indices below it are not used?
 
 During the lifetime of a Neo4j instance there is no id reuse for Nodes
 and Relationships - deleted ids are saved however and will be reused
 the next time Neo4j starts. This means that if during run A you
 deleted nodes 3 and 5, the first two nodes returned by createNode() on
 the next run will have ids 3 and 5 - so highId will not change.
 Additionally, during run A, after deleting nodes 3 and 5, no new nodes
 would have the id 3 or 5. A crash (or improper shutdown) of the
 database will break this however, since the ids-to-recycle will
 probably not make it to disk.
 
 So, in short, it is guaranteed that ids *won't* be reused in the same
 run but not guaranteed to be reused between runs.
 
 My conclusion is that the sampling misses will increase with index usage 
 sparseness and that we will have a high rate of sampling misses when we 
 had many deletes and few insertions recently. Would you agree?
 
 Yes, that is true, especially given the cost of the wasted I/O and
 of handling the exception. However, this cost can go down
 significantly if you keep a hash set for the ids of nodes you have
 deleted and check that before asking for the node by id, instead of
 catching an exception. Persisting that between runs would move you
 away from encapsulated Neo4j constructs and would also be more
 efficient.
 
 Thanks again.
 Regards,Anders
 
 Date: Wed, 9 Nov 2011 19:30:36 +0200
 From: chris.gio...@neotechnology.com
 To: user@lists.neo4j.org
 Subject: Re: [Neo4j] Sampling a Neo4j instance?
 
 Hi,
 
 Backing Jim's algorithm with some code:
 
 public static void main( String[] args )
 {
 long SAMPLE_SIZE = 1;
 EmbeddedGraphDatabase db = new EmbeddedGraphDatabase(
 path/to/db/ );
 // Determine the highest possible id for the node store
 long highId = ( (NeoStoreXaDataSource)
 db.getConfig().getTxModule().getXaDataSourceManager().getXaDataSource(
 Config.DEFAULT_DATA_SOURCE_NAME )
 ).getNeoStore().getNodeStore().getHighId();
 System.out.println( highId +  is the highest id );
 long i = 0;
 long nextId;
 
 // Do the sampling
 Random random = new Random();
 while ( i  SAMPLE_SIZE )
 {
 nextId = Math.abs( random.nextLong() ) % highId;
 try
 {
 db.getNodeById( nextId );
 i++;
 System.out.println( id  + nextId +  is there );
 }
 catch ( NotFoundException e )
 {
 // NotFoundException is thrown when the node asked is not 
 in use
 System.out.println( id  + nextId +  not in use );
 }
 }
 db.shutdown();
 }
 
 Like already mentioned, this will be slow. Random jumps around the
 graph are not something caches can keep up with - unless your whole db
 fits in memory. But accessing random pieces of an on-disk file cannot
 be done much faster.
 
 cheers,
 CG
 
 On Wed, Nov 9, 2011 at 6:08 PM, Jim Webber j...@neotechnology.com wrote:
 Hi Anders,
 
 When you do getAllNodes, you're getting back an iterable so as you point 
 out the sample isn't random (unless it was written randomly to disk). If 
 you're prepared to 

Re: [Neo4j] How to get results from web admin console?

2011-11-10 Thread Michael Hunger
Which version of neo4j are you running?

Am 10.11.2011 um 15:32 schrieb yobi:

 This is kinda a noob issue :)
 
 I wanna try out web admin console using Cypher.
 
 But this is what I get:
 
 cypher START a = node(10)
 cypher RETURN a
 cypher 
 == `' expected but `n' found
 
 How do you get the results?
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/How-to-get-results-from-web-admin-console-tp3496848p3496848.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] Travers using curl

2011-11-10 Thread Michael Hunger
you forgot the first single quote after -d 

and you have single quotes in your string which you have to replace by double 
quotes

Am 10.11.2011 um 15:46 schrieb Passpart0ut:

 Dear All,
 I am trying to travers neo4j using curl and got errors:
 
 curl -X POST -H Accept:application/json -H Content-Type:application/json -d 
 {'order:breadth_first , uniqueness:node_global , 
 return_filter:{body:position.endNode().getProperty('name').toLowerCase().contains('pepsi')
  , language:javascript} , max_depth:1 }' 
 http://localhost:7474/db/data/node/0/traverse/node
 
 ERROR:Error 500 javax.script.ScriptException: 
 sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: name is not 
 defined. (lt;Unknown Sourcegt;#1)
 
 Also I set default value for name property: 
 curl -X POST -H Accept:application/json -H Content-Type:application/json -d 
 {'order:breadth_first , uniqueness:node_global , 
 return_filter:{body:position.endNode().getProperty('name', 
 '').toLowerCase().contains('pepsi') , language:javascript} , 
 max_depth:1 }' http://localhost:7474/db/data/node/0/traverse/node
 
 ERROR:Error 500 javax.script.ScriptException: 
 sun.org.mozilla.javascript.internal.EvaluatorException: syntax error 
 (lt;Unknown Sourcegt;#1)
 
 I am using neo4j 1.4.2 rest api.
 any idea? thx.
 
 Francois.
 ___
 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] START a = node(10) vs START a = (10)

2011-11-10 Thread Michael Hunger
Ah, ok. 

We running the stable releases on heroku so it is still running 1.4.2

It will be updated to 1.5 today or tomorrow.

That's why it is still the old syntax.

Thanks for letting us know.

Michael

Am 10.11.2011 um 16:35 schrieb yobi:

 In the hosted neo4j (through Heroku) I get an error when running:
 
 START a = node(10) RETURN a
 == `' expected but `n' found
 
 But it works when I run:
 
 START a = (10) RETURN a
 
 According to the documentation the first one should work.
 
 Could someone explain why I get the error?
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/START-a-node-10-vs-START-a-10-tp3497036p3497036.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] START a = node(10) vs START a = (10)

2011-11-10 Thread Michael Hunger
The didn't assume that an 1.5 version was running there :)


Am 10.11.2011 um 17:04 schrieb yobi:

 How could you have missed that.
 
 Didn't people complain that it wasn't working? :)
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/START-a-node-10-vs-START-a-10-tp3497036p3497120.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] Gremlin - how to flatten a tree, and sort

2011-11-10 Thread Michael Hunger
Kevin,

how large is the dataset that is build up?

I'm not sure but the REST Plugin and the Webadmin use different implementations 
where webadmin streams the results with ajax and the REST plugin builds up a 
full string result.

Do you need all of the data? Or would it be possible to page it? Or to add some 
code to pre-process the data and just return the minimum that is needed.

Adding streaming to the cypher + gremlin pluings would be also a nice option, 
perhaps you'd like to add an github issue for that.

Cheers

Michael

Am 11.11.2011 um 06:42 schrieb Kevin Versfeld:

 furthermore, I tried a simple query, that returns about the same number of
 rows (still around 100K), and increased the timeout of my REST call (to
 several minutes) - and got my OutOfMemoryError again :)
 
 latest query is just g.v(293).in('R_Bought'). Running it through the
 webadmin console is quick, and my memory usage stays low, etc (all as
 expected).
 It's only when going through the REST interface that I start getting memory
 and/or timeout issues...
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Gremlin-how-to-flatten-a-tree-and-sort-tp3480586p3498879.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] Expected performance question

2011-11-09 Thread Michael Hunger
Oh, and cypher supports streaming (as long as you don't sort/aggregate).

So that won't take up your memory. I would love if you could try that just 
using plain java code and iterating over the node-results and provide us with 
your performance numbers then.

Please make sure to run the test more than once, as the first test will be 
impacted by loading the scala libs and filling the neo4j caches.

Thanks a lot

Michael

Am 09.11.2011 um 09:50 schrieb Hans Birkeland:

 Ah sorry, I should have clarified - in the final application we will want to
 retrieve the nodes.  The reason we were just returning count(*) for the
 tests is that returning a large number of nodes in the web console proved
 less than ideal. :)
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Expected-performance-question-tp3492892p3492961.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] Native UUID support?

2011-11-09 Thread Michael Hunger
I think a separate UUID (2xLONG = 16 Bytes) property type would make sense, if 
I remember correctly property types with larger block sizes are now possible.
Otherwise it could be an inlined long[2].

Having good support on the API  level (integrated separate fast index + 
uniqueness) would be important as well.

That would come at the cost of dropping the exposure of native neo4j-ids. I 
think that's a worthwhile trade-off.

Michael

Am 09.11.2011 um 17:02 schrieb Jim Webber:

 Hey Peter,
 
 I think you raise a good point. We'll need some kind of ID for objects stored 
 in (v)shards, but that's likely to be some kind of hierarchical ID (so that 
 we can locally and globally refer to objects in and across shards).
 
 I think here the question boils down to: can we add (fast) support for UUIDs 
 natively in our store, like we do for strings. I don't know the answer to 
 that, but the kernel folks can probably offer some insight.
 
 Jim
 ___
 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] Nice graph viz: The History Of Dance Music In One Handy Timeline

2011-11-09 Thread Michael Hunger
http://www.fastcodesign.com/1665393/infographic-of-the-day-the-history-of-dance-music-in-one-handy-timeline

Cheers

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


  1   2   3   4   5   6   7   >