Re: [Neo4j] .NET client for neo4j

2011-09-27 Thread Peter Neubauer
That's VERY cool, great work, especially regarding Gremlin and Batching!

Now, if there was any good docs we could pull out, I would like to at
least point to it form the manual, otherwise - what are the
requirements to build this in a CI system?

Cheers,

/peter neubauer

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

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



On Mon, Sep 26, 2011 at 11:47 PM, Tatham Oddie tat...@oddie.com.au wrote:
 Some more usage examples:

 http://hg.readify.net/neo4jclient/src/tip/Test/ApiUsageIdeas.cs


 -- Tatham


 -Original Message-
 From: Tatham Oddie
 Sent: Tuesday, 27 September 2011 7:41 AM
 To: 'Peter Neubauer'; Neo4j user discussions
 Subject: .NET client for neo4j

 Hi Peter,

 We publish our client on NuGet: http://nuget.org/List/Packages/Neo4jClient

 (NuGet is .NET's package manager.)

 The source is at http://hg.readify.net/neo4jclient

 It supports:

  * all the basic CRUD operations

  * index management

  * Gremlin queries via a fluent interface: you use C# lambdas and get full 
 code completion in the IDE as you type; we only compile it down to Gremlin 
 and send it over the wire when you enumerate it or call a scalar method like 
 .Count(). See http://dl.dropbox.com/u/5216304/FluentGremlin.png

 This week we moved to parametized Gremlin queries over the wire (eg, 
 g.v(p0).out[[label:p1]]) and saw a good performance improvement in our 
 downstream app. This change was implemented completely within Neo4jClient's 
 query processor so downstream apps just got the improvement automatically.

 We've also started optimizing some of our internal methods to use batching. 
 For example, creating, relating and indexing a node all happens in a single 
 REST call. We'll probably end up exposing the batching API outside of the 
 client too via some type of unit-of-work pattern.

 As for build, our CI triggers on a code push and publishes a new package to 
 NuGet upon a successful build. If the tests pass, it gets published. (Our 
 unit tests mock out all the REST calls so we have a high level of confidence 
 in them. Risk is low anyway, as NuGet makes it easy to grab any previous 
 version of the package.)


 -- Tatham

 -Original Message-
 From: neubauer.pe...@gmail.com [mailto:neubauer.pe...@gmail.com] On Behalf Of 
 Peter Neubauer
 Sent: Tuesday, 27 September 2011 2:19 AM
 To: Neo4j user discussions
 Cc: Tatham Oddie
 Subject: Re: [Neo4j] Turning Off or Configuring log rotation

 Very cool,
 glad to hear things work out. Got any code for the .NET bindings? I think we 
 should start pulling client libraries into our build system, so there are 
 stable versions of the most used clients for Neo4j available as part of the 
 QA process.

 WDYT?

 Cheers,

 /peter neubauer

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

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



 On Mon, Sep 26, 2011 at 1:24 PM, Romiko Derbynew 
 romiko.derby...@readify.net wrote:
 Hi Peter,

 Indeed our desired result is now achieved. Tatham added batching to our .net 
 client as well. We are more than happy to assist with HA as this is one of 
 the last hurdles we need to overcome. If you can let us know in advance when 
 the release is scheduled then we will incorporate it into our sprint for HA 
 featuring.

 Much appreciated and thx for 1.5 release, could not have timed it better.

 Sent from my iPhone

 On 26/09/2011, at 5:33 PM, Peter Neubauer 
 peter.neuba...@neotechnology.com wrote:

 Romiko,
 soudns good. Is this solving your current problems or is there stuff
 left to take care of for the moment? Also, there will be some code
 coming out on deploying Neo4j HA on Azure. Would you be interested in
 trying that out and maybe take it a bit further?

 Cheers,

 /peter neubauer

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

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



 On Mon, Sep 26, 2011 at 4:16 AM, Romiko Derbynew
 romiko.derby...@readify.net wrote:
 Hi Guys,

 We managed to fix the performance issue.

 * Used Paramterised Queries - increased performance by 1 extra node
 per second, 

Re: [Neo4j] Access Node's property block will happening??

2011-09-27 Thread iamyuanlong
The Code just like
this:http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Has-been-blocked-when-i-get-the-node-s-property-tp3365819p3366449.html

*change *
for (int j = 0; j  100; j++) {
Runnable r = new Runnable() {

@Override
public void run() {
for (int i = 0; i  100; 
i++) {
u2.getFansNum(i);
}
}
};
list.add(new Thread(r));
}
for (Thread tt2 : list) {
tt2.start();
}
*
to*

for (int j = 0; j  *200*; j++) {
Runnable r = new Runnable() {

@Override
public void run() {
for (int i = 0; i  *1000*; 
i++) {
u2.getFansNum(i);
}
}
};
list.add(new Thread(r));
}
for (Thread tt2 : list) {
tt2.start();
}

run the Test you will found get node's property will cost more then 15ms
sometimes. May this test is not meaningful.But it can representing my
problem. I need frequent access node's property.And I think I just read it
,so whatever i have how many threads, access the node's property should be
very fast less then 1ms.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Access-Node-s-property-block-will-happening-tp3371419p3371927.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] cypher variable relationships

2011-09-27 Thread F. De Haes
Hi all,

I tried this cypher query both in the console of the stable and in the
milestone release, but it produces the same error:

start a=(123) match b-[:`Runs on`^1..3]-a return distinct b

== `]' expected but `^' found

Thanks for your help,

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


Re: [Neo4j] Access Node's property block will happening??

2011-09-27 Thread Peter Neubauer
Yuanlong,
are you trying to write to a node property at the same time from
different threads? That will lead to locks. However, reading should
not block. Got any more details as Richard says?

Cheers,

/peter neubauer

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

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



On Tue, Sep 27, 2011 at 5:13 AM, iamyuanlong yuanlong1...@gmail.com wrote:
 In EmbeddedGraphDatabase access Node's property block will happening?
 When multiple threads access one node's property . Sometimes will cost a
 lost of time.
 Tomorrow is the last time. If i can't solve this problem. My team will give
 up Neo4j . Then use Mogondb instead. But I like neo4j. And I hope I can use
 it in my project. So could you help me?
 Then EmbeddedGraphDatabase  is Singleton.I will try
 EmbeddedReadOnlyGraphDatabase , it will be useful?

 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Access-Node-s-property-block-will-happening-tp3371419p3371419.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] cypher variable relationships

2011-09-27 Thread Peter Neubauer
Filip,
for Cypher as a fast moving target, please update to SNAPSHOT mode,
with 
http://neo4j.org/download-thanks/?edition=communityrelease=1.5-SNAPSHOTplatform=unix
and refer to http://docs.neo4j.org/chunked/snapshot/cypher-query-lang.html
where the syntax of variable length queries is now [:contains*], see
http://docs.neo4j.org/chunked/snapshot/query-match.html#match-variable-length-relationships

Is that ok?

Cheers,

/peter neubauer

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

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



On Tue, Sep 27, 2011 at 11:29 AM, F. De Haes fi...@nibewege.org wrote:
 Hi all,

 I tried this cypher query both in the console of the stable and in the
 milestone release, but it produces the same error:

 start a=(123) match b-[:`Runs on`^1..3]-a return distinct b

 == `]' expected but `^' found

 Thanks for your help,

 Filip
 ___
 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 variable relationships

2011-09-27 Thread Andres Taylor
On Tue, Sep 27, 2011 at 11:29 AM, F. De Haes fi...@nibewege.org wrote:

 Hi all,

 I tried this cypher query both in the console of the stable and in the
 milestone release, but it produces the same error:

 start a=(123) match b-[:`Runs on`^1..3]-a return distinct b


I'm sure that variable length paths did not make it into 1.4, so that's
understandable. The milestone release did have that in though... Are you
sure you tried with the milestone and not snapshot? The syntax has changed
in 1.5-SNAPSHOT. Try this:

start a=(123) match b-[:`Runs on`*1..3]-a return distinct b

HTH,

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


Re: [Neo4j] Access Node's property block will happening??

2011-09-27 Thread McKinley
It is not a meaningful test I believe. In your previous posting you showed
that you were only testing with one node:

final Entity u2 = new Entity(graphDb.getNodeById(1));

You are using a for-loop to read a property 1,000,000 times, one after the
other. Ignore whether it is one million or one thousand times. It
is happening sequentially, not concurrently, so only one read is happening
at a time. However, because you introduce threading, you are making 100
things happen at a time. So, only 100 reads are happening at once. I just
want to make that clear.

In your test you are reading the following property:

underlyingNode.getProperty(fansnum, 0);

Each thread of the 100 threads is reading fansnum from a single node, u2.
Some times it takes 15ms, but which times? Does the whole test take 250
minutes, 25 minutes, 5 minutes? Whatever time that is, you know your mean
average. You also need to know the mean average for the first, second, third
and fourth group of 250,000 reads. Also, you are logging after your read
which is making your concurrency something less than the full 100. You may
only be reading the node property 25 times concurrently while 75 threads are
busy logging. This would cause you to overestimate the performance of Neo4j!
You do not need to see the performance of any individual read (except for
the min and the max read time of all reads), so do not log until the final
output. Keep track of the system time of the fastest read and the slowest
read. As you loop and get new winners for fastest and slowest read throw out
the old read times and old system time for those reads.

Once you get a good look at basic min, max and mean average for groups of
250,000 then you will have a good idea of when the JVM and database and
caches are warmed up. Change your test to then perform enough reads to warm
everything up. Then run a concurrency test for something like 100 threads
with 1000 reads per thread. Keep track of the system times of the start and
end of each read in 100 arrays of long[2000]. At the end of the run,
calculate the min, max, mean, median, standard deviation, and quartile of
all the reads.

That test will be meaningful, but even still, it will have a
some confounding variables. Was 1000 reads enough time to really get 100
reads happening at any given time? You can compare the system times to
answer that question.

However, in the end you will find that a mutable, persistant, transactional
database is a poor substitute for an immutable, in-memory, simple Java
value. You will want to use caching in your application for the type of
scenario in your test. Regardless, if you calculate statistics on your tests
and share them maybe they will reveal a scenario where Neo4j needs to be
better.

Kind regards,

McKinley



On Tue, Sep 27, 2011 at 1:00 AM, iamyuanlong yuanlong1...@gmail.com wrote:

 run the Test you will found get node's property will cost more then 15ms
 sometimes. May this test is not meaningful.But it can representing my
 problem. I need frequent access node's property.And I think I just read it
 ,so whatever i have how many threads, access the node's property should be
 very fast less then 1ms.


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


Re: [Neo4j] add property to all relationships

2011-09-27 Thread Mattias Persson
2011/9/26 Rick Bullotta rick.bullo...@thingworx.com

 Or you could simply call the alternate version of getProperty with a
 default value of zero...

 +1 it sounds like you're putting a lot of default values on the
relationships... that's just what getProperty(key,defaultValue) is for.

 On Sep 26, 2011, at 5:44 AM, sometime dons...@gmail.com wrote:

  Hi!
 
  I have 1.2M nodes and 5M relationships. Around 20 000 relationships are
 two
  properties: prop1 prop2, the remaining relationships have only one
 property:
  prop1.
  I've got all the relationships that have only one property - add prop2
 with
  value 0.
 
  It should run on all relationships and add this property?
 
  If yes - then I have to run the robot and it will run at least 3 days.
  Can be somehow easier to solve this problem so as not to spend too much
  time?
 
  --
  View this message in context:
 http://neo4j-community-discussions.438527.n3.nabble.com/add-property-to-all-relationships-tp3368779p3368779.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




-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] class org.springframework.data.neo4j.config.Neo4jConfiguration is not an enhanced class

2011-09-27 Thread Peter Neubauer
Wim,
yes, I am meaning the bundle-friendly-classloader branch, see building
instructions in the updated README.mp on
https://github.com/neo4j/neo4j-osgi

Does that work for you? I just brought the branch up-to-date with master ...

Cheers,

/peter neubauer

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

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



On Mon, Sep 26, 2011 at 10:07 PM, Wim Rijnders wrijnd...@gmail.com wrote:
 HI Peter,
 Whichi neo-friendly branch of what component do you mean? I am not sure
 about what item you are talking about.
 I found a reference here to a bundle-friendly classloader, is that what you
 mean? Unfortunately, the corresponding link does not work.
 Could you point me to the code/component in question?
 Regards and thanks,
 Wim.

 On Thu, Sep 22, 2011 at 4:43 PM, Peter Neubauer
 peter.neuba...@neotechnology.com wrote:

 Wim,
 you probably should try out the neo4j-friendly branch instead, but I
 hear you are already in contact with Michael on this - might actually
 be a Spring - issue ...

 Cheers,

 /peter neubauer

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

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



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


Re: [Neo4j] cypher variable relationships

2011-09-27 Thread Peter Neubauer
Filip,
do you have a Skype ID? Let's track down what is not working ...

Cheers,

/peter neubauer

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

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



On Tue, Sep 27, 2011 at 1:58 PM, F. De Haes fi...@nibewege.org wrote:
 Peter, mind I'm developing on windows, and the windows snapshot just doesn't
 work.

 Andrés, yes I tried it in 'Neo4j - Graph Database Kernel 1.5.M01', with
 ^1..3 and gives error == `]' expected `^' found.

 2011/9/27 Andres Taylor andres.tay...@neotechnology.com

 On Tue, Sep 27, 2011 at 11:29 AM, F. De Haes fi...@nibewege.org wrote:

  Hi all,
 
  I tried this cypher query both in the console of the stable and in the
  milestone release, but it produces the same error:
 
  start a=(123) match b-[:`Runs on`^1..3]-a return distinct b
 

 I'm sure that variable length paths did not make it into 1.4, so that's
 understandable. The milestone release did have that in though... Are you
 sure you tried with the milestone and not snapshot? The syntax has changed
 in 1.5-SNAPSHOT. Try this:

 start a=(123) match b-[:`Runs on`*1..3]-a return distinct b

 HTH,

 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] neo4j-scala improvements

2011-09-27 Thread Peter Neubauer
Building it right now ...

Maybe we can set it up against Neo4j 1.5-SNAPSHOT and put it on our
build server to start with?

Cheers,

/peter neubauer

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

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



On Wed, Sep 21, 2011 at 4:29 PM, Christopher Schmidt
fakod...@googlemail.com wrote:
 Hi all

 I did...
 - Split it up to Neo4j Scala, which is mainly the old available neo4j-scala
 version. A little refactored and enhanced with Case Class to Node
 properties marshaling and some Traits for graph service provider handling
 (- https://github.com/FaKod/neo4j-scala)
 - Neo4j Spatial Scala with some spatial convenience methods (-
 https://github.com/FaKod/neo4j-spatial-scala)
 - I updated both READMEs to reflect the current state
 - lowered both version numbers to 0.1.0-SNAPSHOT (the old where 0.9.9... too
 high I think)
 - Updated Scala to 2.9.1 and Neo4j to the last available Neo4j Spatial
 compatible version (1.4.1)
 - started to add some more Specs2 test cases (still far away from enough)

 Should be a good starting point for playing, testing and discussing various
 design and DSL decisions :-)

 Cheers Christopher

 On Mon, Sep 12, 2011 at 9:17 PM, Peter Neubauer 
 peter.neuba...@neotechnology.com wrote:

 Awesome Christopher,
 let us know when things are stabilizing, so we can start to put the
 scala bindings onto the build server and run regular tests against
 Neo4j master!

 Cheers,

 /peter neubauer

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

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



 On Mon, Sep 12, 2011 at 9:03 PM, Christopher Schmidt
 fakod...@googlemail.com wrote:
  OK. I will
  - use my forked neo4j-scala repository for the Neo4j part
  - push the spatial part into my neo4j-spatial-scala repository which will
  have a dependancy to neo4j-scala.
 
  On Mon, Sep 12, 2011 at 9:58 AM, Anders Nawroth 
 and...@neotechnology.comwrote:
 
  Hi!
 
  So far Neo4j and Neo4j Spatial don't share the same release cycle, so it
  makes sense to split the scala wrapper in two projects.
 
  /anders
 
  On 09/12/2011 06:14 AM, Christopher Schmidt wrote:
   Yes - thats possible. I think to have a repo would ease the usage of
   neo4j-scala.
   The next days (hope there is enough time) I will clean up and document
  the
   sources so that they are easier to understand.
   Next would be to update to the current versions of Neo4j, Neo4j
 Spatial
  and
   Scala.
  
   Actual, neo4j-scala includes the spatial wrapper as well, do you think
 it
   is necessary to split it into two projects (neo4j-scala and
   neo4j-spatial-scala)?
  
   On Fri, Sep 9, 2011 at 3:21 PM, Peter Neubauer
   peter.neuba...@neotechnology.com  wrote:
  
   Very cool Christopher!
  
   We are testing to pull in some of the bindings for Neo4j into the
   manual - would it be possible, when things stabilize, to pull in the
   Scala bindings to the Neo4j repo. build them and start documenting
   some test cases so we can put them into there, too?
  
   Cheers,
  
   /peter neubauer
  
   GTalk:      neubauer.peter
   Skype       peter.neubauer
   Phone       +46 704 106975
   LinkedIn   http://www.linkedin.com/in/neubauer
   Twitter      http://twitter.com/peterneubauer
  
   http://www.neo4j.org               - Your high performance graph
  database.
   http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
   http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing
 party.
  
  
  
   On Fri, Sep 9, 2011 at 8:10 AM, Christopher Schmidt
   fakod...@googlemail.com  wrote:
   Neo4j Scala (https://github.com/FaKod/neo4j-scala) has got some
   improvements
   - Scala (non nested) Case Class de- serialization to or from a Neo4j
  Node
   (see example)
   - index convenience methods (see example)
   - create and get Relation Objects, like val relation = start --
  foo
   --
   end;
  
   It's still alpha, but worth to look at :-)
  
   case class Test(s: String, i: Int, ji: java.lang.Integer, d: Double,
 l:
   Long, b: Boolean)
  
   object DeSerializingSpec extends Specification with Neo4jWrapper
 with
   EmbeddedGraphDatabaseServiceProvider {
  
     def neo4jStoreDir = /tmp/temp-neo-test
  
     Node should {
       be serializable in {
         var o = Test(This is a String, 1, 2, 3.3, 10, true)
         var node: Node = null
         withTx {
           implicit neo =
             node = 

Re: [Neo4j] REST API Base URI

2011-09-27 Thread Jacob Hansson
As far as I know, the auth plugin currently only supports HTTP BASIC
authentication. But it would be interesting to expand it to allow other
authentication methods, for instance by allowing pluggable authentication
providers.

So if I understand your question correctly, yes, it does support
authentication beyond just limiting access by IP, but it does not support
authentication using keys or certificates.

Out of curiosity, what is the driver behind needing key-based
authentication? The combination of HTTP BASIC, strong passwords and HTTPS
seems like it would supply quite strong security, no?

/Jake

On Wed, Sep 21, 2011 at 9:16 PM, Nuo Yan yan@gmail.com wrote:

 Limiting access to certain URIs or IPs is great, but ideally at this moment
 I also need something like a key-based authentication so I can send a
 private key in the headers from my restclient and neo4j would authenticate
 and only take authenticated requests. Does the authentication extension
 support key-based authentication? If not, what forms of authentication does
 it currently support (user/password, token-based, shared-secret)?

 Thanks,
 Nuo

 On Wed, Sep 21, 2011 at 11:24 AM, Peter Neubauer 
 peter.neuba...@neotechnology.com wrote:

  Nuo,
  Thomas Baum has been working on an authentication extension for Neo4j
  Server, see https://github.com/neo4j/authentication-extension. He
  could help you set it up and test it - it's used in hosting scenarios
  and should do what you want in terms of limiting access to certain
  URIs if that is what you want?
 
  Cheers,
 
  /peter neubauer
 
  GTalk:  neubauer.peter
  Skype   peter.neubauer
  Phone   +46 704 106975
  LinkedIn   http://www.linkedin.com/in/neubauer
  Twitter  http://twitter.com/peterneubauer
 
  http://www.neo4j.org   - Your high performance graph
 database.
  http://startupbootcamp.org/- Öresund - Innovation happens HERE.
  http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
  On Wed, Sep 21, 2011 at 6:14 PM, Nuo Yan yan@gmail.com wrote:
   For my scenario, I currently only use the LB for request
 authentication,
  so
   that not everyone on the network can access the neo4j server. In my use
   case, I think making the base uri configurable (including the protocol,
  e.g.
   https://foobar.com/) is enough.
  
   There are a couple other approaches that may also solve my problem. For
   example, having a configurable option to make the REST APIs return only
   relative paths in the result. Or, if neo4j could have a built-in
 request
   authentication mechanism for the REST interface, I may be able to get
 rid
  of
   the lb completely.
  
  
   On Wed, Sep 21, 2011 at 7:04 AM, Peter Neubauer 
   peter.neuba...@neotechnology.com wrote:
  
   Nuo,
   right now the server is discovering its own IP upon startup. However,
   it sounds reasonable to return configurable base URL. I am just
   wondering if that really is enough to support a LB scenario? Do you
   need more stuff 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   - Your high performance graph
  database.
   http://startupbootcamp.org/- Öresund - Innovation happens HERE.
   http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing
 party.
  
  
  
   On Tue, Sep 20, 2011 at 6:57 PM, Nuo Yan yan@gmail.com wrote:
I access my neo4j server through the REST API. For security purpose,
 I
   put
the neo4j server behind a nginx lb. I'm wondering if there is config
   entry
somewhere that I can set the neo4j server to return a customized
 base
  uri
that I can set to my LB's uri.
   
For example, currently creating a node by POSTing to the lb (say
https://10.0.0.1/db/data) returns
   
{
 outgoing_relationships : 
http://neo4j/db/data/node/160/relationships/out;,
 data : {
 },
 traverse : http://neo4j/db/data/node/160/traverse/{returnType}
 ,
 all_typed_relationships : 
http://neo4j/db/data/node/160/relationships/all/{-list||types},
 property : http://neo4j/db/data/node/160/properties/{key};,
 self : http://neo4j/db/data/node/160;,
 properties : http://neo4j/db/data/node/160/properties;,
 outgoing_typed_relationships : 
http://neo4j/db/data/node/160/relationships/out/{-list||types},
 incoming_relationships : 
   http://neo4j/db/data/node/160/relationships/in
,
 extensions : {
 },
 create_relationship : 
 http://neo4j/db/data/node/160/relationships
  ,
 paged_traverse : 
   
  
 
 http://neo4j/db/data/node/160/paged/traverse/{returnType}{?pageSize,leaseTime}
,
 all_relationships : 
  http://neo4j/db/data/node/160/relationships/all
   ,
 incoming_typed_relationships : 

Re: [Neo4j] Access Node's property block will happening??

2011-09-27 Thread iamyuanlong
The explain is very in  place.Thank you for your patient explanation. 
Let me represent the real problem. This is my test url
(Just test url . unavailable)
http://i.jrj.com.cn/app/relation/fans.jspa?uid=091220010012659154pn=1ps=20order=lastlogintime-desc
 

The user's uid is 091220010012659154 has 45629 fans. The url means get first
page of the user's fans sort by user's lastlogintime .
The achieve is: 
First, Use Traversal get all user's fans node.
Then, Get an array about the instantiation Objects, which create by the node
and the node's property (fansnum).
Then,sort by the fansnum comparator. 

The first step will cost just flew ms. The sort step will cost 20ms .If just
is a single request It will be very fast less than 200ms.

But if I use webbench(http://www.oschina.net/p/webbench a testing tool for
web application stress) request the url. (I have delete all log ) .
Concurrent 100 Time is 60s . Just have 600 success/min .My partner found
bottlenecks is at getUser's property by use a Code Analyzer Software.
Tomorrow I will try it by myself. 
Thank you for your help again.  Neo4j is a good graph database.

--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Neo4j-Access-Node-s-property-block-will-happening-tp3371419p3372786.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] Problem Installing Spatial (Beginner)

2011-09-27 Thread handloomweaver
Hi

I wonder if someone would be so kind to help. I'm new to Neo4j and was
trying to install Neo4jSpatial to try its GIS features out. I need to be
clear that I have no experience of Java  Maven so I'm struggling a bit.

I want to install Neo4j  Spatial once somewhere on my 4GB MacBook Pro. I
have no problem downloading the Neo4j Java Binary and starting it. But I'm
confused about the Spatial library. Looking at the Github page it says
either use Maven or copy a zip file into a folder in Neo4j. Is the zip file
the Github repository contents or something else? 

I've tried the Maven way (mvn install) described on GitHub but I'm firstly
confused about if/where Neo4j is being installed (does it install it first,
where?) and anyway the install fails. It seems to be a JVM Heap memory
problem? Why is it failing. How can I make it not fail. Is it a config file
somewhere needing tweaked?

http://handloomweaver.s3.amazonaws.com/Terminal_Output.txt
http://handloomweaver.s3.amazonaws.com/surefire-reports.zip

I'm really keen to use Neo4J spatial but the barrier to entry for the less
technical GIS developer is proving too high for me!

I'd SO appreciate some help/pointers. I apologise that I am posting such a
NOOB question on your forum but I've exhausted Google searches. 

Thanks





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


Re: [Neo4j] Problem Installing Spatial (Beginner)

2011-09-27 Thread Peter Neubauer
Al,
sorry for the inconvenience, we are just about to make the tests
green. For the moment, just do

mvn clean install -DskipTests

to get the resulting artifacts that you then can use in your Neo4j
Server or Java application. Let me know via Skype or so how I can
help!

Cheers,

/peter neubauer

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

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



On Tue, Sep 27, 2011 at 5:24 PM, handloomweaver a...@atomised.coop wrote:
 Hi

 I wonder if someone would be so kind to help. I'm new to Neo4j and was
 trying to install Neo4jSpatial to try its GIS features out. I need to be
 clear that I have no experience of Java  Maven so I'm struggling a bit.

 I want to install Neo4j  Spatial once somewhere on my 4GB MacBook Pro. I
 have no problem downloading the Neo4j Java Binary and starting it. But I'm
 confused about the Spatial library. Looking at the Github page it says
 either use Maven or copy a zip file into a folder in Neo4j. Is the zip file
 the Github repository contents or something else?

 I've tried the Maven way (mvn install) described on GitHub but I'm firstly
 confused about if/where Neo4j is being installed (does it install it first,
 where?) and anyway the install fails. It seems to be a JVM Heap memory
 problem? Why is it failing. How can I make it not fail. Is it a config file
 somewhere needing tweaked?

 http://handloomweaver.s3.amazonaws.com/Terminal_Output.txt
 http://handloomweaver.s3.amazonaws.com/surefire-reports.zip

 I'm really keen to use Neo4J spatial but the barrier to entry for the less
 technical GIS developer is proving too high for me!

 I'd SO appreciate some help/pointers. I apologise that I am posting such a
 NOOB question on your forum but I've exhausted Google searches.

 Thanks





 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Problem-Installing-Spatial-Beginner-tp3372924p3372924.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] Killing the Wiki

2011-09-27 Thread Peter Neubauer
Thanks everyone,
just pushed Configuration Settings into the manual, and added issues
for the others see

https://github.com/neo4j/community/issues/34
https://github.com/neo4j/community/issues/33
https://github.com/neo4j/community/issues/32
https://github.com/neo4j/community/issues/31

Thanks for the input guys!

Cheers,

/peter neubauer

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

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



On Mon, Sep 26, 2011 at 6:04 PM, Alexandre de Assis Bento Lima
as...@cos.ufrj.br wrote:
 Hi,

 My top 3:

 1 - Design Guide
 2 - IMDB Example
 3 - Configuration Settings

 Cheers,
 Alexandre.

 On Mon, 26 Sep 2011 08:01:52 +0200, Peter Neubauer wrote
 Hi everyone,
 Anders and me are going to try to kill the wiki and put the material
 into the manual, http://docs.neo4j.org . However, some pages are more
 interesting to pull over than others.

 If you are interested, could you please list what your top 3 sections
 from http://wiki.neo4j.org/content/Main_Page are so we can start at
 the right spots?

 Cheers,

 /peter neubauer

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

 http://www.neo4j.org               - Your high performance graph database.
 http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user


 Alexandre A. B. Lima.
 ---
 COPPE / Computer Science
 Federal University of Rio de Janeiro
 Rio de Janeiro, Brazil.
 +55-21-2562-8690

 ___
 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 Data + Neo4j - Indexing Question

2011-09-27 Thread kv8
I have a possible issue with the Lucene index not being updated when I update
a node with Indexed variables. Will appreciate any help...this is what I
have so far ..made the code concise for readability ..

@NodeEntity
Class User {
@Indexed
String userName;

String firstName;

String lastName;

@Indexed
Boolean communityMember;

@RelatedTo(type = LLPRelations.OWN, direction = Direction.INCOMING)
SetClub clubsOwned;

@Indexed(indexName = user-full-name, fulltext = true)
String fullName;
}

@test
@Transactional
public void shouldUpdateIndexWhenEntityChanges() {
User u1 = createUser(f1,l1true - Boolean for community member);
createUser(f2,l2true - Boolean for community member);
userRepository.findAllByPropertyValue(User.COMMUNITY_MEMBER, true) ---
returns 2
u1.setIsCommunityMember(false);
userRepository.findAllByPropertyValue(User.COMMUNITY_MEMBER, true) ---
returns 2 again
}

My understanding was the index's are automatically updated with the value
changes. Am I missing something ?

Thanks much folks !


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


Re: [Neo4j] Spring Data + Neo4j - Indexing Question

2011-09-27 Thread Michael Hunger
Sorry, there is probably an error in the implementation.

I added an JIRA issue for that: 
https://jira.springsource.org/browse/DATAGRAPH-107

Will be fixed in the next milestone/release.

I added a test for it and fixed it.

As a workaround could you try to set it to null in between?
setProp(true);
setProp(null);
setProp(false),

Am 27.09.2011 um 19:20 schrieb kv8:

 I have a possible issue with the Lucene index not being updated when I update
 a node with Indexed variables. Will appreciate any help...this is what I
 have so far ..made the code concise for readability ..
 
 @NodeEntity
 Class User {
@Indexed
String userName;
 
String firstName;
 
String lastName;
 
@Indexed
Boolean communityMember;
 
@RelatedTo(type = LLPRelations.OWN, direction = Direction.INCOMING)
SetClub clubsOwned;
 
@Indexed(indexName = user-full-name, fulltext = true)
String fullName;
 }
 
 @test
 @Transactional
 public void shouldUpdateIndexWhenEntityChanges() {
 User u1 = createUser(f1,l1true - Boolean for community member);
 createUser(f2,l2true - Boolean for community member);
 userRepository.findAllByPropertyValue(User.COMMUNITY_MEMBER, true) ---
 returns 2
 u1.setIsCommunityMember(false);
 userRepository.findAllByPropertyValue(User.COMMUNITY_MEMBER, true) ---
 returns 2 again
 }
 
 My understanding was the index's are automatically updated with the value
 changes. Am I missing something ?
 
 Thanks much folks !
 
 
 --
 View this message in context: 
 http://neo4j-community-discussions.438527.n3.nabble.com/Spring-Data-Neo4j-Indexing-Question-tp3373307p3373307.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] REST, Transactions and Uniqueness

2011-09-27 Thread Tony Wooster
Hi Linan,

That's essentially what I implemented, but the logic just became that
much more tortured when going over REST. Like I said, less of a Java
programmer. The implementation I came up with on the REST side (hacky
though it may be) was this:

@Description( An extension to help maintain unique relationships )
public class IndexTester extends ServerPlugin
{
    @Name( error_if_in_node_index )
    @Description( Will return a 4xx error if a key/value pair is found in +
  a given index. Also errors if the index doesn't exist.)
    @PluginTarget( GraphDatabaseService.class )
    public Boolean errorIfInNodeIndex(
    @Source GraphDatabaseService graphDb,
    @Description( Name of the index to earch. )
    @Parameter( name = indexName ) String indexName,
    @Description( Name of key to search. )
    @Parameter( name = key ) String key,
    @Description( Value to search for. )
    @Parameter( name = value ) String value )
    throws BadInputException
    {

    if ( !graphDb.index().existsForNodes( indexName ) )
    throw new BadInputException(Index doesn't exist, new
NotFoundException());

    IndexNode index = graphDb.index().forNodes( indexName );

    if (index.get(key, value).size()  0)
    throw new BadInputException(Key/value pair found in index);
    return null;
    }
}

I'm still not entirely certain that this is the appropriate way to go;
probably a better solution would be a more general add node with
unique, indexed fields command that's slightly more functional than
this batch-operation-quirks based hack. As an aside -- does anyone
know when/if lists of maps for parameters will be implemented for REST
plugins?

Thanks for the response!

-T

On Thu, Sep 22, 2011 at 4:57 PM, Linan Wang tali.w...@gmail.com wrote:

 Hi,
 i had the issue few days ago and thanks to McKinley I got a workable
 solution. i think the best way to do is through unmanaged extension.
 the overhead of multiple REST calls could make the matter more
 complex.

 here is part of my ObjectFactory class. in my situation it's an
 external id needs to be uniq. feel free to correct my codes :) the
 performance is not ideal though. on my imac I got around 50 insertions
 per sec. the bottle neck is not memory.

        public T get(long externalId)
        {
                // try asynchronized read first;
                IndexNode idx = getDefaultNodeIndex();

                IndexHitsNode h = idx.get(IDX_KEY_EXTERNAL_ID, externalId);
                Node n = h.getSingle();
                h.close();

                if(n != null)
                        return wrap(n);

                // if not found, try synchronized version;
                return null;
        }

        public T getOrCreate(long externalId)
        {

                T ret = get( externalId );
                if(ret != null)
                        return ret;

                // if not found, try synchronized version;
                return synchronizedGetOrCreate(externalId);
        }

        private synchronized T synchronizedGetOrCreate(long externalId)
        {
                // Just in case!
                T ret = get( externalId );
                if(ret != null)
                        return ret;

                IndexNode idx = getDefaultNodeIndex();
                Node n = null;

                Transaction tx = db.beginTx();

                try{
                        n = db.createNode();

                        // set property
                        n.setProperty(AbstractObject.EXTERNAL_ID_KEY, 
 externalId);

                        // add to default index;
                        idx.add(n, IDX_KEY_EXTERNAL_ID, externalId);

                        tx.success();
                }catch(Exception e){
                        tx.failure();
                }finally{
                        tx.finish();
                }

                return wrap(n);
        }

 On Thu, Sep 22, 2011 at 9:33 PM, twooster twoos...@gmail.com wrote:
  Hi,
 
  I've seen this come up a number of times in various forms on the mailing
  list, but -- while there are some scattered answers here and there -- there
  doesn't seem to be much of a definitive solution. The problem I'm looking to
  solve is basic uniqueness (e.g. for creating an account -- unique username
  or email address); to make matters more complicated, I'd like to do this
  over the REST interface.
 
  In the a non-REST use of Neo4j, it sounds like I could achieve this by doing
  the following:
 
  1. Begin a transaction
  2. Acquire a write lock on a UserRef supernode, say by attempting to delete
  the property __WRITE_LOCK__ (which will fail if the property doesn't exist,
  say)
  3. Check if username is in users index
  4. If it is, cancel transaction and fail
  5. Otherwise, add a User node, relate it back to the UserRef node, and add
  it to 

Re: [Neo4j] neo4j-scala improvements

2011-09-27 Thread Christopher Schmidt
Hi Peter,
I updated both pom.xml to use Neo4j 1.5-SNAPSHOT

Let me know if I can help.

Christopher

On Tue, Sep 27, 2011 at 2:11 PM, Peter Neubauer 
peter.neuba...@neotechnology.com wrote:

 Building it right now ...

 Maybe we can set it up against Neo4j 1.5-SNAPSHOT and put it on our
 build server to start with?

 Cheers,

 /peter neubauer

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

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



 On Wed, Sep 21, 2011 at 4:29 PM, Christopher Schmidt
 fakod...@googlemail.com wrote:
  Hi all
 
  I did...
  - Split it up to Neo4j Scala, which is mainly the old available
 neo4j-scala
  version. A little refactored and enhanced with Case Class to Node
  properties marshaling and some Traits for graph service provider
 handling
  (- https://github.com/FaKod/neo4j-scala)
  - Neo4j Spatial Scala with some spatial convenience methods (-
  https://github.com/FaKod/neo4j-spatial-scala)
  - I updated both READMEs to reflect the current state
  - lowered both version numbers to 0.1.0-SNAPSHOT (the old where 0.9.9...
 too
  high I think)
  - Updated Scala to 2.9.1 and Neo4j to the last available Neo4j Spatial
  compatible version (1.4.1)
  - started to add some more Specs2 test cases (still far away from enough)
 
  Should be a good starting point for playing, testing and discussing
 various
  design and DSL decisions :-)
 
  Cheers Christopher
 
  On Mon, Sep 12, 2011 at 9:17 PM, Peter Neubauer 
  peter.neuba...@neotechnology.com wrote:
 
  Awesome Christopher,
  let us know when things are stabilizing, so we can start to put the
  scala bindings onto the build server and run regular tests against
  Neo4j master!
 
  Cheers,
 
  /peter neubauer
 
  GTalk:  neubauer.peter
  Skype   peter.neubauer
  Phone   +46 704 106975
  LinkedIn   http://www.linkedin.com/in/neubauer
  Twitter  http://twitter.com/peterneubauer
 
  http://www.neo4j.org   - Your high performance graph
 database.
  http://startupbootcamp.org/- Öresund - Innovation happens HERE.
  http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
  On Mon, Sep 12, 2011 at 9:03 PM, Christopher Schmidt
  fakod...@googlemail.com wrote:
   OK. I will
   - use my forked neo4j-scala repository for the Neo4j part
   - push the spatial part into my neo4j-spatial-scala repository which
 will
   have a dependancy to neo4j-scala.
  
   On Mon, Sep 12, 2011 at 9:58 AM, Anders Nawroth 
  and...@neotechnology.comwrote:
  
   Hi!
  
   So far Neo4j and Neo4j Spatial don't share the same release cycle, so
 it
   makes sense to split the scala wrapper in two projects.
  
   /anders
  
   On 09/12/2011 06:14 AM, Christopher Schmidt wrote:
Yes - thats possible. I think to have a repo would ease the usage
 of
neo4j-scala.
The next days (hope there is enough time) I will clean up and
 document
   the
sources so that they are easier to understand.
Next would be to update to the current versions of Neo4j, Neo4j
  Spatial
   and
Scala.
   
Actual, neo4j-scala includes the spatial wrapper as well, do you
 think
  it
is necessary to split it into two projects (neo4j-scala and
neo4j-spatial-scala)?
   
On Fri, Sep 9, 2011 at 3:21 PM, Peter Neubauer
peter.neuba...@neotechnology.com  wrote:
   
Very cool Christopher!
   
We are testing to pull in some of the bindings for Neo4j into the
manual - would it be possible, when things stabilize, to pull in
 the
Scala bindings to the Neo4j repo. build them and start documenting
some test cases so we can put them into there, too?
   
Cheers,
   
/peter neubauer
   
GTalk:  neubauer.peter
Skype   peter.neubauer
Phone   +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter  http://twitter.com/peterneubauer
   
http://www.neo4j.org   - Your high performance graph
   database.
http://startupbootcamp.org/- Öresund - Innovation happens
 HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing
  party.
   
   
   
On Fri, Sep 9, 2011 at 8:10 AM, Christopher Schmidt
fakod...@googlemail.com  wrote:
Neo4j Scala (https://github.com/FaKod/neo4j-scala) has got some
improvements
- Scala (non nested) Case Class de- serialization to or from a
 Neo4j
   Node
(see example)
- index convenience methods (see example)
- create and get Relation Objects, like val relation = start --
   foo
--
end;
   
It's still alpha, but worth to look at :-)
   
case class Test(s: String, i: Int, ji: java.lang.Integer, d:
 Double,
  l:
Long, b: Boolean)
   
object 

Re: [Neo4j] REST, Transactions and Uniqueness

2011-09-27 Thread Peter Neubauer
Guys,
Maps are now supported as parameters, look at the Gremlin plugin för
reference in the docs. Will add that for parameters to the cypher plugin
too.

Thanks for chipping in!

/peter

Sent from my phone.
On Sep 27, 2011 8:12 PM, Tony Wooster twoos...@gmail.com wrote:
 Hi Linan,

 That's essentially what I implemented, but the logic just became that
 much more tortured when going over REST. Like I said, less of a Java
 programmer. The implementation I came up with on the REST side (hacky
 though it may be) was this:

 @Description( An extension to help maintain unique relationships )
 public class IndexTester extends ServerPlugin
 {
 @Name( error_if_in_node_index )
 @Description( Will return a 4xx error if a key/value pair is found in
+
   a given index. Also errors if the index doesn't
exist.)
 @PluginTarget( GraphDatabaseService.class )
 public Boolean errorIfInNodeIndex(
 @Source GraphDatabaseService graphDb,
 @Description( Name of the index to earch. )
 @Parameter( name = indexName ) String indexName,
 @Description( Name of key to search. )
 @Parameter( name = key ) String key,
 @Description( Value to search for. )
 @Parameter( name = value ) String value )
 throws BadInputException
 {

 if ( !graphDb.index().existsForNodes( indexName ) )
 throw new BadInputException(Index doesn't exist, new
 NotFoundException());

 IndexNode index = graphDb.index().forNodes( indexName );

 if (index.get(key, value).size()  0)
 throw new BadInputException(Key/value pair found in index);
 return null;
 }
 }

 I'm still not entirely certain that this is the appropriate way to go;
 probably a better solution would be a more general add node with
 unique, indexed fields command that's slightly more functional than
 this batch-operation-quirks based hack. As an aside -- does anyone
 know when/if lists of maps for parameters will be implemented for REST
 plugins?

 Thanks for the response!

 -T

 On Thu, Sep 22, 2011 at 4:57 PM, Linan Wang tali.w...@gmail.com wrote:

 Hi,
 i had the issue few days ago and thanks to McKinley I got a workable
 solution. i think the best way to do is through unmanaged extension.
 the overhead of multiple REST calls could make the matter more
 complex.

 here is part of my ObjectFactory class. in my situation it's an
 external id needs to be uniq. feel free to correct my codes :) the
 performance is not ideal though. on my imac I got around 50 insertions
 per sec. the bottle neck is not memory.

public T get(long externalId)
{
// try asynchronized read first;
IndexNode idx = getDefaultNodeIndex();

IndexHitsNode h = idx.get(IDX_KEY_EXTERNAL_ID,
externalId);
Node n = h.getSingle();
h.close();

if(n != null)
return wrap(n);

// if not found, try synchronized version;
return null;
}

public T getOrCreate(long externalId)
{

T ret = get( externalId );
if(ret != null)
return ret;

// if not found, try synchronized version;
return synchronizedGetOrCreate(externalId);
}

private synchronized T synchronizedGetOrCreate(long externalId)
{
// Just in case!
T ret = get( externalId );
if(ret != null)
return ret;

IndexNode idx = getDefaultNodeIndex();
Node n = null;

Transaction tx = db.beginTx();

try{
n = db.createNode();

// set property
n.setProperty(AbstractObject.EXTERNAL_ID_KEY,
externalId);

// add to default index;
idx.add(n, IDX_KEY_EXTERNAL_ID, externalId);

tx.success();
}catch(Exception e){
tx.failure();
}finally{
tx.finish();
}

return wrap(n);
}

 On Thu, Sep 22, 2011 at 9:33 PM, twooster twoos...@gmail.com wrote:
  Hi,
 
  I've seen this come up a number of times in various forms on the
mailing
  list, but -- while there are some scattered answers here and there --
there
  doesn't seem to be much of a definitive solution. The problem I'm
looking to
  solve is basic uniqueness (e.g. for creating an account -- unique
username
  or email address); to make matters more complicated, I'd like to do
this
  over the REST interface.
 
  In the a non-REST use of Neo4j, it sounds like I could achieve this by
doing
  the following:
 
  1. Begin a transaction
  2. Acquire a write lock 

Re: [Neo4j] Concerning getting all nodes after a traversal

2011-09-27 Thread Michael Hunger
Can we take this to the mailing list ?

After all what is your usecase?

What is the structure of your graph, what your starting nodes, etc.
Do you have cold or hot caches.

I think probably the traverser is not limiting to the right set and traverses 
too much of the graph.

Cheers

Michael

Am 27.09.2011 um 20:41 schrieb Peter Neubauer:

 Daniel, 
 I think Michael has been testing some with these setups...
 
 /peter
 
 Sent from my phone.
 
 On Sep 27, 2011 6:21 PM, Daniel Morozoff danielmoroz...@gmail.com wrote:
  Hi Peter,
  
  Thanks for your response. Makes total sense! Can you recommend any in memory
  DBs like blackray that work well with neo4j and java?
  
  Thanks,
  
  Dan
  
  On Tue, Sep 27, 2011 at 12:26 AM, Peter Neubauer 
  peter.neuba...@neotechnology.com wrote:
  
  Daniel,
  remember that the traversals are lazy, so nothing is traversed until
  you actually iterate. Is that explaining the difference? Also, try
  running the code several times, and the caches and the JVM will help
  to bring times down compared to cold runs.
 
  HTH,
 
  Cheers,
 
  /peter neubauer
 
  GTalk: neubauer.peter
  Skype peter.neubauer
  Phone +46 704 106975
  LinkedIn http://www.linkedin.com/in/neubauer
  Twitter http://twitter.com/peterneubauer
 
  http://www.neo4j.org - Your high performance graph database.
  http://startupbootcamp.org/ - Öresund - Innovation happens HERE.
  http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
  On Mon, Sep 26, 2011 at 9:54 PM, danielmoroz...@gmail.com wrote:
   Hi Peter,
  
   I know you are one of the admins for the forums and I was wondering if
  you could assist me with my question. I posted it already on the forum, but
  have not received a response.
  
   My question pertains to running the getAllNodes() method on a Traverser
  object. It takes drastically longer to get all nodes than to traverse them.
  
   I assumed it was a indexing issue and decompiled the kernel lib file, but
  could not find where the indexing was occurring (as it was not in the
  Traverser class).
  
   Could you give me some input, as we are attempting to optimize our
  algorithms, but 95% of the speed comes from this one method.
  
   Here is a copy of my post:
  
   For your reference the size of the DB is ~6.8 Gb
   
  
   long startTime = System.currentTimeMillis();
   Traverser treeTraverser = root.traverse(
   Traverser.Order.BREADTH_FIRST,
   operator.getStopEvaluator(),
   ReturnableEvaluator.ALL,
   relationshipType,
   Direction.OUTGOING);
  
   long endTime = System.currentTimeMillis();
  
   System.out.println(\n||TIME NEEDED FOR TRAVERSAL:
  +(endTime-startTime)+
   ms||);
   int size = 0;
   startTime =System.currentTimeMillis();
   Iterable Node nodeCollection =
  treeTraverser.getAllNodes();
   endTime = System.currentTimeMillis();
  
   System.out.println(\n||TIME NEEDED TO GET NODES: +(endTime-startTime)+
   ms||);
  
  
   ---
   Console output:::
  
   ||TIME NEEDED FOR TRAVERSAL: 63 ms||
  
   ||TIME NEEDED TO GET NODES: 56875 ms||
  
   
  
   Thank you so much,
  
   Dan
  
 

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


Re: [Neo4j] REST API Base URI

2011-09-27 Thread Nuo Yan
Hi Jake,

Thanks for your reply.

Sorry if my previous email was misleading, but I don't absolutely need
key-based authentication; that just turned out to be the what I first
thought of. I was trying to figure out what authentication methods were
supported so that I can evaluate. HTTPS + basic auth with strong passwords
do sound good to me at this moment. However, at this moment, instead of
using authentication, I turned out configured security rules on my the neo4j
server to only take connections from my app server so I temporarily don't
have a problem in the near future. But it's good to know about the
authentication extension.

By the way, do you have any data about the performance impact of using the
authentication extension to do basic auth + HTTPS compare to talking to
neo4j without authentication (both through REST)? If you have such data,
please let me know. That would be very helpful information.

Thanks,
Nuo



On Tue, Sep 27, 2011 at 6:10 AM, Jacob Hansson 
jacob.hans...@neotechnology.com wrote:

 As far as I know, the auth plugin currently only supports HTTP BASIC
 authentication. But it would be interesting to expand it to allow other
 authentication methods, for instance by allowing pluggable authentication
 providers.

 So if I understand your question correctly, yes, it does support
 authentication beyond just limiting access by IP, but it does not support
 authentication using keys or certificates.

 Out of curiosity, what is the driver behind needing key-based
 authentication? The combination of HTTP BASIC, strong passwords and HTTPS
 seems like it would supply quite strong security, no?

 /Jake

 On Wed, Sep 21, 2011 at 9:16 PM, Nuo Yan yan@gmail.com wrote:

  Limiting access to certain URIs or IPs is great, but ideally at this
 moment
  I also need something like a key-based authentication so I can send a
  private key in the headers from my restclient and neo4j would
 authenticate
  and only take authenticated requests. Does the authentication extension
  support key-based authentication? If not, what forms of authentication
 does
  it currently support (user/password, token-based, shared-secret)?
 
  Thanks,
  Nuo
 
  On Wed, Sep 21, 2011 at 11:24 AM, Peter Neubauer 
  peter.neuba...@neotechnology.com wrote:
 
   Nuo,
   Thomas Baum has been working on an authentication extension for Neo4j
   Server, see https://github.com/neo4j/authentication-extension. He
   could help you set it up and test it - it's used in hosting scenarios
   and should do what you want in terms of limiting access to certain
   URIs if that is what you want?
  
   Cheers,
  
   /peter neubauer
  
   GTalk:  neubauer.peter
   Skype   peter.neubauer
   Phone   +46 704 106975
   LinkedIn   http://www.linkedin.com/in/neubauer
   Twitter  http://twitter.com/peterneubauer
  
   http://www.neo4j.org   - Your high performance graph
  database.
   http://startupbootcamp.org/- Öresund - Innovation happens HERE.
   http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing
 party.
  
  
  
   On Wed, Sep 21, 2011 at 6:14 PM, Nuo Yan yan@gmail.com wrote:
For my scenario, I currently only use the LB for request
  authentication,
   so
that not everyone on the network can access the neo4j server. In my
 use
case, I think making the base uri configurable (including the
 protocol,
   e.g.
https://foobar.com/) is enough.
   
There are a couple other approaches that may also solve my problem.
 For
example, having a configurable option to make the REST APIs return
 only
relative paths in the result. Or, if neo4j could have a built-in
  request
authentication mechanism for the REST interface, I may be able to get
  rid
   of
the lb completely.
   
   
On Wed, Sep 21, 2011 at 7:04 AM, Peter Neubauer 
peter.neuba...@neotechnology.com wrote:
   
Nuo,
right now the server is discovering its own IP upon startup.
 However,
it sounds reasonable to return configurable base URL. I am just
wondering if that really is enough to support a LB scenario? Do you
need more stuff 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   - Your high performance graph
   database.
http://startupbootcamp.org/- Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing
  party.
   
   
   
On Tue, Sep 20, 2011 at 6:57 PM, Nuo Yan yan@gmail.com wrote:
 I access my neo4j server through the REST API. For security
 purpose,
  I
put
 the neo4j server behind a nginx lb. I'm wondering if there is
 config
entry
 somewhere that I can set the neo4j server to return a customized
  base
   uri
 that I can set to my LB's uri.

 For example, 

Re: [Neo4j] Concerning getting all nodes after a traversal

2011-09-27 Thread Michael Hunger
Dan about how many nodes as traversal result are we talking here?

You said you have one type of relationship. How many relationships do you have 
per node pointing to other nodes (outgoing) and incoming (min, max, avg or 
distribution) ?

How many steps does your traversal go?

And what is the usecase behind it? So that we can understand your graph model 
and the operations you'd like to perform.

Perhaps you could also share (privately) a graph generator that would create a 
graph as yours. Then we could run some performance tests of our own.

Cheers

Michael

Am 27.09.2011 um 23:17 schrieb Daniel Morozoff:

 Hi Michael,
 
 Sure we may move it to the mailing list.
 
 We have single nodes connected with one type of relationship. We are running 
 cold cache but using an indexing mechanism to find start node (which we have 
 only one). We also implemented a stop evaluator running on a depth protocol 
 and it is working - so I believe we are traversing the exact amount we need.
 
 Does neo4j support loading an entire db into memory btw?
 
 The reason I asked of blackray, is b/c we need the capability to receive 
 close to instantaneous responses on a web query. So we will need to run the 
 calculation the back end before exposing it to the front end.
 
 Regards,
 
 Dan
 
 
 
 
 On Tue, Sep 27, 2011 at 1:39 PM, Michael Hunger 
 michael.hun...@neotechnology.com wrote:
 Can we take this to the mailing list ?
 
 After all what is your usecase?
 
 What is the structure of your graph, what your starting nodes, etc.
 Do you have cold or hot caches.
 
 I think probably the traverser is not limiting to the right set and traverses 
 too much of the graph.
 
 Cheers
 
 Michael
 
 Am 27.09.2011 um 20:41 schrieb Peter Neubauer:
 
 Daniel, 
 I think Michael has been testing some with these setups...
 
 /peter
 
 Sent from my phone.
 
 On Sep 27, 2011 6:21 PM, Daniel Morozoff danielmoroz...@gmail.com wrote:
  Hi Peter,
  
  Thanks for your response. Makes total sense! Can you recommend any in 
  memory
  DBs like blackray that work well with neo4j and java?
  
  Thanks,
  
  Dan
  
  On Tue, Sep 27, 2011 at 12:26 AM, Peter Neubauer 
  peter.neuba...@neotechnology.com wrote:
  
  Daniel,
  remember that the traversals are lazy, so nothing is traversed until
  you actually iterate. Is that explaining the difference? Also, try
  running the code several times, and the caches and the JVM will help
  to bring times down compared to cold runs.
 
  HTH,
 
  Cheers,
 
  /peter neubauer
 
  GTalk: neubauer.peter
  Skype peter.neubauer
  Phone +46 704 106975
  LinkedIn http://www.linkedin.com/in/neubauer
  Twitter http://twitter.com/peterneubauer
 
  http://www.neo4j.org - Your high performance graph database.
  http://startupbootcamp.org/ - Öresund - Innovation happens HERE.
  http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
  On Mon, Sep 26, 2011 at 9:54 PM, danielmoroz...@gmail.com wrote:
   Hi Peter,
  
   I know you are one of the admins for the forums and I was wondering if
  you could assist me with my question. I posted it already on the forum, 
  but
  have not received a response.
  
   My question pertains to running the getAllNodes() method on a Traverser
  object. It takes drastically longer to get all nodes than to traverse 
  them.
  
   I assumed it was a indexing issue and decompiled the kernel lib file, 
   but
  could not find where the indexing was occurring (as it was not in the
  Traverser class).
  
   Could you give me some input, as we are attempting to optimize our
  algorithms, but 95% of the speed comes from this one method.
  
   Here is a copy of my post:
  
   For your reference the size of the DB is ~6.8 Gb
   
  
   long startTime = System.currentTimeMillis();
   Traverser treeTraverser = root.traverse(
   Traverser.Order.BREADTH_FIRST,
   operator.getStopEvaluator(),
   ReturnableEvaluator.ALL,
   relationshipType,
   Direction.OUTGOING);
  
   long endTime = System.currentTimeMillis();
  
   System.out.println(\n||TIME NEEDED FOR TRAVERSAL:
  +(endTime-startTime)+
   ms||);
   int size = 0;
   startTime =System.currentTimeMillis();
   Iterable Node nodeCollection =
  treeTraverser.getAllNodes();
   endTime = System.currentTimeMillis();
  
   System.out.println(\n||TIME NEEDED TO GET NODES: 
   +(endTime-startTime)+
   ms||);
  
  
   ---
   Console output:::
  
   ||TIME NEEDED FOR TRAVERSAL: 63 ms||
  
   ||TIME NEEDED TO GET NODES: 56875 ms||
  
   
  
   Thank you so much,
  
   Dan
  
 
 
 

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


[Neo4j] Berlin Graph coding dojo, call for participation!

2011-09-27 Thread Pere Urbón Bayes
Graph databases, together with graph processing problems, are a trendy topic
right now. Neo4j is a well known graph database, but there are also others
like OrientDB, DEX, etc. and there are also a big set of graph processing
toolsets like Blueprints, Apache Hamma, Google Pregel like systems, etc. So
from recomendations systems to routing problems graph processing is an
amazing thing to have in your toolset.

With the objective to have together experts and newbies, and for all of them
to have the oportunity to learn new things by doing we launch the Berlin
Graph Coding Dojo. Next 27 of October 2012 we will meet with the main task
of learning and practicing new graph related tasks.

There will be enought food for more experienced people, but also for the
ones who just say, ei! graphdbs are cool, lets gonna see what can I do in a
short time with theme.

If interested, no mather your level of experience with this topic, show up
next 27 of October at the Berlin Coworking Space. Bring your laptop, and in
a couple of hours your will for sure solved a new thing using graphs.

For more information you can join: grap...@googlegroups.com

Lots of thanks to the Berlin Coworking Space for making this event possible.
Also if you want to be an sponsor, collaborate, give your five cents,
whatever!, contact us!.

Details
27/October/2011 19:30h
Berlin Coworking Space [http://g.co/maps/j2tmb]
Adalbertstr. 7-8
10999 Berlin

--
/purbon
- @purbon
- http://www.purbon.com
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] cypher variable relationships

2011-09-27 Thread Michael Hunger
There was a syntax change in the current snapshot from using the caret ^ to a 
star *

Cheers

Michael

Am 27.09.2011 um 11:29 schrieb F. De Haes:

 Hi all,
 
 I tried this cypher query both in the console of the stable and in the
 milestone release, but it produces the same error:
 
 start a=(123) match b-[:`Runs on`^1..3]-a return distinct b
 
 == `]' expected but `^' found
 
 Thanks for your help,
 
 Filip
 ___
 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] .NET client for neo4j

2011-09-27 Thread Tatham Oddie
Docs? But it's OSS! ;) /joke

We haven't publicised it much yet because it's only just starting to hit enough 
breadth of features to be useful. The next step will now be to write it up a 
bit, then blog about it.

It currently builds in TeamCity using MSBuild, then publishes to NuGet using a 
PowerShell script. I've just moved it from our internal build server to my 
public one at http://teamcity.tath.am/ (just click 'Login as Guest').

Testing is solely via unit tests; there are no integration tests. The unit 
tests stub the HTTP layer with canned request/response pairs we have either 
copied from real requests or the documentation. We need to look in to cleaning 
these up a bit - the current mocks are a bit ugly - as well as extending our 
testing to integration.

Without integration tests, I don't see much value pulling this into your build 
framework yet. The build result is only going to change when the Neo4jClient 
source changes, which the current build setup reflects. We're nicely decoupled 
from neo4j changes thanks to the explicit contract of the REST interface.

(As a sidenote, it's probably time I bumped the version number from 0.0.1.x to 
1.0.0.x...)


-- Tatham


-Original Message-
From: neubauer.pe...@gmail.com [mailto:neubauer.pe...@gmail.com] On Behalf Of 
Peter Neubauer
Sent: Tuesday, 27 September 2011 5:23 PM
To: Tatham Oddie
Cc: Neo4j user discussions
Subject: Re: .NET client for neo4j

That's VERY cool, great work, especially regarding Gremlin and Batching!

Now, if there was any good docs we could pull out, I would like to at least 
point to it form the manual, otherwise - what are the requirements to build 
this in a CI system?

Cheers,

/peter neubauer

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

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



On Mon, Sep 26, 2011 at 11:47 PM, Tatham Oddie tat...@oddie.com.au wrote:
 Some more usage examples:

 http://hg.readify.net/neo4jclient/src/tip/Test/ApiUsageIdeas.cs


 -- Tatham


 -Original Message-
 From: Tatham Oddie
 Sent: Tuesday, 27 September 2011 7:41 AM
 To: 'Peter Neubauer'; Neo4j user discussions
 Subject: .NET client for neo4j

 Hi Peter,

 We publish our client on NuGet:
 http://nuget.org/List/Packages/Neo4jClient

 (NuGet is .NET's package manager.)

 The source is at http://hg.readify.net/neo4jclient

 It supports:

  * all the basic CRUD operations

  * index management

  * Gremlin queries via a fluent interface: you use C# lambdas and get
 full code completion in the IDE as you type; we only compile it down
 to Gremlin and send it over the wire when you enumerate it or call a
 scalar method like .Count(). See
 http://dl.dropbox.com/u/5216304/FluentGremlin.png

 This week we moved to parametized Gremlin queries over the wire (eg, 
 g.v(p0).out[[label:p1]]) and saw a good performance improvement in our 
 downstream app. This change was implemented completely within Neo4jClient's 
 query processor so downstream apps just got the improvement automatically.

 We've also started optimizing some of our internal methods to use batching. 
 For example, creating, relating and indexing a node all happens in a single 
 REST call. We'll probably end up exposing the batching API outside of the 
 client too via some type of unit-of-work pattern.

 As for build, our CI triggers on a code push and publishes a new
 package to NuGet upon a successful build. If the tests pass, it gets
 published. (Our unit tests mock out all the REST calls so we have a
 high level of confidence in them. Risk is low anyway, as NuGet makes
 it easy to grab any previous version of the package.)


 -- Tatham

 -Original Message-
 From: neubauer.pe...@gmail.com [mailto:neubauer.pe...@gmail.com] On
 Behalf Of Peter Neubauer
 Sent: Tuesday, 27 September 2011 2:19 AM
 To: Neo4j user discussions
 Cc: Tatham Oddie
 Subject: Re: [Neo4j] Turning Off or Configuring log rotation

 Very cool,
 glad to hear things work out. Got any code for the .NET bindings? I think we 
 should start pulling client libraries into our build system, so there are 
 stable versions of the most used clients for Neo4j available as part of the 
 QA process.

 WDYT?

 Cheers,

 /peter neubauer

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

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



 On Mon, Sep 26, 2011 at 1:24 PM, Romiko Derbynew 
 romiko.derby...@readify.net wrote:
 Hi 

Re: [Neo4j] Clarification on read and write locks

2011-09-27 Thread Bryce
Yeah I had seen that, this would allow partially for what I was hoping to
do, and is still obviously part of the implementation API.  The problem with
this is that (from my reading of LockReleaser and LockManager) you can't
release a read lock that has been attached to a transaction, otherwise you
will have an exception thrown at the point the transaction is doing its lock
cleanups.

Quick explanation of exactly why this is of interest to me:

When client code gets a node collection they can get an iterator from it.
 While they are iterating over the node collection data structure I would
like to read lock as little of the data structure as possible (e.g. say a
node representing a sub branch of a tree), then when the iteration moves out
of that particular scope release the read lock. that works perfectly
fine.

The problem is that client code can abandon an iterator at any point meaning
that either there needs to be a call made to a node collection cleanup
method, or preferably the cleanup releasing of locks is done based on a
transaction finishing (which happens if you enlist the lock into the
transaction using the lock releaser).

Guess I want the best of both worlds, releasing read locks (and even write
locks) when I am sure within the library code that they aren't needed
anymore, but then having dangling locks auto cleaned up at the end of a
transaction.

Cheers
Bryce

On Tue, Sep 27, 2011 at 10:28 AM, McKinley mckinley1...@gmail.com wrote:

 Bryce,

 Have you looked at LockManage.releaseReadLock(...)?


 https://github.com/neo4j/community/blob/master/kernel/src/main/java/org/neo4j/kernel/impl/transaction/LockManager.java#L143

 You can call that method with a null argument for the transaction which
 will
 take you here:


 https://github.com/neo4j/community/blob/master/kernel/src/main/java/org/neo4j/kernel/impl/transaction/RWLock.java#L190

 Which creates a


 https://github.com/neo4j/community/blob/master/kernel/src/main/java/org/neo4j/kernel/impl/transaction/RWLock.java#L469

 I haven't thought through what you are describing, but I just wanted to
 make
 sure you saw that part of the API.

 Cheers,

 McKinley
 ___
 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] Modelling with neo4j

2011-09-27 Thread Bryce
Following up on the part of this discussion about moving the enhanced api
out of the graph collections module, was meaning to get to this earlier but
got side tracked.

The dependency that IndexedRelationship had on the ComparablePropertyType
which I am assuming is what you are referring to there no longer exists.
 PropertySortedTree still has a dependency on ComparablePropertyType but
this collection could be taken along with the enhanced api as a
specialisation of the SortedTree collection specific to the enhanced api.
 As it still implements NodeCollection it can be used as the basis of an
IndexedRelationship, but IndexedRelationship doesn't need to know about it
at all.

I am wondering however whether there is a problem with this as one thing I
just realised isn't happening that previously did is the storage of
the property type into the node collection, and for that matter
PropertySortedTree currently has no node only constructor so wouldn't
currently work correctly I will look into that (hadn't done that since I
haven't even had a good look at the enhanced api yet).

On Sun, Sep 25, 2011 at 3:28 AM, Niels Hoogeveen
pd_aficion...@hotmail.comwrote:


 +1
 Enhanced API grew out of a couple of classes I added to make
 IndexedRelationship work more easily (not exposing comparators), but it is
 essentially a separate component. Giving it that status would help other's
 improve it. Having laid some of the ground work, I feel it needs other
 people's input too. As it stands now, it is very much a one-man's work and
 while I am confident it contains plenty of good ideas, it can only grow with
 the input of other developers, just like IndexedRelationships has become
 much better thanks to the work Bryce put into it, and the work of others to
 include graph-collections with structures I would not even have thought
 about.
 There is however one thing we need to look at. Right now IndexRelationships
 has a dependency on Enhanced API for the indexing of nodes based on a
 property. At the same time Enhanced API has a dependency on
 graph-collections, transparently supporting IndexedRelationships in the API.
 I think it would be best to remove the dependency of graph-collections on
 enhanced-api and only offer the slightly more complex option where the user
 needs to provide a comparator. The other dependency can remain and in fact
 can even be made stronger. Enhanced API could in principle be made to
 support any type of collection, now that Bryce has added a generic
 nodecollection interface.
 I agree enhanced api is not a great name, it says what it does, but
 certainly has little appeal. So I will be happy if someone can come up with
 something sexier.
 Niels
  From: peter.neuba...@neotechnology.com
  Date: Sat, 24 Sep 2011 15:42:13 +0200
  To: user@lists.neo4j.org
  Subject: Re: [Neo4j] Modelling with neo4j
 
  Great thoughts guys!
  I think it would be interesting to break out the Enhanced API from
  graph-collections, rename it into something better (we can think of a
  name together) and provide a more fully fledged example that we can
  document and evolve.
 
  WDYT?
 
  Cheers,
 
  /peter neubauer
 
  GTalk:  neubauer.peter
  Skype   peter.neubauer
  Phone   +46 704 106975
  LinkedIn   http://www.linkedin.com/in/neubauer
  Twitter  http://twitter.com/peterneubauer
 
  http://www.neo4j.org   - Your high performance graph
 database.
  http://startupbootcamp.org/- Öresund - Innovation happens HERE.
  http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
 
 
 
  On Sat, Sep 24, 2011 at 3:37 PM, Rick Bullotta
  rick.bullo...@thingworx.com wrote:
   That's a great summary, Niels.  Very similar to how we've applied Neo4J
 here at ThingWorx, though we've done most of the type system work (nodes and
 relationships are all typed/subtyped) in our application domain layer.  A
 few other items that we leveraged in our implementation that you may wish to
 consider:
  
   - A common pattern we encountered was a collection of typed entities
 (e.g. a typed collection), and we implemented a specific model using
 supernodes for this.  This also allowed us to rapidly and easily
 iterate/search collections and also to organize nodes in a human
 comprehensible way that can be readily viewed with something like Neoclipse
 for troubleshooting purposes.  Also, if the type was truck, we stamped the
 node with the type truck as a property (using enumerations with a custom
 int member) and used that same enum as the relationship type between the
 node and the collection node.  In our model, an entity has a single type,
 but we implemented the concept of supertyping/subtyping in our domain model
  
   - We found quite a few examples where a one-way relationship was more
 than adequate and, instead of incurring the overhead of a relationship
 (particularly when millions of these relationships were attached to a single
 supernode), we used a *property* on a node containing the node