[Neo] Can't argue with that.

2008-04-10 Thread Mattias Persson
http://xkcd.com/403/
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Re: Neo shell problems...

2008-04-30 Thread Mattias Persson
Hi, now I'm back (the brain behind the neo shell :) ).

For starters, the Not in transaction bug was only found in the
1.0-b6 release. It's fixed though, only the shell download link
doesn't refer to the latest jar file! Could someone please fix that!
(I'll attach the right shell-1.0-b6.jar as well). There's also no
assumption of an empty (or non-empty) database so you don't have to do
that reference node thingies.

As for the shell being started without a neo instance already started
(just passing in the path to the neo store), that functionality got
there in the neo/shell -1.0-rc1 version.

Hopefully this new jar will fix the problems.

/ Mattias

2008/4/28 Emil Eifrem [EMAIL PROTECTED]:
 On Sun, Apr 27, 2008 at 11:54 PM, Philip Jägenstedt [EMAIL PROTECTED] wrote:
I don't know why. Again, my nodespace is ∅ so if there are some
assumptions made that there will acutally be something there, it is
not so.

  Quick comment: Mattias (the brain behind the Neo shell) is super busy
  right now and will then be on a plane for about 16 hours. But he'll
  look into this as soon as he's back. There's for certain nothing in
  Neo shell that assumes a non-empty node space though, so that's not
  it.

  Cheers,

  --
  Emil Eifrém, CEO [EMAIL PROTECTED]
  Neo Technology, www.neotechnology.com
  Cell: +46 733 462 271 | US: 206 403 8808

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


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


Re: [Neo] EmbeddedNeo implements NeoService

2008-04-30 Thread Mattias Persson
Ok, great Philip!

2008/4/28 Philip Jägenstedt [EMAIL PROTECTED]:
 OK, updated the wiki for you...

  Philip



  On 4/28/08, Emil Eifrem [EMAIL PROTECTED] wrote:
   On Mon, Apr 28, 2008 at 1:47 AM, Philip Jägenstedt [EMAIL PROTECTED] 
 wrote:
 I'm back with a more philosophical question.
  
  
   Hey Philip,
  
I'm on a five minute break here so let me jump in real quick!
  
  

  http://wiki.neo4j.org/content/One_Minute_Guide_Complete_Code declares

  NeoService neo = new EmbeddedNeo(var/base);

  The super-awsome (really) http://wiki.neo4j.org/content/Design_Guide
  consistently uses EmbeddedNeo. When writing code, which ought I use?
  
  
   You should absolutely use NeoService. We didn't have NeoService when
we first wrote the Design Guide and its showing more than a few signs
of its age. The only time you should directly refer to EmbeddedNeo is
once, when you invoke it's constructor to start Neo.
  
Cheers,
  
  
--
Emil Eifrém, CEO [EMAIL PROTECTED]
Neo Technology, www.neotechnology.com
Cell: +46 733 462 271 | US: 206 403 8808
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user
  
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user

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


Re: [Neo] Maturity of Python bindings?

2008-04-30 Thread Mattias Persson
It could be a problem in maven because wou have to specify the java
source code version (i.e 1.6 or whatever you use). Maven has a
tendency to default to java 1.4. So here is what you'll want to
include in your pom.xml:


build

plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-compiler-plugin/artifactId
configuration
source1.5/source
target1.5/target
/configuration
/plugin
/plugins
/build



So in a simple example the entire pom.xml would look like:

project
modelVersion4.0.0/modelVersion
groupIdmy-groupId/groupId
artifactIdmy-artifactId/artifactId
name/name
version0.1/version

build
plugins
plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-compiler-plugin/artifactId
configuration
source1.5/source
target1.5/target
/configuration
/plugin
/plugins
/build

dependencies
dependency
groupIdorg.neo4j/groupId
artifactIdneo/artifactId
version1.0-rc1-SNAPSHOT/version
/dependency
/dependencies

repositories
repository
idneo4j-public-repository/id
namePublically available Maven 2 repository
for Neo4j/name
urlhttp://m2.neo4j.org/url
snapshots
enabledtrue/enabled
/snapshots
/repository
/repositories
/project

2008/4/28 Emil Eifrem [EMAIL PROTECTED]:
 On Mon, Apr 28, 2008 at 11:16 AM, Philip Jägenstedt [EMAIL PROTECTED] wrote:
   While I've been keeping the Java door open (and gotten a bit enamoured
with it) I am still interested. Maybe I'll even write some code in
Python and some in Java, if that's possible... I'm guessing it's not
possible for two programs to use the sasme datastore at the same time
though, which could potentially be a problem.

  Very true, you can't run two Neo instances (processes, JVMs, etc)
  against the same data store.


  
Also, I'm feeling slightly retarded this morning as I can't figure out
a good place to put my RelationshipTypes enum in Java. Essentially it
needs to be package global, so all I can think of is creating a silly
little class like this:
  
public class Mush {
   public static enum Types implements RelationshipType {
   MUSICBRAINZ,
   ARTISTS,
   ARTIST
   }
}

  You probably want to put it into a file RelTypes.java, which looks like:

enum RelTypes implements RelationshipType
{
   BLAH, BLAH 2
}

  Good luck!

  Cheers,

  --
  Emil Eifrém, CEO [EMAIL PROTECTED]

 Neo Technology, www.neotechnology.com
  Cell: +46 733 462 271 | US: 206 403 8808


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

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


Re: Compiling with Java 1.5 pom.xml (Was: [Neo] Maturity of Python bindings?)

2008-04-30 Thread Mattias Persson
Sorry for the late reply on your previous mail, this is what I
answered exactely :)

2008/4/28 Philip Jägenstedt [EMAIL PROTECTED]:
 On 4/28/08, Emil Eifrem [EMAIL PROTECTED] wrote:
   You probably want to put it into a file RelTypes.java, which looks like:

  That was my first attempt, the class-wrapping was an attempt to get
  maven to compile. It turns out that I needed the following in my
  pom.xml

   build
 plugins
   plugin
 groupIdorg.apache.maven.plugins/groupId
 artifactIdmaven-compiler-plugin/artifactId
 version2.0.2/version
 configuration
   source1.5/source
   target1.5/target
 /configuration
   /plugin
 /plugins
   /build

  I'm not sure what maven does otherwise, but it would seem that it's
  compiling for some older jvm (which I don't have installed, but I
  guess 1.5 can cross-compile). If you want to mention this is the
  documentation somewhere, you can refer to
  http://maven.apache.org/general.html#Compiling-J2SE-5 for the answer.

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

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


Re: [Neo] Re: Neo shell problems...

2008-04-30 Thread Mattias Persson
Oh btw, sorry I meant that that it's the neo jar file which isn't
the latest.

You can download it here:
http://m2.neo4j.org/org/neo4j/neo/1.0-b6/neo-1.0-b6.jar

You could probably download the latest shell as well :) :
http://m2.neo4j.org/org/neo4j/shell/1.0-b6/shell-1.0-b6.jar

2008/4/30 Philip Jägenstedt [EMAIL PROTECTED]:
 Looks like the mailing list doesn't like attachments.



  On 4/30/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Hi, now I'm back (the brain behind the neo shell :) ).
  
For starters, the Not in transaction bug was only found in the
1.0-b6 release. It's fixed though, only the shell download link
doesn't refer to the latest jar file! Could someone please fix that!
(I'll attach the right shell-1.0-b6.jar as well). There's also no
assumption of an empty (or non-empty) database so you don't have to do
that reference node thingies.
  
As for the shell being started without a neo instance already started
(just passing in the path to the neo store), that functionality got
there in the neo/shell -1.0-rc1 version.
  
Hopefully this new jar will fix the problems.
  
/ Mattias
  
2008/4/28 Emil Eifrem [EMAIL PROTECTED]:
  
On Sun, Apr 27, 2008 at 11:54 PM, Philip Jägenstedt [EMAIL PROTECTED] 
 wrote:
I don't know why. Again, my nodespace is ∅ so if there are some
assumptions made that there will acutally be something there, it is
not so.

  Quick comment: Mattias (the brain behind the Neo shell) is super busy
  right now and will then be on a plane for about 16 hours. But he'll
  look into this as soon as he's back. There's for certain nothing in
  Neo shell that assumes a non-empty node space though, so that's not
  it.

  Cheers,

  --
  Emil Eifrém, CEO [EMAIL PROTECTED]
  Neo Technology, www.neotechnology.com
  Cell: +46 733 462 271 | US: 206 403 8808

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


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

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


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


[Neo] Deploy to dist.neo4j.org

2008-05-05 Thread Mattias Persson
Hi I need to deploy the latest neo/shell version to dist.neo4j.org
since those doesn't seem to be the latest... how do I do it, or is
there someone who can do it?
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Re: Neo shell problems...

2008-05-05 Thread Mattias Persson
Oh, good (no windows) :)

It really should work with the latest 1.0-b6 version now, try getting it from:

http://m2.neo4j.org/org/neo4j/shell/1.0-b6/shell-1.0-b6.jar


Yep there's a b0rked dependency on lucene in index-utils, that is on a
todo-list somewhere.

2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
 No Windows for me, thanks. I'm running Ubuntu and the jars that maven
  has collected for me are:

  neo-1.0-rc1-SNAPSHOT.jar

 jta-1.0.1.jar
  shell-1.0-rc1-20080319.221229-7.jar
  index-util-0.4-20080430.070359-1.jar

  and lucene-core-2.3.1.jar, I suppose I should exclude it if I don't want it.

  Philip



  On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Oh, you're using Windows right? I guess that fix came in after shell
1.0-b6. Should work just fine in neo/shell 1.0-rc1.
  
I figure I could patch the b6 version with that fix as well...
  
2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
  
Thanks, I can now connect to my neo running in a tomcat webapp. One
  annoyance is that man says that the only available command is
  quit, which is obviously untrue.

  Philip



  On 4/30/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Oh btw, sorry I meant that that it's the neo jar file which isn't
the latest.
  
You can download it here:
http://m2.neo4j.org/org/neo4j/neo/1.0-b6/neo-1.0-b6.jar
  
You could probably download the latest shell as well :) :
http://m2.neo4j.org/org/neo4j/shell/1.0-b6/shell-1.0-b6.jar
  
2008/4/30 Philip Jägenstedt [EMAIL PROTECTED]:
  
Looks like the mailing list doesn't like attachments.



  On 4/30/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Hi, now I'm back (the brain behind the neo shell :) ).
  
For starters, the Not in transaction bug was only found in 
 the
1.0-b6 release. It's fixed though, only the shell download 
 link
doesn't refer to the latest jar file! Could someone please 
 fix that!
(I'll attach the right shell-1.0-b6.jar as well). There's 
 also no
assumption of an empty (or non-empty) database so you don't 
 have to do
that reference node thingies.
  
As for the shell being started without a neo instance already 
 started
(just passing in the path to the neo store), that 
 functionality got
there in the neo/shell -1.0-rc1 version.
  
Hopefully this new jar will fix the problems.
  
/ Mattias
  
2008/4/28 Emil Eifrem [EMAIL PROTECTED]:
  
On Sun, Apr 27, 2008 at 11:54 PM, Philip Jägenstedt [EMAIL 
 PROTECTED] wrote:
I don't know why. Again, my nodespace is ∅ so if there 
 are some
assumptions made that there will acutally be something 
 there, it is
not so.

  Quick comment: Mattias (the brain behind the Neo shell) is 
 super busy
  right now and will then be on a plane for about 16 hours. 
 But he'll
  look into this as soon as he's back. There's for certain 
 nothing in
  Neo shell that assumes a non-empty node space though, so 
 that's not
  it.

  Cheers,

  --
  Emil Eifrém, CEO [EMAIL PROTECTED]
  Neo Technology, www.neotechnology.com
  Cell: +46 733 462 271 | US: 206 403 8808

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


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

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


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

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


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

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


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


Re: [Neo] Re: Neo shell problems...

2008-05-05 Thread Mattias Persson
Allright weird, and you have:

 dependency
   groupIdorg.neo4j/groupId
   artifactIdshell/artifactId
   version1.0-rc1-SNAPSHOT/version
 /dependency

as well right? I just tried it, and it worked... using Mac OS X Leopard.
(make sure you have the -SNAPSHOT)

2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
 So... which versions should I use together? Currently I have

 dependency
   groupIdorg.neo4j/groupId
   artifactIdneo/artifactId
   version1.0-rc1-SNAPSHOT/version
 /dependency

 dependency
   groupIdorg.neo4j/groupId
   artifactIdindex-util/artifactId
   version0.4-SNAPSHOT/version
 /dependency

  Shouldn't rc1 include everything that b6 does? I moved to rc1 because
  I got some ClassNotFoundException with neo-b6 and
  index-utils-0.3-SNAPSHOT (I think).



  Philip

  On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Oh, good (no windows) :)
  
It really should work with the latest 1.0-b6 version now, try getting it 
 from:
  
  
http://m2.neo4j.org/org/neo4j/shell/1.0-b6/shell-1.0-b6.jar
  
  
  
   Yep there's a b0rked dependency on lucene in index-utils, that is on a
todo-list somewhere.
  
  
2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
 No Windows for me, thanks. I'm running Ubuntu and the jars that maven
  has collected for me are:

  neo-1.0-rc1-SNAPSHOT.jar

 jta-1.0.1.jar
  shell-1.0-rc1-20080319.221229-7.jar
  index-util-0.4-20080430.070359-1.jar

  and lucene-core-2.3.1.jar, I suppose I should exclude it if I don't 
 want it.

  Philip



  On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Oh, you're using Windows right? I guess that fix came in after shell
1.0-b6. Should work just fine in neo/shell 1.0-rc1.
  
I figure I could patch the b6 version with that fix as well...
  
2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
  
Thanks, I can now connect to my neo running in a tomcat webapp. One
  annoyance is that man says that the only available command is
  quit, which is obviously untrue.

  Philip



  On 4/30/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Oh btw, sorry I meant that that it's the neo jar file 
 which isn't
the latest.
  
You can download it here:
http://m2.neo4j.org/org/neo4j/neo/1.0-b6/neo-1.0-b6.jar
  
You could probably download the latest shell as well :) :
http://m2.neo4j.org/org/neo4j/shell/1.0-b6/shell-1.0-b6.jar
  
2008/4/30 Philip Jägenstedt [EMAIL PROTECTED]:
  
Looks like the mailing list doesn't like attachments.



  On 4/30/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Hi, now I'm back (the brain behind the neo shell :) ).
  
For starters, the Not in transaction bug was only 
 found in the
1.0-b6 release. It's fixed though, only the shell 
 download link
doesn't refer to the latest jar file! Could someone 
 please fix that!
(I'll attach the right shell-1.0-b6.jar as well). 
 There's also no
assumption of an empty (or non-empty) database so you 
 don't have to do
that reference node thingies.
  
As for the shell being started without a neo instance 
 already started
(just passing in the path to the neo store), that 
 functionality got
there in the neo/shell -1.0-rc1 version.
  
Hopefully this new jar will fix the problems.
  
/ Mattias
  
2008/4/28 Emil Eifrem [EMAIL PROTECTED]:
  
On Sun, Apr 27, 2008 at 11:54 PM, Philip Jägenstedt 
 [EMAIL PROTECTED] wrote:
I don't know why. Again, my nodespace is ∅ so if 
 there are some
assumptions made that there will acutally be 
 something there, it is
not so.

  Quick comment: Mattias (the brain behind the Neo 
 shell) is super busy
  right now and will then be on a plane for about 16 
 hours. But he'll
  look into this as soon as he's back. There's for 
 certain nothing in
  Neo shell that assumes a non-empty node space 
 though, so that's not
  it.

  Cheers,

  --
  Emil Eifrém, CEO [EMAIL PROTECTED]
  Neo Technology, www.neotechnology.com
  Cell: +46 733 462 271 | US: 206 403 8808

  
___
  Neo mailing list
  User

Re: [Neo] Re: Neo shell problems...

2008-05-05 Thread Mattias Persson
Yep, all that's in 1.0-b6 is in 1.0-rc1 as well.

2008/5/5 Mattias Persson [EMAIL PROTECTED]:
 Allright weird, and you have:


  dependency
groupIdorg.neo4j/groupId
artifactIdshell/artifactId

version1.0-rc1-SNAPSHOT/version
  /dependency

  as well right? I just tried it, and it worked... using Mac OS X Leopard.
  (make sure you have the -SNAPSHOT)



  2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
   So... which versions should I use together? Currently I have
  
   dependency
 groupIdorg.neo4j/groupId
 artifactIdneo/artifactId
 version1.0-rc1-SNAPSHOT/version
   /dependency
  
   dependency
 groupIdorg.neo4j/groupId
 artifactIdindex-util/artifactId
 version0.4-SNAPSHOT/version
   /dependency
  
Shouldn't rc1 include everything that b6 does? I moved to rc1 because
I got some ClassNotFoundException with neo-b6 and
index-utils-0.3-SNAPSHOT (I think).
  
  
  
Philip
  
On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Oh, good (no windows) :)

  It really should work with the latest 1.0-b6 version now, try getting 
 it from:


  http://m2.neo4j.org/org/neo4j/shell/1.0-b6/shell-1.0-b6.jar



 Yep there's a b0rked dependency on lucene in index-utils, that is on a
  todo-list somewhere.


  2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
   No Windows for me, thanks. I'm running Ubuntu and the jars that maven
has collected for me are:
  
neo-1.0-rc1-SNAPSHOT.jar
  
   jta-1.0.1.jar
shell-1.0-rc1-20080319.221229-7.jar
index-util-0.4-20080430.070359-1.jar
  
and lucene-core-2.3.1.jar, I suppose I should exclude it if I don't 
 want it.
  
Philip
  
  
  
On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Oh, you're using Windows right? I guess that fix came in after 
 shell
  1.0-b6. Should work just fine in neo/shell 1.0-rc1.

  I figure I could patch the b6 version with that fix as well...

  2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:

  Thanks, I can now connect to my neo running in a tomcat webapp. 
 One
annoyance is that man says that the only available command 
 is
quit, which is obviously untrue.
  
Philip
  
  
  
On 4/30/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Oh btw, sorry I meant that that it's the neo jar file 
 which isn't
  the latest.

  You can download it here:
  http://m2.neo4j.org/org/neo4j/neo/1.0-b6/neo-1.0-b6.jar

  You could probably download the latest shell as well :) :
  http://m2.neo4j.org/org/neo4j/shell/1.0-b6/shell-1.0-b6.jar

  2008/4/30 Philip Jägenstedt [EMAIL PROTECTED]:

  Looks like the mailing list doesn't like attachments.
  
  
  
On 4/30/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Hi, now I'm back (the brain behind the neo shell :) ).

  For starters, the Not in transaction bug was only 
 found in the
  1.0-b6 release. It's fixed though, only the shell 
 download link
  doesn't refer to the latest jar file! Could someone 
 please fix that!
  (I'll attach the right shell-1.0-b6.jar as well). 
 There's also no
  assumption of an empty (or non-empty) database so 
 you don't have to do
  that reference node thingies.

  As for the shell being started without a neo 
 instance already started
  (just passing in the path to the neo store), that 
 functionality got
  there in the neo/shell -1.0-rc1 version.

  Hopefully this new jar will fix the problems.

  / Mattias

  2008/4/28 Emil Eifrem [EMAIL PROTECTED]:

  On Sun, Apr 27, 2008 at 11:54 PM, Philip Jägenstedt 
 [EMAIL PROTECTED] wrote:
  I don't know why. Again, my nodespace is ∅ so 
 if there are some
  assumptions made that there will acutally be 
 something there, it is
  not so.
  
Quick comment: Mattias (the brain behind the Neo 
 shell) is super busy
right now and will then be on a plane for about 
 16 hours. But he'll
look into this as soon as he's back. There's for 
 certain nothing in
Neo shell that assumes a non-empty node space 
 though, so that's not
it.
  
Cheers

Re: [Neo] Deploy to dist.neo4j.org

2008-05-05 Thread Mattias Persson
Download the jars at:

http://m2.neo4j.org/org/neo4j/neo/1.0-b6/neo-1.0-b6.jar
http://m2.neo4j.org/org/neo4j/shell/1.0-b6/shell-1.0-b6.jar

Those the site currently refers to arent the latest (as you may know).

2008/5/5 Johan Svensson [EMAIL PROTECTED]:
 The dist site only contains releases. You need to deploy a shell fix
  for neo-1.0-b6? If so mail me the jar and I'll put it there.

  -Johan



  On Mon, May 5, 2008 at 1:54 PM, Mattias Persson
  [EMAIL PROTECTED] wrote:
   Hi I need to deploy the latest neo/shell version to dist.neo4j.org
since those doesn't seem to be the latest... how do I do it, or is
there someone who can do it?
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user

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


Re: [Neo] Re: Neo shell problems...

2008-05-05 Thread Mattias Persson
I'll try to reproduce it, what version of Ubuntu/Java are you using?

2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
 Nope, I haven't explicitly included the shell, but doing so I get
  shell-1.0-rc1-SNAPSHOT.jar instead. However, quit is still the only
  command man knows about. This is hardly critical, but I guess you'd
  want to fix it.



  Philip

  On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Yep, all that's in 1.0-b6 is in 1.0-rc1 as well.
  
2008/5/5 Mattias Persson [EMAIL PROTECTED]:
  
Allright weird, and you have:


  dependency
groupIdorg.neo4j/groupId
artifactIdshell/artifactId

version1.0-rc1-SNAPSHOT/version
  /dependency

  as well right? I just tried it, and it worked... using Mac OS X 
 Leopard.
  (make sure you have the -SNAPSHOT)



  2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
   So... which versions should I use together? Currently I have
  
   dependency
 groupIdorg.neo4j/groupId
 artifactIdneo/artifactId
 version1.0-rc1-SNAPSHOT/version
   /dependency
  
   dependency
 groupIdorg.neo4j/groupId
 artifactIdindex-util/artifactId
 version0.4-SNAPSHOT/version
   /dependency
  
Shouldn't rc1 include everything that b6 does? I moved to rc1 
 because
I got some ClassNotFoundException with neo-b6 and
index-utils-0.3-SNAPSHOT (I think).
  
  
  
Philip
  
On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Oh, good (no windows) :)

  It really should work with the latest 1.0-b6 version now, try 
 getting it from:


  http://m2.neo4j.org/org/neo4j/shell/1.0-b6/shell-1.0-b6.jar



 Yep there's a b0rked dependency on lucene in index-utils, that is 
 on a
  todo-list somewhere.


  2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
   No Windows for me, thanks. I'm running Ubuntu and the jars 
 that maven
has collected for me are:
  
neo-1.0-rc1-SNAPSHOT.jar
  
   jta-1.0.1.jar
shell-1.0-rc1-20080319.221229-7.jar
index-util-0.4-20080430.070359-1.jar
  
and lucene-core-2.3.1.jar, I suppose I should exclude it if I 
 don't want it.
  
Philip
  
  
  
On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Oh, you're using Windows right? I guess that fix came in 
 after shell
  1.0-b6. Should work just fine in neo/shell 1.0-rc1.

  I figure I could patch the b6 version with that fix as 
 well...

  2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:

  Thanks, I can now connect to my neo running in a tomcat 
 webapp. One
annoyance is that man says that the only available 
 command is
quit, which is obviously untrue.
  
Philip
  
  
  
On 4/30/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Oh btw, sorry I meant that that it's the neo jar 
 file which isn't
  the latest.

  You can download it here:
  
 http://m2.neo4j.org/org/neo4j/neo/1.0-b6/neo-1.0-b6.jar

  You could probably download the latest shell as well 
 :) :
  
 http://m2.neo4j.org/org/neo4j/shell/1.0-b6/shell-1.0-b6.jar

  2008/4/30 Philip Jägenstedt [EMAIL PROTECTED]:

  Looks like the mailing list doesn't like 
 attachments.
  
  
  
On 4/30/08, Mattias Persson [EMAIL PROTECTED] 
 wrote:
 Hi, now I'm back (the brain behind the neo 
 shell :) ).

  For starters, the Not in transaction bug was 
 only found in the
  1.0-b6 release. It's fixed though, only the 
 shell download link
  doesn't refer to the latest jar file! Could 
 someone please fix that!
  (I'll attach the right shell-1.0-b6.jar as 
 well). There's also no
  assumption of an empty (or non-empty) database 
 so you don't have to do
  that reference node thingies.

  As for the shell being started without a neo 
 instance already started
  (just passing in the path to the neo store), 
 that functionality got
  there in the neo/shell -1.0-rc1 version.

  Hopefully this new jar will fix the problems

Re: [Neo] Re: Neo shell problems...

2008-05-05 Thread Mattias Persson
Great, actually you could start by sending my the exact commands you
use to start neo/shell (simplified jar-filenames in my examples):

o Are you starting neo separately with neo.enableRemoteShell() and
connecting with it remotely, with something like:
1) $ java -cp target/classes:neo.jar:jta.jar:shell.jar
my.class.which.starts.MyNeoService
2) $ java -jar shell.jar
o Are you using only one jvm instance to run the neo service AND the
shell, something like:
1) $ java -cp neo.jar:jta.jar:shell.jar
org.neo4j.util.shell.StartRemoteClient path/to/neo/

Send the commands as precisely as possible.

2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
 Strange, I thought it was an oversight and not a bug as such. Anyway,
  Ubuntu Hardy with Java 1.5 (sun-java5-jre 1.5.0-15-0ubuntu1). I can
  send you debug printouts or whatever you need if you give me
  instructions.



  Philip

  On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
   I'll try to reproduce it, what version of Ubuntu/Java are you using?
  
  
2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
 Nope, I haven't explicitly included the shell, but doing so I get
  shell-1.0-rc1-SNAPSHOT.jar instead. However, quit is still the only
  command man knows about. This is hardly critical, but I guess you'd
  want to fix it.



  Philip

  On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Yep, all that's in 1.0-b6 is in 1.0-rc1 as well.
  
2008/5/5 Mattias Persson [EMAIL PROTECTED]:
  
Allright weird, and you have:


  dependency
groupIdorg.neo4j/groupId
artifactIdshell/artifactId

version1.0-rc1-SNAPSHOT/version
  /dependency

  as well right? I just tried it, and it worked... using Mac OS X 
 Leopard.
  (make sure you have the -SNAPSHOT)



  2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
   So... which versions should I use together? Currently I have
  
   dependency
 groupIdorg.neo4j/groupId
 artifactIdneo/artifactId
 version1.0-rc1-SNAPSHOT/version
   /dependency
  
   dependency
 groupIdorg.neo4j/groupId
 artifactIdindex-util/artifactId
 version0.4-SNAPSHOT/version
   /dependency
  
Shouldn't rc1 include everything that b6 does? I moved to rc1 
 because
I got some ClassNotFoundException with neo-b6 and
index-utils-0.3-SNAPSHOT (I think).
  
  
  
Philip
  
On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Oh, good (no windows) :)

  It really should work with the latest 1.0-b6 version now, 
 try getting it from:


  http://m2.neo4j.org/org/neo4j/shell/1.0-b6/shell-1.0-b6.jar



 Yep there's a b0rked dependency on lucene in index-utils, 
 that is on a
  todo-list somewhere.


  2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
   No Windows for me, thanks. I'm running Ubuntu and the 
 jars that maven
has collected for me are:
  
neo-1.0-rc1-SNAPSHOT.jar
  
   jta-1.0.1.jar
shell-1.0-rc1-20080319.221229-7.jar
index-util-0.4-20080430.070359-1.jar
  
and lucene-core-2.3.1.jar, I suppose I should exclude 
 it if I don't want it.
  
Philip
  
  
  
On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Oh, you're using Windows right? I guess that fix came 
 in after shell
  1.0-b6. Should work just fine in neo/shell 1.0-rc1.

  I figure I could patch the b6 version with that fix 
 as well...

  2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:

  Thanks, I can now connect to my neo running in a 
 tomcat webapp. One
annoyance is that man says that the only 
 available command is
quit, which is obviously untrue.
  
Philip
  
  
  
On 4/30/08, Mattias Persson [EMAIL PROTECTED] 
 wrote:
 Oh btw, sorry I meant that that it's the 
 neo jar file which isn't
  the latest.

  You can download it here:
  
 http://m2.neo4j.org/org/neo4j/neo/1.0-b6/neo-1.0-b6.jar

  You could probably download

Re: [Neo] Re: Neo shell problems...

2008-05-05 Thread Mattias Persson
Sure, my output gives:

Welcome to NeoShell
Available commands: cd env export gsh help jsh ls man mkrel mv pwd
quit rm rmrel set
Use man command for info about each command.
neo-sh (0)$

I guess 'man command', f.ex. man export woul work even in your case!

2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
 OK, if you find you still can't reproduce it I can give you my
  complete source tree :)

  In the meanwhile, could someone just tell me what the available
  commands are? man X works just fine, so if I just know the available
  X's that'd help alot in the exploration.



  Philip

  On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Allright thanks for the digging, I've tried with Ubuntu Hardy and java
1.5 just like you and I can't reproduce it... However!
  
Now it hits me that it just must be the fact that it's run inside a
webapp. 'man' searches for available commands (classes extending
org.neo4j.util.shell.App) by looking at the classpath (directories and
.jar-files). The class loader hierarchy is a little different for
webapps. I'll add a ticket about this problem, to myself!
  
  
2008/5/5 Philip Jägenstedt [EMAIL PROTECTED]:
 First, these are the jars maven give me (complete listing in the
  unlikely case there is actually some strange interaction with one of
  these and the neo shell).

  commons-codec-1.2.jar
  commons-el-1.0.jar
  commons-httpclient-3.0.1.jar
  commons-logging-1.0.3.jar
  htmlparser-1.6.jar

 index-util-0.4-20080430.070359-1.jar
  jbrainz-1.0-SNAPSHOT.jar
  json-taglib-0.5-SNAPSHOT.jar
  jstl-1.1.2.jar

 jta-1.0.1.jar
  jug-1.1.jar
  log4j-1.2.14.jar

 lucene-core-2.3.1.jar

 neo-1.0-rc1-SNAPSHOT.jar
  openid4java-0.9.3.jar
  openxri-client-1.0.1.jar
  openxri-syntax-1.0.1.jar
  shell-1.0-rc1-SNAPSHOT.jar
  standard-1.1.2.jar
  xercesImpl-2.8.1.jar
  xmlsec-1.3.0.jar

  1) Can't be very precise, it's a Java webapp running on tomcat (don't
  know what these are called, a Servlet is just one part). Neo is
  hooked in through a ServletContextListener:

  public final class ContextListener implements ServletContextListener {

 private final Log log = LogFactory.getLog(this.getClass());

 public void contextInitialized(ServletContextEvent event) {

 log.debug(Starting neo service);
 NeoService neo = new EmbeddedNeo(/tmp/neostore);
 neo.enableRemoteShell();
 event.getServletContext().setAttribute(neoService, neo);

 log.debug(Starting index service);
 IndexService indexService = new NeoIndexService(neo);
 event.getServletContext().setAttribute(indexService, 
 indexService);
 }

 public void contextDestroyed(ServletContextEvent event) {

 log.debug(Shutting down index service);
 IndexService indexService =
 
 (IndexService)event.getServletContext().getAttribute(indexService);
 if (indexService != null)
 indexService.shutdown();

 log.debug(Shutting down neo service);
 NeoService neo =
  (NeoService)event.getServletContext().getAttribute(neoService);
 if (neo != null)
 neo.shutdown();
 }
  }

  These only run once, verified by my logs.

  Installed to tomcat with mvn install, but that's hardly helpful to 
 know.

  2)

  (in the project directory where I just built and installed the webapp)

  $ java -jar target/mushup/WEB-INF/lib/shell-1.0-rc1-SNAPSHOT.jar

 NOTE: No port or RMI name specified, using default port 1337 and name 
 'shell'.
  Welcome to NeoShell
  Available commands: quit
  Use man command for info about each command.
  neo-sh (0)$ man

 Available commands: quit
  Use man command for info about each command.
  neo-sh (0)$ ls
  (me) --[MUSICBRAINZ]-- (4)
  (me) --[INDEX_SERVICE]-- (1)

  As you can see, the shell is working, it's just that the command
  listing seems wrong. Are you saying that you get a different (correct)
  listing on some other platform? That sounds very odd to me.



  Philip

  On 5/5/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Great, actually you could start by sending my the exact commands you
use to start neo/shell (simplified jar-filenames in my examples):
  
o Are you starting neo separately with neo.enableRemoteShell() and
connecting with it remotely, with something like:
   1) $ java -cp target/classes:neo.jar:jta.jar:shell.jar
my.class.which.starts.MyNeoService
   2) $ java -jar shell.jar
o Are you using only one jvm instance to run the neo service AND the
shell, something like:
   1) $ java

Re: [Neo] Does RelationshipType enum need to be unique?

2008-05-08 Thread Mattias Persson
I fixed that bug... there will be a new SNAPSHOT of neo in an hour or two!

2008/5/8 Philip Jägenstedt [EMAIL PROTECTED]:
 I've used this DynamicRelationType in my project, but there is
 something strange going on. Look at what I see in the neo shell:

 $ ls
 (me) --[INDEX_SERVICE]-- (1)
 (me) --[MUSICBRAINZ]-- (4)
 neo-sh (0)$ cd 4
 neo-sh (4)$ ls
 (me) --[ARTISTS]-- (5)
 (me) --[MUSICBRAINZ]-- (0)
 neo-sh (4)$ cd 5
 neo-sh (5)$ ls
 (me) --[ARTIST]-- (6)
 (me) --[ARTIST]-- (16)
 (me) --[ARTISTS]-- (4)
 neo-sh (5)$ cd 6
 neo-sh (6)$ ls
 *mbid =[e83144dd-bb95-49fe-b1dd-00bab25cca9e]
 *name =[Robert Miles]
 *sortName =[Miles, Robert]
 (me) --[Myspace]-- (15)
 (me) --[OfficialHomepage]-- (13)
 (me) --[Biography]-- (14)
 (me) --[Discogs]-- (11)
 (me) --[Wikipedia]-- (12)
 (me) --[ARTIST]-- (5)
 neo-sh (6)$ cd 15
 neo-sh (15)$ ls
 *url =[http://www.myspace.com/robertmilesofficial]
 (me) [EMAIL PROTECTED] (6)

 Look at that last line! The Myspace relationship is shown as
 [EMAIL PROTECTED] in the reverse
 direction. It looks like the name has been retrieved with toString()
 or similar instead of name() as per the interface. Has anyone else
 seen this?

 Philip

 On 5/5/08, Peter Haensgen [EMAIL PROTECTED] wrote:
 Hi,

  the enum approach has the disadvantage that the available relationship 
 types are static, e.g. they must be known at compile time. In some cases, 
 this may not be sufficient.
  Therefore I have built a DynamicRelationType, which simply looks like 
 this:

  public class DynamicRelationshipType implements RelationshipType
  {
 private static MapString, RelationshipType types = new HashMapString, 
 RelationshipType();

 private String name;

 private DynamicRelationshipType(String name)
 {
 this.name = name;
 }

 public String name()
 {
 return name;
 }

 public static synchronized RelationshipType getRelationshipType(String 
 name)
 {
 RelationshipType type = types.get(name);
 if (type == null)
 {
 type = new DynamicRelationshipType(name);
 types.put(name, type);
 }

 return type;
 }
  }


  In the application code, you would use like this:

  Node rn = neo.getReferenceNode();
  Node n = neo.createNode();

  RelationshipType t1 = DynamicRelationshipType.getRelationshipType(MyType);
  rn.createRelationshipTo(n, t1);


  Works fine for me!

  FYI,

 Peter



   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
   On Behalf Of Philip Jägenstedt
   Sent: Sonntag, 4. Mai 2008 00:08
   To: Neo user discussions
   Subject: [Neo] Does RelationshipType enum need to be unique?
  
   This question may reveal some ignorance on my side, but I'm going ahead
   anyway.
  
   Is there anything which makes it a bad idea to have several different
   enums implementing RelationshipType and using these for different
   relationships in neo? The reason in my case is that some relationship
   types are native to the model (the MusicBrainz model) and ought to
   reside in org.musicbrainz.RelationTypes or similar, while other
   relationships are specific to my application and not really related to
   the model.
  
   The reason I ask is that I don't really understand what an enum is in
   Java. If I have
  
enum MyRelationshipTypes implements RelationshipType
{
CONTAINED_IN, KNOWS
}
  
   and then rename it to
  
enum MomsRelationshipTypes implements RelationshipType
{
CONTAINED_IN, KNOWS
}
  
   will neo treat these as the same or new relationships?
  
   Philip

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

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

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


[Neo] Node energies

2008-05-09 Thread Mattias Persson
I just had an idéa. I'm currently working on neo as a triple store
components and there are many cases when you have both the subject and
the object (both nodes) and you would like to know which would be the
most optimized node to start from when doing queries.

One simple measurement would be to count the relationships (and
properties?) for both nodes and grab that which had the least, but
that doesn't scale very well. What I want is either a
Node#getRelationshipCount() or a Node#getEnergy() (which would be the
amount of properties and relationships). Or it could be
NeoService#getRelationshipCountForNode( long nodeId ) /
NeoService#getNodeEnergy( long nodeId ). And the neo store would have
knowledge of these counts/energies without actually counting them (one
extra long per node in the store or something).

At least I think it would be nice, and I'm sure others have though
about it as well.


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


Re: [Neo] Re: Transactions in IndexService?

2008-05-11 Thread Mattias Persson
I guess having each request wrapped in one transaction sounds sane and
to answer your previous question the indices (changes to your
IndexService) aren't really written until you call tx.finish(). So
that's either a bug in the IndexService (btw which one do you use,
LuceneIndexService or NeoIndexService?) or your transaction handling
may be buggy, however your supplied example seems correct... we'll
have to test that more.

2008/5/10 Philip Jägenstedt [EMAIL PROTECTED]:
 On 5/10/08, Johan Svensson [EMAIL PROTECTED] wrote:

 If tx.finish() is never called the transaction will never be committed
  or rolled back (holding locks/memory).

 I only have a single transaction wrapping everything I do for the
 entire request. Not nice maybe, I'm trying to work out some better way
 to split it. In any event, it is precisely on the form that you've
 written here, but after the request fails once (due to
 ServletException thrown when the MusicBrainz webservice is overloaded)
 it seems that the indexes created in that very transaction block have
 not been rolled back, because next time I run it seems like there's a
 hit in the index, followed by a NotFoundException. I can reproduce
 this seemingly reliably (well, it depends on the musicbrainz
 webservice getting overloaded, but anyway) if I shut down tomcat,
 remove my data store and run from scratch.

 In other words, the index seems to have been updated/not rolled back
 even though I never called success().

 Bug?

 Philip

 When manually managing transactions always make use of a try finally block:

 Is there a non-manual way to handle transactions? Sounds comfortable...

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

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


Re: [Neo] Re: Transactions in IndexService?

2008-05-11 Thread Mattias Persson
Allright, I'm pretty sure that it's all about the usage of
tx.failure() (which is very seldom needed btw). In the first code
snippet you call tx.failure() inside the for-loop and continues. That
seems a little odd to me since tx.failure() ensures that the
transaction can't be committed, allthough I see that
LuceneIndexService seems to ignore that fact. Then you continue to
insert artists knowing that they won't be committed anyway. That's
probably not right.

In your second snippet you won't be needing the tx.failure() since a
transaction is by default not successful until you call tx.success().

2008/5/11 Philip Jägenstedt [EMAIL PROTECTED]:
 On 5/11/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Hmm allright, great that it's working though. Also it would be nice to
  know which structural changes you made to your code to make it work.

 What this code does is to take a bunch of ids and for each of them (a)
 replicate the musicbrainz entity with that id into the neo store (b)
 if the entity has a wikipedia relationship, extract a text snippet
 from wikipedia and store along with it. The musicbrainz webservice
 throws a 503 if you make more than 1 request per second. Before, I
 just threw a ServletException when that happened. Everything wrapped
 in a single transaction. Like this:

 Transaction tx = Transaction.begin();
 try {
for (UUID id : artistIds) {
MushArtist artist = maf.getArtistById(id);
if (artist == null) {
// replicate data from MusicBrainz WebService
try {
Query q = new Query();
Includes inc = new Includes();
inc.include(url-rels);
Artist mbArtist = q.getArtistById(id, inc);
artist = maf.copyArtist(mbArtist);
} catch (WebServiceException e) {
// FIXME: log this error!
//tx.failure();
//continue;
throw new ServletException(e);
}
}

try {
artist.updateWikipediaBlurb();
} catch (WikipediaException e) {
// FIXME: log this error!
tx.failure();
continue;
}
}
tx.success();
 } finally {
tx.finish();
 }


 Now, I have one transaction for every id, so that successfully
 replicated data is commited immediate. If there is an exception, I
 explicitly call tx.failure() continue with the next id. However, in
 the code below I throw an exception and it works just the same (i.e.
 in the next request I'm not getting
 org.neo4j.impl.core.NotFoundException: Node[40] not found)

 for (UUID id : artistIds) {
Transaction tx = Transaction.begin();
try {
MushArtist artist = maf.getArtistById(id);
if (artist == null) {
// replicate data from MusicBrainz WebService
try {
Query q = new Query();
Includes inc = new Includes();
inc.include(url-rels);
Artist mbArtist = q.getArtistById(id, inc);
artist = maf.copyArtist(mbArtist);
} catch (WebServiceException e) {
// FIXME: log this error!
//tx.failure();
//continue;
throw new ServletException(e);
}
}

try {
artist.updateWikipediaBlurb();
} catch (WikipediaException e) {
// FIXME: log this error!
tx.failure();
continue;
}

artists.add(artist);
tx.success();
} finally {
tx.finish();
}
 }

 As you can see, the only structural change is moving the transaction
 inside the loop. It's a bit tricky to reproduce because the webservice
 only fails after a certain number of requests and there are long
 delays involved with actually accessing it.

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

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


Re: [Neo] Re: Transactions in IndexService?

2008-05-11 Thread Mattias Persson
2008/5/11 Philip Jägenstedt [EMAIL PROTECTED]:
 On 5/11/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Allright, I'm pretty sure that it's all about the usage of
  tx.failure() (which is very seldom needed btw). In the first code
  snippet you call tx.failure() inside the for-loop and continues.

 No, I throw an Exception. updateWikipediaBlurb() isn't failing, it's
 the musicbrainz webservice that fails with a WebServiceException.
 After throwing a ServletException the finally block with tx.finish()
 ought to be run, after which the webserver returns HTTP 500 or
 similar.
Well, somewhere inside that for-loop is a tx.failure(); followed by a
continue; statement. I was refering to that piece of code.

  LuceneIndexService seems to ignore that fact. Then you continue to

 But I'm using NeoIndexService, how does that change matters?
Since NeoIndexService only uses neo it should react properly to the
transaction failure/success, weird that it didn't in your case.

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

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


Re: [Neo] Re: Transactions in IndexService?

2008-05-11 Thread Mattias Persson
Allright, gotcha. I could try to reproduce the problem you had using
your code and maybe find bugs related to it!

2008/5/11 Philip Jägenstedt [EMAIL PROTECTED]:
 No, that part of the code isn't the problem. It's there because I left
 it when moving the transaction outside the loop to reproduce the
 error, it wasn't even there when the problem first occured.

 On 5/11/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Also with some irrelevant parts taken out:

  for ( UUID id : artistIds ) {
  ...

  try {
artist.updateWikipediaBlurb();
} catch (WikipediaException e) {
// FIXME: log this error!
tx.failure();
continue;
}

 ...

 }

  2008/5/11 Philip Jägenstedt [EMAIL PROTECTED]:
   With some irrelevant parts taken out:
  
   Transaction tx = Transaction.begin();
   try {
 for (UUID id : artistIds) {
 MushArtist artist = maf.getArtistById(id);
 if (artist == null) {
 // replicate data from MusicBrainz WebService
 try {
 Query q = new Query();
 Includes inc = new Includes();
 inc.include(url-rels);
 Artist mbArtist = q.getArtistById(id, inc);
 artist = maf.copyArtist(mbArtist);
 } catch (WebServiceException e) {
 throw new ServletException(e);
 }
 }
 }
 tx.success();
   } finally {
 tx.finish();
   }
  
   Philip
  
   On 5/11/08, Mattias Persson [EMAIL PROTECTED] wrote:
   2008/5/11 Philip Jägenstedt [EMAIL PROTECTED]:
  
On 5/11/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Allright, I'm pretty sure that it's all about the usage of
  tx.failure() (which is very seldom needed btw). In the first code
  snippet you call tx.failure() inside the for-loop and continues.

 No, I throw an Exception. updateWikipediaBlurb() isn't failing, it's
 the musicbrainz webservice that fails with a WebServiceException.
 After throwing a ServletException the finally block with tx.finish()
 ought to be run, after which the webserver returns HTTP 500 or
 similar.
  
   Well, somewhere inside that for-loop is a tx.failure(); followed by a
continue; statement. I was refering to that piece of code.
  
   
  LuceneIndexService seems to ignore that fact. Then you continue to

 But I'm using NeoIndexService, how does that change matters?
  
   Since NeoIndexService only uses neo it should react properly to the
transaction failure/success, weird that it didn't in your case.
  
   
 Philip
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

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

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


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

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


Re: [Neo] Re: Transactions in IndexService?

2008-05-11 Thread Mattias Persson
Allright, cool.

2008/5/11 Philip Jägenstedt [EMAIL PROTECTED]:
 Sure. Unfortunately there are a lot of dependencies, but if you give
 me some time I could try to remove as much as possible and then send a
 copy.

 Philip

 On 5/11/08, Mattias Persson [EMAIL PROTECTED] wrote:
 Allright, gotcha. I could try to reproduce the problem you had using
  your code and maybe find bugs related to it!


  2008/5/11 Philip Jägenstedt [EMAIL PROTECTED]:
   No, that part of the code isn't the problem. It's there because I left
   it when moving the transaction outside the loop to reproduce the
   error, it wasn't even there when the problem first occured.
  
   On 5/11/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Also with some irrelevant parts taken out:
  
for ( UUID id : artistIds ) {
...
  
try {
  artist.updateWikipediaBlurb();
  } catch (WikipediaException e) {
  // FIXME: log this error!
  tx.failure();
  continue;
  }
  
   ...
  
   }
  
2008/5/11 Philip Jägenstedt [EMAIL PROTECTED]:
 With some irrelevant parts taken out:

 Transaction tx = Transaction.begin();
 try {
   for (UUID id : artistIds) {
   MushArtist artist = maf.getArtistById(id);
   if (artist == null) {
   // replicate data from MusicBrainz WebService
   try {
   Query q = new Query();
   Includes inc = new Includes();
   inc.include(url-rels);
   Artist mbArtist = q.getArtistById(id, inc);
   artist = maf.copyArtist(mbArtist);
   } catch (WebServiceException e) {
   throw new ServletException(e);
   }
   }
   }
   tx.success();
 } finally {
   tx.finish();
 }

 Philip

 On 5/11/08, Mattias Persson [EMAIL PROTECTED] wrote:
 2008/5/11 Philip Jägenstedt [EMAIL PROTECTED]:

  On 5/11/08, Mattias Persson [EMAIL PROTECTED] wrote:
   Allright, I'm pretty sure that it's all about the usage of
tx.failure() (which is very seldom needed btw). In the first 
 code
snippet you call tx.failure() inside the for-loop and continues.
  
   No, I throw an Exception. updateWikipediaBlurb() isn't failing, 
 it's
   the musicbrainz webservice that fails with a WebServiceException.
   After throwing a ServletException the finally block with 
 tx.finish()
   ought to be run, after which the webserver returns HTTP 500 or
   similar.

 Well, somewhere inside that for-loop is a tx.failure(); followed by a
  continue; statement. I was refering to that piece of code.

 
LuceneIndexService seems to ignore that fact. Then you continue 
 to
  
   But I'm using NeoIndexService, how does that change matters?

 Since NeoIndexService only uses neo it should react properly to the
  transaction failure/success, weird that it didn't in your case.

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

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


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

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

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


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

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


Re: [Neo] Node retrieval failing in OSGi environment

2008-05-31 Thread Mattias Persson
Yes there is.

groupIdorg.neo4j/groupId
artifactIdneo/artifactId
version1.0-rc1-SNAPSHOT/version

2008/5/30 Peter Neubauer [EMAIL PROTECTED]:
 Ok,
 will try that. is there a maven deployed artifact for the rc1-SNAPSHOTs?

 /peter

 On Fri, May 30, 2008 at 3:16 PM, Johan Svensson [EMAIL PROTECTED] wrote:
 What version of Neo are you running?

 And how does OSGI play with singletons? Think you should use the
 rc1-SNAPSHOT where we got rid of all the singletons.

 -Johan

 On Fri, May 30, 2008 at 12:09 PM, Peter Neubauer
 [EMAIL PROTECTED] wrote:
 Hi folks,
 trying to use the ls command in Newton, I get
 neo4j-ls 0
 got id: 0
 Exception in thread Console cmd: neo4j-ls/0
 java.lang.IllegalArgumentException: XaResourceManager is null
at 
 org.neo4j.impl.transaction.xaframework.XaConnectionHelpImpl.init(XaConnectionHelpImpl.java:65)
at 
 org.neo4j.impl.nioneo.xa.NeoStoreXaConnection.init(NeoStoreXaConnection.java:62)
at 
 org.neo4j.impl.nioneo.xa.NeoStoreXaDataSource.getXaConnection(NeoStoreXaDataSource.java:243)
at 
 org.neo4j.impl.nioneo.xa.NioNeoDbPersistenceSource$NioNeoDbResourceConnection.init(NioNeoDbPersistenceSource.java:121)
at 
 org.neo4j.impl.nioneo.xa.NioNeoDbPersistenceSource.createResourceConnection(NioNeoDbPersistenceSource.java:106)
at 
 org.neo4j.impl.persistence.ResourceBroker.acquireResourceConnection(ResourceBroker.java:104)
at 
 org.neo4j.impl.persistence.PersistenceManager.getResource(PersistenceManager.java:111)
at 
 org.neo4j.impl.persistence.PersistenceManager.loadLightNode(PersistenceManager.java:45)
at org.neo4j.impl.core.NodeManager.getNodeById(NodeManager.java:240)
at org.neo4j.api.core.EmbeddedNeo.getNodeById(EmbeddedNeo.java:113)
at 
 org.neo4j.newton.shellcommands.internal.LsCommand.handle(LsCommand.java:39)
at 
 org.cauldron.newton.command.knopflerfish.CommandGroupAdapter.execute(CommandGroupAdapter.java:111)
at org.knopflerfish.bundle.console.Command$2.run(Command.java:233)
at java.security.AccessController.doPrivileged(Native Method)
at org.knopflerfish.bundle.console.Command.run(Command.java:220)
at java.lang.Thread.run(Thread.java:613)

 Using the code for the command:
 public void handle(CommandRequest request, CommandResponse response)
 throws CommandException {
PrintWriter out = getOut(response);
System.out.println(got id:  + request.getArgs()[0]);
StringTokenizer tokens = new
 StringTokenizer(request.getArgs()[0].toString(),  );
String id = tokens.nextToken();
Transaction tx = Transaction.begin();
Node localnode = neo.getNodeById(Long.parseLong(id));

 ..

 Any hints on why the XaResourcemanager is null? Neo is initiated it
 seems, the store is there and the service availabe ...
 The NeoService instance is retrieved from another bundle that only
 exports org.neo4j.core.api. That should be sufficient to expose the
 basic operations, and there is no CNFE.

 /peter

 --

 GTalk: neubauer.peter
 Skype peter.neubauer
 ICQ 18762544
 GTalk neubauer.peter
 Phone +46704 106975
 LinkedIn http://www.linkedin.com/in/neubauer

 http://www.neo4j.org - New Energy for Data - the Graph Database.
 http://www.ops4j.org - New Energy for OSS Communities - Open
 Participation Software.
 http://www.qi4j.org - New Energy for Java - Domain Driven Development.
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

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





 --
 GTalk: neubauer.peter
 Skype peter.neubauer
 ICQ 18762544
 GTalk neubauer.peter
 Phone +46704 106975
 LinkedIn http://www.linkedin.com/in/neubauer

 http://www.neo4j.org - New Energy for Data - the Graph Database.
 http://www.ops4j.org - New Energy for OSS Communities - Open
 Participation Software.
 http://www.qi4j.org - New Energy for Java - Domain Driven Development.
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

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


Re: [Neo] Neo4j for personal information database

2008-09-02 Thread Mattias Persson
I guess a very natural place would be to add it to the neo-utils
Collection implementations. There's a lot of work in and around
collections already done there. Maybe I could take a look at extending
that implementation with Comparator.

2008/9/1 Johan Svensson [EMAIL PROTECTED]:
 I think we could add a collection utility that keeps a set of nodes
 sorted according to a comparator given at creation time (of the
 collection utility). Later we could add support so an exception is
 thrown if the comparator is not serializable but for now we can just
 do a quick implementation where the right comparator has to be passed
 in constructor to maintain consistent state.

 I'll create a ticket for this and hopefully someone will see to it
 quite soon (we are currently quite busy with the upcoming release).

 -Johan

 On Tue, Aug 26, 2008 at 4:53 PM, Nils Kaiser [EMAIL PROTECTED] wrote:
 The comparator approach sounds more suited to me as well... sorting
 should probably not be done in memory here, and it might make sense to
 generate some indexes to allow quick filtering within that collection or
 graph subset or so.

 Has anyone done anything similar yet? That requirement seems to be the
 only thing preventing me to give a Neo4j a go (vs. for example jackrabbit).

 Please correct me if anything doesnt make sense!

 Nils

 Anders Nawroth schrieb:
 A sorted structure seems like a really good idea to me.
 But i'd rather like to see something more generic, where the user
 provides a ComparatorNode implementation.

 One reason for this is that Strings can be sorted in different ways,
 using different Locales, case in/sensitive and so on. If there is a
 clear benefit from it, some common use cases could be covered by
 prebuilt Comparators. Or code snippets in the documentation (would be my
 choice) laying out common use cases.

 And the user could also do so much more fun things with a Comparator to
 play with :-)

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

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


Re: [Neo] Neo Template API

2008-09-24 Thread Mattias Persson
Hi Michael,

Great utilities. It'll be interesting to try and use them as soon as
possible in a project to see what they can do.

Over time I've collected some various utilities in neo-utils. They
aren't very organized :) but there's stuff in there which I see myself
writing over and over again, f.ex:

o If you'd like to have a sub reference node to the neo reference
node, f.ex. a node to connect all users to:

NeoUtil neoUtil = new NeoUtil( neo );
Node usersRefNode = neoUtil.getOrCreateSubReferenceNode( MyRelTypes.USERS );

o Simple methods which wraps a single node/relationship
has/get/set/removeProperty in a transaction.

public String methodWhichIsntInATransactionRightNow()
{
return ( String ) neoUtil.getProperty( myKey );
}

o Various handling of node/relationship array property values.

ListObject values = neoUtil.neoPropertyAsList( node.getProperty(
keyWithOrWithoutArrayValue ) );
values.add( Mattias );
node.setProperty( keyWithOrWithoutArrayValue, values );

o Expose a node as a Collection (1 to *) or a Link (1 to 0..1)

public class User extends NodeWrapperImpl


CollectionUser users = new NodeWrapperRelationshipSetUser(
neo, usersRefNode, MyRelTypes.USERS, User.class );
for ( User user : users ) ...
users.add( ... );
users.remove( ... );
users.clear();
a.s.o.

Feel free to try out neo-utils as well and give feedback. I should
definately document that component more though.


--
Mattias Persson
Neo Technology
[EMAIL PROTECTED]

2008/9/24 Michael Hunger [EMAIL PROTECTED]:
 Hi folks,

 after a cool geek cruise with Emil and other. I added my contribution to the 
 svn.
 You can find it under neo-template-api.

 It's an IoC, ResourceManagement API (like Spring Templates) which executes 
 the callback within a neo transaction.

 I also added wrapper for the NeoService for just having the Node stuff 
 available and a Status interface for marking the
 transaction for rollback.

 Other stuff I did was creating a GraphDescription class which can be used 
 programmatically and with property files to
 setup test data (dot syntax files are next).

 The Traversal class has a fluent API for specifiying what you want.

 some examples:
 final NeoTemplate template = new NeoTemplate(neo);
 template.execute(new NeoCallback()
 {
 public void neo(final Status status, final Graph graph) throws 
 Exception
 {
 Node refNode = graph.getReferenceNode();
 Node node = graph.createNode(_(name, Test), _(size, 
 100));
 refNode.createRelationshipTo(node, HAS);

 final Relationship toTestNode = 
 refNode.getSingleRelationship(HAS, Direction.OUTGOING);
 final Node nodeByRelationship = toTestNode.getEndNode();
 assertEquals(Test, nodeByRelationship.getProperty(name));
 assertEquals(100, nodeByRelationship.getProperty(size));
 }
 });
 template.execute(new NeoCallback()
 {
 public void neo(final Status status, final Graph graph) throws 
 Exception
 {
 Node refNode = graph.getReferenceNode();
 final Relationship toTestNode = 
 refNode.getSingleRelationship(HAS, Direction.OUTGOING);
 final Node nodeByRelationship = toTestNode.getEndNode();
 assertEquals(Test, nodeByRelationship.getProperty(name));
 assertEquals(100, nodeByRelationship.getProperty(size));
 }
 });


 some traversal fluent api possibilities:
 final Traversal traversal = 
 Traversal.walk().breadthFirst().depthFirst()
 .stopOn(StopEvaluator.DEPTH_ONE).first().all()
 .incoming(HAS).outgoing(HAS).twoway(HAS);

 use just graph.traverse(traversal,[startNode],[Mapper])
 like in:
 assertEquals(all members, asList(names),
 graph.traverse(graph.getReferenceNode(), traversal,
 new MapperNode, String()
 {
 public String map(final Node node)
 {
 return (String) 
 node.getProperty(name, );
 }
 }));



 template.execute(new NeoCallback()
 {
 public void neo(final Status status, final Graph graph) throws 
 Exception
 {
 final GraphDescription heaven = new GraphDescription();
 heaven.add(adam, age, 1);
 heaven.add(eve, age, 0);
 heaven.relate(adam, HAS, eve);
 graph.load(heaven);

 checkHeaven(graph);
 }
 });


 Have fun

 Michael

 --
 Michael Hunger
 Independent Consultant

 Web: http://www.jexp.de
 Email: [EMAIL

Re: [Neo] Groovy and Neo4J - A working example

2008-12-12 Thread Mattias Persson
Nice,

That would actually be my next question :)

Cool things indeed.

2008/12/12 Guillaume Laforge glafo...@gmail.com:
 You can also do some fun things like:

 def myNodeName = firstName
 assert person.${myNodeName} == firstName

 :-)

 On Fri, Dec 12, 2008 at 11:41 AM, Mattias Persson
 matt...@neotechnology.com wrote:
 Awesome,

 that takes care of that then, thanks!

 2008/12/12 Guillaume Laforge glafo...@gmail.com:
 In Groovy, you can quote method names and properties.

 So when you have weirdo characters, you can do that instead:

 myNode.super - funky + node / name = something.


 On Fri, Dec 12, 2008 at 11:36 AM, Mattias Persson
 matt...@neotechnology.com wrote:
 Hmm, this thread is probably dead?

 But, I just thought about the:

 myNode.name = Mattias
 myNode.someProperty = Something else

 Keep in mind that property keys have no restrictions as to length or
 content which means a property key can contain spaces and '='
 characters and what not. f.ex.

 myNode.a property with spaces in it = Hello there

 Wouldn't work, right?

 Could you use the real methods (setProperty/getProperty/hasProperty)
 for such keys instead?

 2008/12/7 Stig Lau stig@gmail.com:
 I've tossed up a demo of Neo4J vs Groovy which shows Neo4J running in
 Groovy with the help of some Maven magic. Sadly nough, I didn't get
 Guillaume's propositions working, so I'm leaving the ball over to the
 guys who know Groovy a little better than me.
 The project is packaged as a Maven Archetype, as a test of improving
 deployment of sourcecode. Instructions are posted on the blog. The
 source code is hosted on Mercurial, so feel free to move it to a VCS
 of choice, as I consider it property of the Neo4J community.
-Stig,

 http://stigl.wordpress.com/groovy-does-neo4j-thanks-to-maven-simplicity

 From: Guillaume Laforge
 Subject: [Neo] Groovy and Neo4J

 Hi all,

 I had an email exchange with Emil this morning about what Groovy could
 bring to using Neo4J. I think using a dynamic language with a graph
 database can make a lot of sense, as it's easier to work with a less
 strict language with semi structured data not requiring heavyweight
 set-in-stone schemas.

 ---%--

 I haven't downloaded and tried Neo yet, but if I find some time, I'd
 be happy to give it a try.
 As you were mentioning that Groovy should probably work well with Neo,
 yes, I'm pretty certain it does, and I'm sure we could bring some
 Groovyisms into the loop to make using Neo even more seamless and
 nice.

 For instance, if I look at your quick start example:

 Node firstNode = neo.createNode();
 Node secondNode = neo.createNode();
 Relationship relationship = firstNode.createRelationshipTo(
 secondNode, MyRelationshipTypes.KNOWS );

 firstNode.setProperty( message, Hello,  );
 secondNode.setProperty( message, world! );
 relationship.setProperty( message, brave Neo  );

 Groovy handles the setProperty/getProperty methods in a particular
 fashion, and without doing anything special, you should be able to
 directly use this nicer syntax in Groovy:

 firstNode.message = Hello
 secondNode.message = world!
 relationship.message = brave Neo

 It really gives people the impression of working with real objects,
 with real properties or methods.

 With maps or expandos in Groovy, you can already manipulate
 quasi-beans with that syntax, and people may potentially not need to
 manipulate Node or Relationship directly, but could use these maps /
 expandos instead, and it would only be when storing these in the graph
 database that you could coerce the type to Node or Relationship.

 More concretely:

 def firstNode = [:]
 firstNode.message = Hello

 And you could then just call some store() method in your APIs --
 although it seems in the tutorial, there's no need to store, just
 creating the nodes and relationships are enough.

 Also for relationships, we could imagine using Groovy's native list
 syntax for representing such triples (and using static import for
 KNOWS):

 def relationship = [ firstNode, KNOWS, secondNode ]

 Combining everything:

 [
   [name: Neo],
   [KNOWS: [since: someDate],
   [name: Trinity]
 ]

 I was also mentioning coercion, as you can create custom type coercion
 in Groovy (kind of a cast, if you wish, but you can transform
 something into some other type):

 [name: Neo] as Node
 [ firstNode, KNOWS, secondNode ] as Relationship

 Or simply at declaration time:

 Node neo = [name: Neo]
 Relationship rel =  [ firstNode, KNOWS, secondNode ]

 Anyway... enough brainstorming for now, but a graph database like Neo
 and a dynamic language like Groovy, and you can really really have
 fun.
 Congratulations for a great graph database project!
 Keep up the good work.

 --
 Guillaume Laforge
 Groovy Project Manager
 Head of Groovy Development at SpringSource
 http://www.springsource.com/g2one

 ___
 Neo mailing list
 User@lists.neo4j.org
 https

Re: [Neo] Groovy and Neo4J - A working example

2008-12-12 Thread Mattias Persson
Hmm, this thread is probably dead?

But, I just thought about the:

myNode.name = Mattias
myNode.someProperty = Something else

Keep in mind that property keys have no restrictions as to length or
content which means a property key can contain spaces and '='
characters and what not. f.ex.

myNode.a property with spaces in it = Hello there

Wouldn't work, right?

Could you use the real methods (setProperty/getProperty/hasProperty)
for such keys instead?

2008/12/7 Stig Lau stig@gmail.com:
 I've tossed up a demo of Neo4J vs Groovy which shows Neo4J running in
 Groovy with the help of some Maven magic. Sadly nough, I didn't get
 Guillaume's propositions working, so I'm leaving the ball over to the
 guys who know Groovy a little better than me.
 The project is packaged as a Maven Archetype, as a test of improving
 deployment of sourcecode. Instructions are posted on the blog. The
 source code is hosted on Mercurial, so feel free to move it to a VCS
 of choice, as I consider it property of the Neo4J community.
-Stig,

 http://stigl.wordpress.com/groovy-does-neo4j-thanks-to-maven-simplicity

 From: Guillaume Laforge
 Subject: [Neo] Groovy and Neo4J

 Hi all,

 I had an email exchange with Emil this morning about what Groovy could
 bring to using Neo4J. I think using a dynamic language with a graph
 database can make a lot of sense, as it's easier to work with a less
 strict language with semi structured data not requiring heavyweight
 set-in-stone schemas.

 ---%--

 I haven't downloaded and tried Neo yet, but if I find some time, I'd
 be happy to give it a try.
 As you were mentioning that Groovy should probably work well with Neo,
 yes, I'm pretty certain it does, and I'm sure we could bring some
 Groovyisms into the loop to make using Neo even more seamless and
 nice.

 For instance, if I look at your quick start example:

 Node firstNode = neo.createNode();
 Node secondNode = neo.createNode();
 Relationship relationship = firstNode.createRelationshipTo(
 secondNode, MyRelationshipTypes.KNOWS );

 firstNode.setProperty( message, Hello,  );
 secondNode.setProperty( message, world! );
 relationship.setProperty( message, brave Neo  );

 Groovy handles the setProperty/getProperty methods in a particular
 fashion, and without doing anything special, you should be able to
 directly use this nicer syntax in Groovy:

 firstNode.message = Hello
 secondNode.message = world!
 relationship.message = brave Neo

 It really gives people the impression of working with real objects,
 with real properties or methods.

 With maps or expandos in Groovy, you can already manipulate
 quasi-beans with that syntax, and people may potentially not need to
 manipulate Node or Relationship directly, but could use these maps /
 expandos instead, and it would only be when storing these in the graph
 database that you could coerce the type to Node or Relationship.

 More concretely:

 def firstNode = [:]
 firstNode.message = Hello

 And you could then just call some store() method in your APIs --
 although it seems in the tutorial, there's no need to store, just
 creating the nodes and relationships are enough.

 Also for relationships, we could imagine using Groovy's native list
 syntax for representing such triples (and using static import for
 KNOWS):

 def relationship = [ firstNode, KNOWS, secondNode ]

 Combining everything:

 [
   [name: Neo],
   [KNOWS: [since: someDate],
   [name: Trinity]
 ]

 I was also mentioning coercion, as you can create custom type coercion
 in Groovy (kind of a cast, if you wish, but you can transform
 something into some other type):

 [name: Neo] as Node
 [ firstNode, KNOWS, secondNode ] as Relationship

 Or simply at declaration time:

 Node neo = [name: Neo]
 Relationship rel =  [ firstNode, KNOWS, secondNode ]

 Anyway... enough brainstorming for now, but a graph database like Neo
 and a dynamic language like Groovy, and you can really really have
 fun.
 Congratulations for a great graph database project!
 Keep up the good work.

 --
 Guillaume Laforge
 Groovy Project Manager
 Head of Groovy Development at SpringSource
 http://www.springsource.com/g2one

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




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


Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Mattias Persson
2008/12/15 Emil Eifrem e...@neotechnology.com:
 On Mon, Dec 15, 2008 at 2:28 PM, Mwanji Ezana mwa...@gmail.com wrote:
 Hi Mattias and Johan,

 Thanks for the tips. Actually, I didn't know about
 Runtime.addShutdownHook(), which is why I was having trouble and was
 shutting down on every transaction.

 I don't think that this is mentioned on the wiki anywhere. It would be nice
 to do so, since using addShutdownHook() might not be intuitive for a lot of
 people.
You're right, we aren't as good as can be on that point. I guess we'll
deal with those missing details soon.

 There's also this idea:

 quote who=myself from=a week or so ago on the mailing list
 Idea: What if EmbeddedNeo's constructor registered a shutdown hook
 with the JVM to shutdown (if not already done) when the JVM exits?
 There's obvious goodness with that, but any bad consequences that I'm
 missing?
 /quote
It's a bad idea if you f.ex. have an IndexService which should be
shutdown before the NeoService... but that's an issue we'll solve with
events later on right?

 I think I'm hesitating on this because it's clearly a hack around not
 having proper life cycle support in Java. But unless someone can tell
 me why that would be a bad idea, I'll add it to the trunk?

 Cheers,

 --
 Emil Eifrém, CEO [e...@neotechnology.com]
 Neo Technology, www.neotechnology.com
 Cell: +46 733 462 271 | US: 206 403 8808
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] cost of startup and shutdown of NeoService instances

2008-12-15 Thread Mattias Persson
2008/12/15 Emil Eifrem e...@neotechnology.com:
 On Mon, Dec 15, 2008 at 6:06 PM, Anders Nawroth
 and...@neotechnology.com wrote:
 Then EmbeddedNeo could have a mechanism for registering services that it
 should shutdown before it finalizes itself?

 ... and we're quickly starting to grow into something we're not: a
 service container. Let's leave that to the IoC guys. I think a good
 functional demarcation is to have the Neo4j kernel propagate events
 about what it's doing and allow external components and services to
 subscribe to those. Then they're aware of the EmbeddedNeo instance
 they're working with, but EmbeddedNeo is unaware of any services using
 it.
I agree and that would be very nice to have such events.

 Cheers,

 --
 Emil Eifrém, CEO [e...@neotechnology.com]
 Neo Technology, www.neotechnology.com
 Cell: +46 733 462 271 | US: 206 403 8808
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] VerboseQuadStore and spaql

2009-01-30 Thread Mattias Persson
Hi Lyudmila,

as Emil pointed out our sparql support doesn't yet support all
possible cases, but according to my knowledge a ?S P ?O construct is
supported and tests in the sparql engine verifies that. It can however
depend on what other triple constraints your query has. The neo sparql
engine needs (as of now, at least) some kind of reasonable starting
point; somewhere to start the traversing from and it may be that
decision which is causing your problems. If you could send your sparql
query I could make a much better conclusion as to the source of the
problem.

Best,

Mattias

2009/1/30 Emil Eifrem e...@neotechnology.com:
 On Thu, Jan 29, 2009 at 9:54 PM, Lyudmila Balakireva lu...@lanl.gov wrote:
 Hello,
 I was testing sail rdf  component  and  I  made test store based
 onVerboseQuadStore .
 I have problem with predicate  in sparql .  If I  specify  predicate
 like  ?x dc:type ?z  the query does not returning anything. (I do
 have  dc namespace prefix). It is work if I do (?x?y?z) or (?x ?y
 snow)  or url in subject or object position.
 It is work with specific predicate if I do getStatements().
 Any clue would be great.

 Hi Luda,

 Our Sparql support is so-so: it's optimized *enough* for the
 particular commercial use cases that our Sparql-swinging customers
 have required so far. And the ?s predicate ?o pattern may very well be
 one that hasn't been required (yet). But Mattias would know more about
 this than me. Mattias?

 It's weird though that it works in getStatements(). How have you
 configured and assembled your components? Also, do you use
 Sparql-over-SAIL or the Neo4j Sparql engine?

 Cheers,

 --
 Emil Eifrém, CEO [e...@neotechnology.com]
 Neo Technology, www.neotechnology.com
 Cell: +46 733 462 271 | US: 206 403 8808
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] VerboseQuadStore and spaql

2009-01-30 Thread Mattias Persson
 commercial use cases that
our Sparql-swinging customers  have required so
far. And the ?s predicate ?o pattern may very
well be  one that hasn't been required (yet).
But Mattias would know more about  this than
me. Mattias?   It's weird though that it works
in getStatements(). How have you  configured
and assembled your components? Also, do you
use  Sparql-over-SAIL or the Neo4j Sparql
engine?   Cheers,   --  Emil EifrÃ(c)m, CEO
[e...@neotechnology.com]  Neo Technology,
www.neotechnology.com  Cell: +46 733 462 271 |
US: 206 403 8808 
___ 
  Neo mailing list  User@lists.neo4j.org 
https://lists.neo4j.org/mailman/listinfo/user 
-- Mattias Persson, [matt...@neotechnology.com]
Neo Technology, www.neotechnology.com
___
Neo mailing list User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] VerboseQuadStore and spaql

2009-02-09 Thread Mattias Persson
I just tried your query on a minimal dataset, guessing the structure
from your query. That query gave me results however. Here's the data I
used:

SailConnection connection = sail.getConnection();
URI photo = fa.createURI( http://test/photo1; );
URI tagPredicate = fa.createURI( http://test/tagPredicate1; );
URI tagPredicate2 = fa.createURI( http://test/tagPredicate2; );
URI photoTagsPredicate = fa.createURI( http://test/tags; );
URI photoTags = fa.createURI( http://test/photoTags1; );
URI aggregates = fa.createURI(
http://www.openarchives.org/ore/terms/aggregates; );
connection.addStatement( photo, photoTagsPredicate, photoTags );
connection.addStatement( photoTags, tagPredicate,
fa.createLiteral( yo ) );
connection.addStatement( photo, tagPredicate2,
fa.createLiteral( photo ) );
connection.addStatement( photo, aggregates, fa.createURI(
http://something; ) );
connection.commit();
connection.close();

After that I ran your copy-pasted code and it found the
http://test/photo1; resource. I can't tell why you aren't getting
answers. Did I understand the data structure correctly? To investigate
further I'd need some sample data from you which I could perform the
query upon.

Best,
Mattias

2009/1/30 Mattias Persson matt...@neotechnology.com:
 Allright, it seems you are using sparql-on-sail and not our integrated
 neo sparql-engine. I have quite little experience with that setup, I
 must add. Though I don't see why your case shouldn't work, since the
 VerboseQuadStore supports all combinations of S P O C. I'm going on
 vacation tomorrow for a week, but I'm sure someone else could look at
 it while I'm away.

 Best,

 Mattias

 2009/1/30 Lyudmila Balakireva lu...@lanl.gov:
 thank you for looking , my query snippet:
 try
 {
 sail.initialize();
 Repository repo = new SailRepository( sail );
 RepositoryConnection rc = repo.getConnection();
 ValueFactory f = repo.getValueFactory();

 //SailConnection sc = sail.getConnection();

  String   queryStr = PREFIX
 ore:http://www.openarchives.org/ore/terms/\n  +
PREFIX
 rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#\n  +
PREFIX
 orex:http://library.lanl.gov/orex/terms/ \n +
PREFIX dc:http://purl.org/dc/elements/1.1/\n +
 SELECT ?photo   WHERE {   +
?s ?p  \+ tag +\  .+
   ?photo  ?x  ?s  .  +
  ?photo  ?y  \photo\ .   +
// ?photo
 ore:aggregates  ?i . + //this is does not work
  }  ;  // LIMIT  +limit +  OFFSET  + offset  ;

 System.out.println(queryStr: + queryStr);
   // query = parser.parseQuery(
 queryStr, baseURI ); // tryed as in test example  same result

 TupleQuery tupleQuery =
 rc.prepareTupleQuery(QueryLanguage.SPARQL,queryStr);
 TupleQueryResult result_s = tupleQuery.evaluate();

 //  results = sc.evaluate( query.getTupleExpr(),
 query.getDataset(),bindings, false );

 while ( result_s.hasNext() )
 {

 BindingSet set = result_s.next();
 Value photo_ = ( Value ) set.getValue( photo );
 String P =photo_.toString();

 Photo photoobj = new Photo();
   photoobj.setPhotoUrl(P);

setURI(P,photoobj,rc,f);
 photoes.add(photoobj);

 }

 result_s.close();
 //sc.close();
 rc.commit();
 rc.close();



 public void setURI (String photouri,  Photo photoobj,RepositoryConnection
 rc,ValueFactory f) throws RepositoryException {

 RepositoryResultStatement resultt
 =
 rc.getStatements(f.createURI(photouri),f.createURI(ore:aggregates),
 null, true); //same stuff working

 while (resultt.hasNext()) {
Statement st = resultt.next();
 Resource s = st.getSubject();
 Resource p = st.getPredicate();
 Value o = st.getObject();
 if (o.toString().contains(_t)) {
 photoobj.setThumb(o.stringValue());
 System.out.println(s.toString()+,+
 p.toString()+,+o.toString());
 }
 if (o.toString().contains(_m)) {
 photoobj.setFull(o.stringValue());
 System.out.println(s.toString()+,+
 p.toString()+,+o.toString());
 }
// System.out.println(s.toString

Re: [Neo] Google Alert - neo4j

2009-02-13 Thread Mattias Persson
I went through the exact same steps as Tobias and came to the same
quick conclusion.

2009/2/13 Tobias Ivarsson tobias.ivars...@neotechnology.com:
 HGDB at least suffer from the problem of being hard to find, searching for
 HGDB on google doesn't even list it in the first page. I'm guessing that
 this is the project though:
 - http://www.kobrix.com/hgdb.jsp
 - http://code.google.com/p/hypergraphdb/
 (searching for hypergraphdb gives better matches)

 The second problem it has it that Google code is a crappy service, it's not
 possible for me to check out the source...

 An equally quick assessment from me as the one made in that thread, is that
 HGDB is about as mature as Neo gen1 (about 2004 or something like that).

 /Tobias

 On Fri, Feb 13, 2009 at 9:35 AM, Peter Neubauer neubauer.pe...@gmail.com
 wrote:


 http://groups.google.com/group/opencog/browse_thread/thread/3c13954e58c9241?pli=1
 states that HGDB is way ahead from looking at the Wiki. Kind af fast
 judgement, but maybe one we should analyze ...

 /peter

 Do Good. www.opencauses.org.

 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 - New Energy for Data - the Graph Database.
 http://www.ops4j.org - New Energy for OSS Communities - Open
 Participation Software.
 http://www.qi4j.org- New Energy for Java - Domain Driven
 Development.





 -- Forwarded message --
 From: Google Alerts googlealerts-nore...@google.com
 Date: Fri, Feb 13, 2009 at 9:28 AM
 Subject: Google Alert - neo4j
 To: ale...@neotechnology.com


 Google Groups Alert for: neo4j

 [OpenCog] Re: Backing Store
 An alternative that Cassio dug up recently would be Neo
 http://neo4j.org/ which is an OSS graph DB. It could be wrapped in the
 HGDB interface; or connected ...
 opencog - Feb 13, 2009 by - 16 message - 5 author

 
  This as-it-happens Google Alert is brought to you by Google.

 Remove this alert.
 Create another alert.
 Manage your alerts.



 --
 Tobias Ivarsson tobias.ivars...@neotechnology.com
 Hacker, Neo Technology
 www.neotechnology.com
 Cellphone: +46 706 534857




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


Re: [Neo] Uses of NotFoundException

2009-02-13 Thread Mattias Persson
2009/2/13 Adam Rabung adamrab...@gmail.com:
 Hello,
 First - I am new to Neo, but very interested.  After years of solving
 problems w/ a relational model, neo is a breath of fresh air.  So far, the
 API has been a breeze.
Hi, glad to hear that!

 I recently ran into a problem where traversals were simply stopping sooner
 than I expected.  Being a neophyte, I suspected I had chosen the wrong
 StopEvaluator, Directions, etc for my traversal.  Even after opening up the
 traversal parameters completely, I was still getting only a small section of
 the graph.  I came to realize the true problem was my custom StopEvaluator:
 node.getProperty(label);
 In my case, not all nodes have a label property.  This call was causing a
 NotFoundException, which is caught and swallowed by
 AbstractTraverser.traverseToNextNode.  From the comments, it looks like
 NotFoundException is legitimately possible if multiple threads are
 performing a traversal.  The consequence is any problem accessing Node
 properties inside of a StopEvaluator results in a silent traversal failure -
 it looks like the nodes just aren't there.
That's something we should look into. I'd say the best way would be
for that exception to be propagated up so that your application could
know about it, I'm not 100% sure how such thing work at the moment.
And another thing: in your case it'd probably be best to use the
node.getProperty( label, null ) method which, instead of throwing
NotFoundException will return null if the label property isn't
there... in case you haven't already seen that method.

 Since NotFoundException has such a distinct and unrelated meaning for
 AbstractTraverser, maybe a PropertyNotFoundException could be used for
 indicating a problem accessing Node properties?

 Thanks,
 Adam
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user


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


[Neo] Fwd: re :VerboseQuadStore

2009-02-17 Thread Mattias Persson
-- Forwarded message --
From: Lyudmila L. Balakireva lu...@lanl.gov
Date: 2009/2/17
Subject: Re: re :VerboseQuadStore
To: Mattias Persson matt...@neotechnology.com


Hi,
actually I had rdf in the form as you mentioned. But when you serialize
rdf from neo it's outputs it in this form. (rc.export(
rdfxmlWriter,context);
Luda

 Hi again Lyudmila.

 I may have found the source of the problem. I see that when importing
 from your rdf/xml file the predicates in the statements aren't stored
 in the sail as the full URIs, but as short versions, f.ex
 orex:value.

 Then I look at the rdfunload.xml file and see some weird things, f.ex:

 value xmlns=orex:outside/value

 Now that's a syntax I've never seen before and all values in the file
 are like that. I tried to change the tags so that they look something
 like:

 orex:valueoutside/orex:value

 And it all worked much better. Isn't that how it's supposed to look
 like? At least that's how I've learned to write rdf/xml and it makes
 more sense to me. I think this will make it work for you.

 Another thing, performance: If you see that the performance isn't good
 enough using an external sparql analyzer like this you could try using
 our own sparql engine which talks to neo directly with a little help
 from the neo-rdf layer. I'll see if I can write a piece of code which
 would get you up and running using that too.

 Best,
 Mattias

 2009/2/13 Lyudmila L. Balakireva lu...@lanl.gov:
 hi, Mattias

 I am attaching rdf sample I was testing .
 I was loading rdf with specific context.

 RepositoryConnection rc = repo.getConnection();
ValueFactory f = repo.getValueFactory();
for ( File file : files )
{


   // URI context =
 f.createURI(http://localhost:8080/neofl/ore/photo/2926368578;);
URI context =
 f.createURI(http://localhost:8080/neofl/ore/photo/1437207680/2009-01-13T19:21:23;);

   rc.add( file, , RDFFormat.RDFXML,context);
  //  rc.add( file, , RDFFormat.RDFXML);

}


 Thank you,


 Lyudmila Balalkireva
 lu...@lanl.gov



 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com





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


Re: [Neo] re :VerboseQuadStore

2009-02-19 Thread Mattias Persson
I converted the xml file into decent format (see attached file) and
ran the example. Once again I get answers when running that query.

PREFIX ore:http://www.openarchives.org/ore/terms/
PREFIX rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#
PREFIX orex:http://library.lanl.gov/orex/terms/
PREFIX dc:http://purl.org/dc/elements/1.1/
SELECT ?photo
WHERE
{
   ?s ?p  outside  .
   ?photo  ?x  ?s  .
   ?photo  ?y  photo .
   ?photo ore:aggregates  ?i .
}

I get 6 results back from that query.

There surely must something we do differently, but I don't know what.

Best,
Mattias

2009/2/18 Mattias Persson matt...@neotechnology.com:
 I'm guessing that's a problem in the exporter and not in the neo rdf
 library... but I'm not sure.

 Anyway, would it be possible for you to send me your original data so
 that I can test with it, making my tests exactely like yours?

 Best,
 Mattias

 2009/2/17 Lyudmila L. Balakireva lu...@lanl.gov:
 Hi,
 actually I had rdf in the form as you mentioned. But when you serialize
 rdf from neo it's outputs it in this form. (rc.export(
 rdfxmlWriter,context);
 Luda

 Hi again Lyudmila.

 I may have found the source of the problem. I see that when importing
 from your rdf/xml file the predicates in the statements aren't stored
 in the sail as the full URIs, but as short versions, f.ex
 orex:value.

 Then I look at the rdfunload.xml file and see some weird things, f.ex:

 value xmlns=orex:outside/value

 Now that's a syntax I've never seen before and all values in the file
 are like that. I tried to change the tags so that they look something
 like:

 orex:valueoutside/orex:value

 And it all worked much better. Isn't that how it's supposed to look
 like? At least that's how I've learned to write rdf/xml and it makes
 more sense to me. I think this will make it work for you.

 Another thing, performance: If you see that the performance isn't good
 enough using an external sparql analyzer like this you could try using
 our own sparql engine which talks to neo directly with a little help
 from the neo-rdf layer. I'll see if I can write a piece of code which
 would get you up and running using that too.

 Best,
 Mattias

 2009/2/13 Lyudmila L. Balakireva lu...@lanl.gov:
 hi, Mattias

 I am attaching rdf sample I was testing .
 I was loading rdf with specific context.

 RepositoryConnection rc = repo.getConnection();
ValueFactory f = repo.getValueFactory();
for ( File file : files )
{


   // URI context =
 f.createURI(http://localhost:8080/neofl/ore/photo/2926368578;);
URI context =
 f.createURI(http://localhost:8080/neofl/ore/photo/1437207680/2009-01-13T19:21:23;);

   rc.add( file, , RDFFormat.RDFXML,context);
  //  rc.add( file, , RDFFormat.RDFXML);

}


 Thank you,


 Lyudmila Balalkireva
 lu...@lanl.gov



 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com






 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com




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


Re: [Neo] db recovery

2009-02-19 Thread Mattias Persson
Another thing you should know with the native sparql engine is that it
requires a well-populated MetaStructure to work correctly, i.e. a meta
model which knows how your data structure looks like (which predicates
refers to literals and which refers to other resources). We'll look
into how to deal with that dependency. What I'm saying is that you may
have problems getting answers with it if you don't supply it.

Did you see my other reply on that I could get results using your
first approach?

Best,
Mattias

2009/2/19 Emil Eifrem e...@neotechnology.com:
 On Thu, Feb 19, 2009 at 00:39, Lyudmila L. Balakireva lu...@lanl.gov wrote:
 But I worry how it going to recover with billions nodes in it .  It should
 be able to recover with the same memory used to write the indexes?

 Johan will have to chime in here with the specifics tomorrow (he's
 asleep right now). But I believe the memory required here is depending
 on the size of whatever non-completed transactions that existed when
 the JVM crashed, not the total size of the node store.

 Cheers,

 --
 Emil Eifrém, CEO [e...@neotechnology.com]
 Neo Technology, www.neotechnology.com
 Cell: +46 733 462 271 | US: 206 403 8808
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Fwd: Re: re :VerboseQuadStore

2009-02-20 Thread Mattias Persson
Hi,

once again I don't have your initial data so I'm using my fixed
version of the rdfunload.xml file you gave me earlier. I'm using your
example (MyTest.java) and enabling the line which calls the insert
method (before the call to the get method).

When I do the query (note: Replaced Paris with outside since the
rdfunload.xml data doesn't contain Paris):
PREFIX ore:http://www.openarchives.org/ore/terms/
PREFIX rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#
PREFIX orex:http://library.lanl.gov/orex/terms/
PREFIX dc:http://purl.org/dc/elements/1.1/
SELECT ?photo ?i
WHERE {
   ?s ?p  outside  .
   ?photo  ?x  ?s  .
   ?photo  ?y  photo  .
}

I get the result:
photo:http://localhost:8080/neofl/ore/photo/376830691

When i do the query:
PREFIX ore:http://www.openarchives.org/ore/terms/
PREFIX rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#
PREFIX orex:http://library.lanl.gov/orex/terms/
PREFIX dc:http://purl.org/dc/elements/1.1/
SELECT ?photo ?i
WHERE {
   ?s ?p  outside  .
   ?photo  ?x  ?s  .
   ?photo  ?y  photo  .
   ?photo  ore:aggregates  ?i .
}

I get the result:
image:http://www.flickr.com/photos/10ch/376830691/sizes/o/
photo:http://localhost:8080/neofl/ore/photo/376830691
image:http://www.flickr.com/photos/10ch/376830691/sizes/l/
photo:http://localhost:8080/neofl/ore/photo/376830691
image:http://www.flickr.com/photos/10ch/376830691/sizes/m/
photo:http://localhost:8080/neofl/ore/photo/376830691
image:http://www.flickr.com/photos/10ch/376830691/sizes/s/
photo:http://localhost:8080/neofl/ore/photo/376830691
image:http://www.flickr.com/photos/10ch/376830691/sizes/t/
photo:http://localhost:8080/neofl/ore/photo/376830691
image:http://www.flickr.com/photos/10ch/376830691/sizes/sq/
photo:http://localhost:8080/neofl/ore/photo/376830691

So things are working for me here, but not for you with the exact same
code? Weird. Perhaps you have a different data set than me?

Best,
Mattias

2009/2/19 Lyudmila L. Balakireva lu...@lanl.gov:
 thank you for your replay, I attached my test classes. May be you can spot
 the difference in approach.
 Luda

X-Sieve: CMU Sieve 2.2
X-NIE-2-Virus-Scanner: amavisd-new at mailrelay1.lanl.gov
Date: Thu, 19 Feb 2009 09:52:31 +0100
Subject: Re: re :VerboseQuadStore
From: Mattias Persson matt...@neotechnology.com
To: lu...@lanl.gov
Cc: Neo4j user discussions user@lists.neo4j.org
X-Proofpoint-Virus-Version: vendor=fsecure
engine=1.12.7400:2.4.4,1.2.40,4.0.166
definitions=2009-02-19_02:2009-02-10,2009-02-19,2009-02-19 signatures=0
X-Proofpoint-Spam: 0
X-NIE-2-MailScanner-Information: Please see
http://network.lanl.gov/email/virus-scan.php
X-NIE-2-MailScanner: Found to be clean
X-NIE-2-MailScanner-From: matt...@neopersistence.com
X-Spam-Status: No

I converted the xml file into decent format (see attached file) and
ran the example. Once again I get answers when running that query.

PREFIX ore:http://www.openarchives.org/ore/terms/
PREFIX rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#
PREFIX orex:http://library.lanl.gov/orex/terms/
PREFIX dc:http://purl.org/dc/elements/1.1/
SELECT ?photo
WHERE
{
?s ?p  outside  .
?photo  ?x  ?s  .
?photo  ?y  photo .
?photo ore:aggregates  ?i .
}

I get 6 results back from that query.

There surely must something we do differently, but I don't know what.

Best,
Mattias

2009/2/18 Mattias Persson matt...@neotechnology.com:
  I'm guessing that's a problem in the exporter and not in the neo rdf
  library... but I'm not sure.
 
  Anyway, would it be possible for you to send me your original data so
  that I can test with it, making my tests exactely like yours?
 
  Best,
  Mattias
 
  2009/2/17 Lyudmila L. Balakireva lu...@lanl.gov:
  Hi,
  actually I had rdf in the form as you mentioned. But when you
 serialize
  rdf from neo it's outputs it in this form. (rc.export(
  rdfxmlWriter,context);
  Luda
 
  Hi again Lyudmila.
 
  I may have found the source of the problem. I see that when
 importing
  from your rdf/xml file the predicates in the statements aren't
 stored
  in the sail as the full URIs, but as short versions, f.ex
  orex:value.
 
  Then I look at the rdfunload.xml file and see some weird things,
 f.ex:
 
  value xmlns=orex:outside/value
 
  Now that's a syntax I've never seen before and all values in the
 file
  are like that. I tried to change the tags so that they look
 something
  like:
 
  orex:valueoutside/orex:value
 
  And it all worked much better. Isn't that how it's supposed to look
  like? At least that's how I've learned to write rdf/xml and it makes
  more sense to me. I think this will make it work for you.
 
  Another thing, performance: If you see that the performance isn't
 good
  enough using an external sparql analyzer like this you could try
 using
  our own sparql engine which talks to neo directly with a little help
  from the neo-rdf layer. I'll see if I can write a piece of code
 which
  would get you up and running using that too.
 
  Best,
  Mattias
 
  2009/2/13 Lyudmila L. Balakireva lu

Re: [Neo] Importing RDF from XML file

2009-03-10 Thread Mattias Persson
Hi Chris,

I'm not an expert on such libraries, but the one I do know of which
has worked for me is OpenRdf parser/importers (RIO)

And I assume you're using the neo-rdf-sail component on top of neo as
your data source, am I right?

F.ex, to set up a Sail with neo4j as backing store:

final NeoService neo = new EmbeddedNeo( path/to/neo );
final IndexService index = new LuceneIndexService( neo );
RdfStore rdfStore = new VerboseQuadStore( neo, index );
Sail sail = new NeoSail( neo, rdfStore );
sail.initialize();
Runtime.getRuntime().addShutdownHook( new Thread()
{
public void run()
{
sail.shutDown();
index.shutdown();
neo.shutdown();
}
} );

Then use RIO to import the data:

Repository repo = new SailRepository( sail );
RepositoryConnection connection = repo.getConnection();
connection.add(
new URL( http://dbpedia.org/data/The_Lord_of_the_Rings; ), ,
RDFFormat.RDFXML );
connection.commit();
connection.close();

I just ran a quick test and it worked fine for me. If you're using
maven you can have these dependencies:

groupId: org.neo4j
artifactId: neo-rdf-sail
version: 0.3-SNAPSHOT

groupId: org.openrdf.sesame
artifactId: sesame-rio-rdfxml
version: 2.1.1

groupId: org.openrdf.sesame
artifactId: sesame-repository-sail
version: 2.1.1


Hopefully it will work fine for you too! Don't hesitate to come back
with more questions.

Best,
Mattias

2009/3/10 Chris Laux ctl...@googlemail.com:
 Hi all,

 how can I most easily import RDF/XML files (e.g.
 http://dbpedia.org/data/The_Lord_of_the_Rings) into Neo? Being new to
 Neo4j I might have missed this info somewhere on the Wiki or Mailing
 list archives, so sorry for that. I would be grateful for any hints,
 even if they involve 3rd party software.

 Thanks,
 Chris
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Importing RDF from XML file

2009-03-12 Thread Mattias Persson
It might just be that you're using java compiler version 1.4 or
something like that. You see, that method has a vararg in the end
which was introduced in java 1.5. So try setting you maven project (or
what you might use) to compile for java 1.5 or even 1.6 and it should
work.

2009/3/11 Chris Laux ctl...@googlemail.com:
 Hi Mattias,

 thanks for your help, that's just what I was looking for.

 Hopefully it will work fine for you too! Don't hesitate to come back
 with more questions.

 I'm glad you offered because my next problem is no longer on-topic for
 Neo. But if you happen to know why this is happening:

 [INFO] Compilation failure
 /home/chris/java/semanticbrowser/src/main/java/org/java/semanticbrowser/NeoLoad.java:[35,11]
 cannot find symbol
 symbol  : method add(java.net.URL,java.lang.String,org.openrdf.rio.RDFFormat)
 location: interface org.openrdf.repository.RepositoryConnection

 I checked the RepositoryConnection apidocs against your source code,
 and it should all fit together. But as I haven't used Java in a while,
 I might be missing something obvious. Changing the version if openrdf
 sesame to 2.2.4 (newest) doesn't help.

 Cheers,
 Chris




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


Re: [Neo] Importing RDF from XML file

2009-03-12 Thread Mattias Persson
No problem, just glad to help!

2009/3/12 Chris Laux ctl...@googlemail.com:
 Oh, I didn't consider javac's ability to simulate a different version,
 how naive :) Works fine now, thanks a lot for your help.

 On Thu, Mar 12, 2009 at 11:46 AM, Mattias Persson
 matt...@neotechnology.com wrote:
 Yep, I though as much, but I know that maven, at least a while ago set
 its projects to compile for 1.4 by default... even if you had 1.6
 installed.

 You can configure it to go for a specific version with:

    build
        plugins
            plugin
                groupIdorg.apache.maven.plugins/groupId
                artifactIdmaven-compiler-plugin/artifactId
                configuration
                    source1.6/source
                    target1.6/target
                /configuration
            /plugin
        /plugins
    /build


 2009/3/12 Chris Laux ctl...@googlemail.com:
 On Thu, Mar 12, 2009 at 8:43 AM, Mattias Persson
 matt...@neotechnology.com wrote:
 It might just be that you're using java compiler version 1.4 or
 something like that. You see, that method has a vararg in the end
 which was introduced in java 1.5. So try setting you maven project (or
 what you might use) to compile for java 1.5 or even 1.6 and it should
 work.

 Thanks, had thought of that. I only have 1.6 installed as it happens.




 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com





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


Re: [Neo] [Commits] r2718 - components/index-util/trunk/src/main/java/org/neo4j/util/index

2009-04-05 Thread Mattias Persson
2009/4/5  joh...@lists.neo4j.org:
 Author: johans
 Date: 2009-04-05 17:14:05 +0200 (Sun, 05 Apr 2009)
 New Revision: 2718

 Modified:
   
 components/index-util/trunk/src/main/java/org/neo4j/util/index/LuceneDataSource.java
 Log:
 Changed get of lucene directory to use File instead of string path.



 Modified: 
 components/index-util/trunk/src/main/java/org/neo4j/util/index/LuceneDataSource.java
 ===
 --- 
 components/index-util/trunk/src/main/java/org/neo4j/util/index/LuceneDataSource.java
         2009-04-05 12:09:25 UTC (rev 2717)
 +++ 
 components/index-util/trunk/src/main/java/org/neo4j/util/index/LuceneDataSource.java
         2009-04-05 15:14:05 UTC (rev 2718)
 @@ -231,7 +231,7 @@
             try
             {
                 Directory dir = FSDirectory.getDirectory(
 -                    storeDir + / + key );
 +                    new File( storeDir + / + key ) );
                 if ( dir.list().length == 0 )
                 {
                     return null;
 @@ -288,7 +288,8 @@
         try
         {
             getWriteLock( key );
 -            Directory dir = FSDirectory.getDirectory( storeDir + / + key );
 +            Directory dir = FSDirectory.getDirectory(
 +                new File( storeDir + / + key ) );
             return new IndexWriter( dir, getAnalyzer(),
                 MaxFieldLength.UNLIMITED );
         }


Shouldn't that be:

new File( storeDir, key ) instead?
Manually concatenating / characters in paths without checkinf if
they already exists aren't that great.

 ___
 Commits mailing list
 comm...@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/commits




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


Re: [Neo] Input on new batch insert API?

2009-05-06 Thread Mattias Persson
Looks nice and simple and it's probably completely alright to have the
store fail on non-clean shutdowns and stuff like that.

I'm wondering about this method though.

void createNode( long id, MapString, Object properties );

What do we need that for? Couldn't that encourage an erroneous
behavior where you could have f.ex.

public static final int MY_REFERENCE_NODE_ID_1 = 101
public static final int MY_REFERENCE_NODE_ID_2 = 102
public static final int MY_REFERENCE_NODE_ID_3 = 103

and using those ids to create reference nodes and hence depending on those ids?

2009/5/6 Emil Eifrem e...@neotechnology.com:
 Hi,

 As you may or may not know, the Neo4j kernel is heavily optimized for
 reads and transactional updates, which in a typical transactional
 system probably constitute 95+% of the operations. So far, we haven't
 focused on raw batch insert velocity, since that's typically a
 one-time operation that you execute when you're bootstrapping a
 project and then never again.

 However, having said that, when you DO import your initial data it's
 kinda nice if that import is a reasonably performant operation. So
 we've decided to develop a specific batch insert API that is optimized
 for insertion. See API outlined in the ticket below.

 Do you have any input on this API? Is it a convenient API for that
 first importer that parses your CSVs or XML or SQL dumps and injects
 the data into Neo4j?

 Please give input either in this thread or in ticket comments.

 Cheers,

 -EE


 -- Forwarded message --
 From: neo4j.org nore...@neo4j.org
 Date: Wed, May 6, 2009 at 01:03
 Subject: [Neo tickets] #167: Create a batch insert API
 To:
 Cc: tick...@lists.neo4j.org


 #167: Create a batch insert API
 -+--
  Reporter:  johans               |       Owner:  johans
     Type:  enhancement request  |      Status:  new
  Priority:  major                |   Milestone:  neo-1.0-b9
 Component:  neo                  |    Keywords:
 -+--
  Create a batch insert {{{API}}} that drops support for transactions and
  the like in favor of speed. This is useful to get already existing data
  (existing in some form) injected into a Neo4j store.

  Here is the the suggested API:
  {{{
  long createNode( MapString,Object properties )
  void createNode( long id, MapString,Object properties )
  long createRelationship( long startNode, long endNode,
     RelationshipType type, MapString,Object properties )
  void setNodeProperties( long node, MapString,Object properties )
  void setRelationshipProperties( long rel, MapString,Object properties )
  MapString,Object getNodeProperties( long nodeId )
  MapString,Object getRelationshipProperties( long relId )
  IterableLong getRelationshipIds( long nodeId )
  IterableSimpleRelationship getRelationships( long nodeId )
  SimpleRelationship getRelatoinshipById( long relId )
  }}}

  Implementation is in progress and here are some details:

  * Everything will be optimized for insert only.
  * Use create methods and supply properties for nodes and relationships
  right away. The setProperties methods approach is slower.
  * Get operations may be slow.
  * Delete operation has been left out completely for now.
  * If anything breaks (you get a exception from an API call) your store is
  garbage and you have start over with a fresh new one.

 --
 Ticket URL: https://trac.neo4j.org/ticket/167
 neo4j.org http://trac.neo4j.org/
 The Neo4J.org Issue Tracker
 ___
 Tickets mailing list
 tick...@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/tickets



 --
 Emil Eifrém, CEO [e...@neotechnology.com]
 Neo Technology, www.neotechnology.com
 Cell: +46 733 462 271 | US: 206 403 8808
 http://twitter.com/emileifrem
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Neo shell 'traverse' command

2009-05-20 Thread Mattias Persson
Well, basically it's the ame idea here. However the Shell have had
scripting support from day one for Groovy and Jython (can of course
add one for Ruby as well) using commands gsh and jsh respectively, but
I'm thinking more about a simple traverser command where you don't
want to hack a script just to do a simple traversal

2009/5/20 Peter Neubauer neubauer.pe...@gmail.com:
 Hi there,
 would that be the same idea as adding support for a scripting language
 for traversers in Neoclipse? Sounds like a little JRuby or Groovy
 magic would be perfect to describe small traversers and filters here.

 /peter

 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     - New Energy for Data - The Graph Database.
 http://www.ops4j.org     - New Energy for OSS Communities - Open
 Participation Software.
 http://www.qi4j.org        - New Energy for Java - Domain Driven Development.



 On Wed, May 20, 2009 at 10:41 AM, Mattias Persson
 matt...@neotechnology.com wrote:
 Hi all,

 I'm missing some nice 'traverse' command in the shell. Something
 simple which could look up stuff for me instead of my having to 'cd'
 and 'ls' on a lot of nodes to find the right one. I was thinking that
 it can take relationship types (with wildcards optionally, since we
 now have NeoService#getAllRelationshipTypes()) and optionally
 direction as well as property filters and maybe more.

 Input on such a command anyone?

 Also look at https://trac.neo4j.org/ticket/176

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

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




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


Re: [Neo] Neo shell 'traverse' command

2009-05-20 Thread Mattias Persson
Of course the scripts will have to exist server-side, but that can
change too so that you point to a script file in the client or write a
small script in the prompt and send down to the ShellServer.

2009/5/20 Mattias Persson matt...@neotechnology.com:
 Well, basically it's the ame idea here. However the Shell have had
 scripting support from day one for Groovy and Jython (can of course
 add one for Ruby as well) using commands gsh and jsh respectively, but
 I'm thinking more about a simple traverser command where you don't
 want to hack a script just to do a simple traversal

 2009/5/20 Peter Neubauer neubauer.pe...@gmail.com:
 Hi there,
 would that be the same idea as adding support for a scripting language
 for traversers in Neoclipse? Sounds like a little JRuby or Groovy
 magic would be perfect to describe small traversers and filters here.

 /peter

 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     - New Energy for Data - The Graph Database.
 http://www.ops4j.org     - New Energy for OSS Communities - Open
 Participation Software.
 http://www.qi4j.org        - New Energy for Java - Domain Driven Development.



 On Wed, May 20, 2009 at 10:41 AM, Mattias Persson
 matt...@neotechnology.com wrote:
 Hi all,

 I'm missing some nice 'traverse' command in the shell. Something
 simple which could look up stuff for me instead of my having to 'cd'
 and 'ls' on a lot of nodes to find the right one. I was thinking that
 it can take relationship types (with wildcards optionally, since we
 now have NeoService#getAllRelationshipTypes()) and optionally
 direction as well as property filters and maybe more.

 Input on such a command anyone?

 Also look at https://trac.neo4j.org/ticket/176

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

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




 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com




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


Re: [Neo] basic Neo4j programs

2009-05-25 Thread Mattias Persson
2009/5/25 Grobe, David Michael dgr...@iupui.edu:
 Hey Matias:

 Thanks very much for your attention and comments.

 On the first issue, about loading the database, it turns out that GOLoad.java 
 DOES succeed; it loads all 8K nodes, and I can count them during a traversal 
 using GORead.java. (Just to be sure, I downloaded both programs  directly 
 from the web site, recompiled, and executed.

 I was just wondering if the approach was reasonable, or whether it was ugly 
 and brutish.  :-)

well, one giant main method always look brutish to me :)


 On the second issue, about searching the node space, I will look into the 
 Index package you mentioned

 A couple of other questions have come up:

 1) Does the whole graph have to fit into memory to be usable?  There is a 
 page about required memory, but it doesn't say what happens if the 
 recommended memory is not available.  I was hoping that Neo4j would just use 
 some clever caching in RAM from disk, rather than fail completely when 
 manipulating very large databases.

Don't worry. You can have neo4j scale to billions of primitives with
just little RAM...
http://wiki.neo4j.org/content/Guidelines_for_Building_a_Neo_App#Assume_the_node_space_is_always_in_memory_.28Neo_will_make_it_so.29

Just give the JVM a couple of hundreds of Mb and it'll surely run
quite fine. There are also numerous tweaks with memory mapped files
for the actual neo store files a.s.o. but that can come at a later
time.

f.ex. add the parameters: -Xmx512M -Xms512M to your java command


 2) I am interested in storing RDF and there appears to be an RDF overlay for 
 Neo4j, but I couldn't find any user-type, tutorial documentation.  Is there 
 any such documentation?

There isn't any good documentation for just that at the moment. The
RDF layer on top of neo consists of an RDF layer and optionally an
additional small layer which makes it a Sesame/OpenRDF Sail
http://www.openrdf.org/

Basically you whip up the whole thing like this:

   NeoService neo = new EmbeddedNeo( my/path );
   IndexService indexService = new LuceneIndexService( neo );
   RdfStore rdfStore = new VerboseQuadStore( neo, indexService );
   Sail sail = new NeoSail( neo, rdfStore );

Here you've got a great Sail, ready to be used.
Don't forget to shut down in the end... prefferable with a
shutdown hook (java.lang.Runtime.getRuntime().addShutdownHook)
in the order: sail, indexService, neo


 Thanks again for your attention,

 Michael Grobe
 Indiana University


Just glad to help out

Best,
Mattias



 -Original Message-
 From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
 On Behalf Of Mattias Persson
 Sent: Monday, May 25, 2009 4:10 AM
 To: Neo user discussions
 Subject: Re: [Neo] basic Neo4j programs

 Hi David,

 I'm glad that you are taking interest in Neo4j!

 2009/5/25 Grobe, David Michael dgr...@iupui.edu:
  Hello:
 
  I was looking for a simple example that would read a data file and build
 a Neo4j graph.
 
  I didn't find that on the web site so I took your code snippets on
 
    http://dist.neo4j.org/basic-neo4j-code-examples-2008-05-08.pdf
 
  and wrote something on my own.
 
  as it happens it was more complicated than I had imagined, and my Java
 is not all that great, but I got some things to work and put them on a web
 page
 
    http://mypage.iu.edu/~dgrobe/neo4j/
 
  (in slightly modified form) where I was hoping you could give them a
 quick look, relative to these questions:
 
  - I'm not sure if I used a canonical approach to building the graph,
 or created some mutant.  In particular, along with the graph, I created a
 hash into the graph, because access only through the reference node did
 not seem adequate.

 Your code which loads the data into the database have this
 if-statement which connects only one specific node (wherever it may be
 in the input file) to the reference node. Isn't that why you don't
 find anything when traversing from the reference node?

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




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


Re: [Neo] [Commits] r2951 - components/neo/trunk/src/java/org/neo4j/impl/shell/apps

2009-06-24 Thread Mattias Persson
().get( o 
 ),
 +            Order.DEPTH_FIRST );
 +    }
 +
 +    private ReturnableEvaluator parseReturnableEvaluator(
 +        AppCommandParser parser )
 +    {
 +        // TODO
 +        return ReturnableEvaluator.ALL_BUT_START_NODE;
 +    }
 +
 +    private StopEvaluator parseStopEvaluator( AppCommandParser parser )
 +    {
 +        // TODO
 +        return StopEvaluator.END_OF_GRAPH;
 +    }
 +
 +    private Object[] parseRelationshipTypes( AppCommandParser parser )
 +        throws ShellException
 +    {
 +        String option = parser.options().get( r );
 +        ListObject result = new ArrayListObject();
 +        if ( option == null )
 +        {
 +            for ( RelationshipType type :
 +                getNeoServer().getNeo().getRelationshipTypes() )
 +            {
 +                result.add( type );
 +                result.add( Direction.BOTH );
 +            }
 +        }
 +        else
 +        {
 +            StringTokenizer typeTokenizer = new StringTokenizer( option, 
 , );
 +            ListRelationshipType allRelationshipTypes =
 +               new ArrayListRelationshipType();
 +            for ( RelationshipType type :
 +               getNeoServer().getNeo().getRelationshipTypes() )
 +            {
 +               allRelationshipTypes.add( type );
 +            }
 +
 +            while ( typeTokenizer.hasMoreTokens() )
 +            {
 +                String typeToken = typeTokenizer.nextToken();
 +                StringTokenizer directionTokenizer = new StringTokenizer(
 +                    typeToken, : );
 +                String type = directionTokenizer.nextToken();
 +                Direction direction = getDirection(
 +                    directionTokenizer.hasMoreTokens() ?
 +                        directionTokenizer.nextToken() : null,
 +                        Direction.BOTH );
 +
 +                Pattern typePattern = Pattern.compile( type );
 +                for ( RelationshipType relationshipType : 
 allRelationshipTypes )
 +                {
 +                    if ( relationshipType.name().equals( type ) ||
 +                       matches( typePattern, relationshipType.name(),
 +                        false, true ) )
 +                    {
 +                        result.add( relationshipType );
 +                        result.add( direction );
 +                    }
 +                }
 +            }
 +        }
 +        return result.toArray();
 +    }
 +}

 ___
 Commits mailing list
 comm...@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/commits


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




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


Re: [Neo] how to decouple transaction management from access to underlying nodes

2009-06-24 Thread Mattias Persson
Hi!

There's (at least) two solutions to this problem. One is that, as you
suggest, to have the iterator wrap its methods in transactions in
addition to the code that returns the iterator (look at
org.neo4j.util.TxIterator in neo-utils component). This solution can
be tedious and perhaps not the most optimized.

Another (and probably better and more logical) is to manage your
transactions at a slightly higher level. One example is an MVC model
where it'd be a good idea to put your transaction handling in the
controller (C) so that the model (M) won't have to manage transactions
for every little operation.

Does that make sense to you?

2009/6/24 Symeon (Akis) Papadopoulos papa...@iti.gr:
 Hi all

 I am a newbie to Neo4j, but as it seems very pertinent to my research
 interests (web 2.0 mining), therefore I am planning to test it as an
 infrastructure layer for massive graph analysis.

 One very basic (even naive) question I have regards the separation
 between transaction management and data access. In the Design Guide
 (http://wiki.neo4j.org/content/Design_Guide), it is suggested that in
 order to provide access to a Collection of objects that encapsulate
 Neo4j nodes (e.g. instances of Customer, Order) an IteratorX should be
 returned. However, since iterating over Node instances should be carried
 out within a Transaction context (i.e. between a tx =
 neo.beginTransaction() and a tx.success()/tx.finish() statement), I
 wonder whether the code that requires access to these objects (i.e.
 IteratorX) needs also to take care of the Transaction logic (i.e. to
 begin and end the Transactions appropriately). I would prefer to have a
 complete (if possible) decoupling between accessing the entities of
 interest and handling the underlying Transactions. How is this possible?
 Please, accept my apologies in case this question has already been
 addressed in the list (I quickly went through many of the last months'
 discussions and couldn't locate some related message).

 Best regards,
 Symeon (Akis)
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] how to decouple transaction management from access to underlying nodes

2009-06-25 Thread Mattias Persson
2009/6/25 Symeon (Akis) Papadopoulos papa...@iti.gr:
 [My apologies for insisting on this issue.]
 There's (at least) two solutions to this problem. One is that, as you
 suggest, to have the iterator wrap its methods in transactions in
 addition to the code that returns the iterator (look at
 org.neo4j.util.TxIterator in neo-utils component). This solution can
 be tedious and perhaps not the most optimized.

 After having a look at the source of the TxIterator, it appears as a
 straightforward solution to my problem.
 However, since the TxIterator opens and finishes a new transaction each
 time any of the Iterator methods (hasNext(), next(), remove()) are
 invoked, it appears that this will incur a significant penalty in
 processes that go through the whole set of a graph's nodes in one go
 (i.e. the TxIterator.hasNext() and TxIterator.next() methods are
 successively invoked for each one of the graph's nodes). Do you know how
 much this performance penalty could be? Alternatively, would it be safe
 to have a transaction begin and finish every N (e.g. 10,000) calls to
 the Iterator methods?
If your transactions only performs read operations then the penalty
isn't that much, however there's a slight overhead as you pointed out.
For information on exactly how big this penalty would be I'll have to
let others answer that... maybe Johan (if you read this)?

And sure you can do it like that (iterations of a couple of thousands
at a time), it's seems like a good solution. There really should be an
implementation of a tx-iterator in neo-utils that does just that.
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Investigating railway network application using Neo4j

2009-06-29 Thread Mattias Persson
. There are named paths (e.g. trains). A path P consists of a
 sequence of arcs that all have a property named P. The value of this
 property could be a distance between two stations or a departure and
 arrival time and will (usually) be different for each arc.
 (4) Usage. The application will be used for the following navigation.
(4.1) The user selects a start station.
(4.2) A list will be generated of all outgoing paths from this
 station.
(4.3) The user selects a path (e.g. a train)
(4.4) A sequence will be generated of all stations on this path
(4.5) The user selects a station from the path
(4.6) If this station is the final destination, the user is done,
 otherwise, the user returns to (4.2)


 Could you provide me with (guidelines for) Neo4j code for the
 following example network:

 (1) The example network has 5 nodes (stations): A, B, C, D, E
 (2) The example network has 5 arcs: AB, BC, CD, AE, EC
 (3) The example network has 2 paths (trains): T1, T2
 (4) The example network has 6 arc (path) properties:
(4.1) AB: T1 = departure=11:00 arrival=11:45
(4.2) BC: T1 = departure=11:50 arrival=12:30
(4.3) CD: T1 = departure=12:35 arrival=13:00
(4.4) CD: T2 = departure=14:35 arrival=15:00
(4.5) AE: T2 = departure=13:15 arrival=13:45
(4.6) EC: T2 = departure=13:50 arrival=14:30
 (5) Traversal 1: given station A, give a list of all outgoing paths
 from this station.
Result:
* Station A
  - Train T1: departure 11:00
  - Train T2: departure 13:15
 (6) Traversal 2: given an outgoing path from a station, give the
 sequence of stations on this path.
Result in case of selecting T1:
* Train T1
  - Station A, departure 11:00
  - Station B: arrival 11:45, departure 11:50
  - Station C: arrival 12:30, departure 12:35
  - Station D: arrival 13:00
Result in case of selecting T2:
* Train T2
  - Station A, departure 13:15
  - Station E: arrival 13:45, departure 13:50
  - Station C: arrival 14:30, departure 14:35
  - Station D: arrival 15:00


 Your help is very much appreciated!

 -- Bert Fitié

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



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


Re: [Neo] Investigating railway network application using Neo4j

2009-06-30 Thread Mattias Persson
Here's the code directly in the mail, since filters makes it difficult
to send attachments sometimes:

package com.windh.eqn.util;

import org.neo4j.api.core.*;

public class RailNetApp
{
public enum MyRelationshipTypes implements RelationshipType
{
CONNECTION,
}

public static void main( String[] args )
{
NeoService neo = new EmbeddedNeo( var/examples/railnet );

Transaction tx = neo.beginTx();
try
{
// Stations
Node stationAbc = createStation( neo, Abc );
Node stationBcd = createStation( neo, Bcd );
Node stationCde = createStation( neo, Cde );
Node stationDef = createStation( neo, Def );
Node stationEfg = createStation( neo, Efg );

// Connections
Relationship abcBcdT1 = connectStations( stationAbc, 
stationBcd,
T1 );
abcBcdT1.setProperty( departure, 11:00 );
abcBcdT1.setProperty( arrival, 11:45 );

Relationship bcdCdeT1 = connectStations( stationBcd, 
stationCde,
T1 );
bcdCdeT1.setProperty( departure, 11:50 );
bcdCdeT1.setProperty( arrival, 12:30 );

Relationship cdeDefT1 = connectStations( stationCde, 
stationDef,
T1 );
cdeDefT1.setProperty( departure, 12:35 );
cdeDefT1.setProperty( arrival, 13:00 );

Relationship cdeDefT2 = connectStations( stationCde, 
stationDef,
T2 );
cdeDefT2.setProperty( departure, 14:35 );
cdeDefT2.setProperty( arrival, 15:00 );

Relationship abcEfgT2 = connectStations( stationAbc, 
stationEfg,
T2 );
abcEfgT2.setProperty( departure, 13:15 );
abcEfgT2.setProperty( arrival, 13:45 );

Relationship efgCdeT2 = connectStations( stationEfg, 
stationCde,
T2 );
efgCdeT2.setProperty( departure, 13:50 );
efgCdeT2.setProperty( arrival, 14:30 );

for ( Relationship connection : stationAbc
.getRelationships( 
MyRelationshipTypes.CONNECTION ) )
{
System.out.println( Train 
+ connection.getProperty( path-name ) 
+ : departure 
+ connection.getProperty( departure ) 
);
}

// If you'd the transaction to commit then enable this 
line
// tx.success();
}
finally
{
tx.finish();
neo.shutdown();
}
}

private static Node createStation( NeoService neo, String stationName )
{
Node station = neo.createNode();
station.setProperty( station-name, stationName );
return station;
}

private static Relationship connectStations( Node start, Node end,
String pathName )
{
Relationship connection = start.createRelationshipTo( end,
MyRelationshipTypes.CONNECTION );
connection.setProperty( path-name, pathName );
return connection;
}
}

2009/6/30 Mattias Persson matt...@neotechnology.com:
 Yep, those errors are easily fixed. Your private methods needs to be
 static as well. I fixed those errors (see attachment).

 2009/6/30 Bert Fitié b...@analytag.com:
 Hi, Mattias

 I started off with the following partial code but got three types of
 errors:



 import org.neo4j.api.core.*;

 public class RailNetApp
 {

   public enum MyRelationshipTypes implements RelationshipType
   {
     CONNECTION,
   }

   public static void main(String[] args)
   {
     NeoService neo = new EmbeddedNeo(var/examples/railnet);

     Transaction tx = neo.beginTx();
     try
     {
       // Stations
       Node stationAbc = createStation(Abc);
       Node stationBcd = createStation(Bcd);
       Node stationCde = createStation(Cde);
       Node stationDef = createStation(Def);
       Node stationEfg = createStation(Efg);

       // Connections
       Relationship abcBcdT1 = connectStations(stationAbc, stationBcd,
 T1);
       abcBcdT1.setProperty(departure, 11:00);
       abcBcdT1.setProperty(arrival, 11:45);

       Relationship bcdCdeT1 = connectStations

Re: [Neo] More complex comparisons for IndexService

2009-07-01 Thread Mattias Persson
Great initiative, btw have you looked at the
LuceneFulltextIndexService in the same package? It might be able to do
what you're asking for.

By @Overriding the formQuery method you can construct whatever queries
you like based on key and search value (I just altered the signature
to also take the key in addition to value for greater flexibility).
Please have a look at that first and see if that helps you!

Also do an 'svn up' on the index-util component since I committed it just now :)

2009/6/30 Peter Neubauer neubauer.pe...@gmail.com:
 Adam,
 we would love to get your contribution into the codebase, just contact
 us regarding the CLA etc and we will get you through it!

 /peter

 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     - New Energy for Data - The Graph Database.
 http://www.ops4j.org     - New Energy for OSS Communities - Open
 Participation Software.
 http://www.oredev.org   - Where Good Geeks Grok.



 On Tue, Jun 30, 2009 at 10:13 PM, Anders
 Nawrothand...@neotechnology.com wrote:
 Hi and welcome!

 I can't answer your questions, but regarding the formatting we use an
 Eclipse code formatter which you can download from this page:
 http://wiki.neo4j.org/content/Coding_Standard

 This page could be of some interest as well:
 http://wiki.neo4j.org/content/Code_Contributor%27s_Guide

 /anders


 Adam Rabung skrev:
 Hi,
 I was wondering if anyone's interested in more complex queries against
 Neo's Lucene (and others) indexes, like so:

 long twoHoursAgo = System.currentTimeMillis() - (2 * 60 * 60 * 1000);
 indexService.getNodes(new Comparison(modifiedTime,
 ComparisonType.GREATER_THAN, twoHoursAgo);

 I hacked this into my local
 IndexService/LuceneIndexService/LuceneTransaction, and it seems to
 work.  For less than/greater than at least, the Lucene code itself is
 very straightforward (use a different Query class).  A little trickier
 when considering the added/updated/deleted nodes in the current tx,
 but not that bad.  There's _plenty_ of problems with my implementation
 - I applied it only to LuceneIndexService, type conversions, not too
 confident w/ some of the Neo-specific changes I made - but I was very
 encouraged by how easy it was to get a draft version running.

 Is there any chance at all this kind of thing could make a near-term
 Neo4j release?  If not, would it be possible to expose internals of
 some the classes so that third parties could easily add custom
 searches?

 Proof of concept patch attached.  Not really a patch - just 3 files
 - LuceneIndexService, LuceneTransaction and a new class called
 Comparison.  Eclipse formatting ruined my ability to quickly make you
 a nice patch.

 Thanks for a great product!

 

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



 --
 Anders Nawroth [and...@neotechnology.com]
 GTalk, Skype: anders.nawroth
 Phone: +46 737 894 163
 http://twitter.com/nawroth
 http://blog.nawroth.com/

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

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




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


Re: [Neo] indexing relationships

2009-07-07 Thread Mattias Persson
2009/7/7 Symeon (Akis) Papadopoulos papa...@iti.gr:

 Was that what you meant?

 My interpretation of Symeons request was an index from
 (RelationshipType,Node,Node) to Relationship, which in my opinion would be
 much more useful than a simple index from (String,primitive) to
 Relationship, which is how the node indexes work.

 That was exactly what I meant.


 The use for such an index would be for places where you have many
 relationships from a node and quickly wish to determine if there is a
 relationship from that node to a given node.

 Actually, my original thought was to index all relationships of a graph,
 but selective indexing based on node degree sounds like a smart way to
 save disk space and index update time.

 The benefit of having this be part of index-util (as opposed to internally
 in neo-core) is obvious. Keeping an index like this updated is expensive.
 You as an application developer know where in your graph you need it and
 thus where you are prepared to pay the extra overhead for insertion (an
 overhead that pays back on lookup). If we instead were to add something like
 this to neo-core we would add that overhead to all relationship creations,
 and that would be very undesirable.

 That is obviously understandable.

 To further clarify the distinction between an index like this and the
 currently existing indexes, here is a quick definition of the interface for
 it:

 interface RelationshipIndex {
     void index(Relationship relationship);
     Relationship lookup(RelationshipType type, Node start, Node end);
     void remove(Relationship relationship);
 }

 Perhaps the lookup method should have an additional argument specifying
 whether the relationship is directed or not.


 My major problem (stemming from some preliminary tests I've done) is
 performance and scalability. I've implemented a simple indexing scheme,
 where an edge between two nodes with string indices n1_idx and n2_idx is
 indexed simply by the concatenation between them (the underlying index
 structure was a B-tree). When I attempted to index all edges of a
 moderately sized graph (~120k nodes, ~2M edges) the indexing process
 took quite a lot (several hours) which I consider as unacceptable. Any
 suggestions for improving on the efficiency and scalability of such an
 index are more than welcome.

Grouping more operations in one transaction will increase indexing
speed and also if we were to write such a RelationshipIndex in lucene
it would be much faster, at least if tx grouping is high.


 Best regards,
 Akis

 Cheers,
 Tobias

 On Mon, Jul 6, 2009 at 7:27 PM, Peter Neubauer 
 neubauer.pe...@gmail.comwrote:


 Hi Symeon,
 so, what you are saying is that you would like to have the possibility
 to set indexes on relationships and their properties just like on the
 nodes as in http://components.neo4j.org/index-util/ ?

 I guess that would be easy to do, or you could do it yourself by
 looking at the index-util package, but I guess being able to treat
 Relationships as first-class indexing citizens is a good idea ... any
 others that have opinions on that?

 /peter

 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     - New Energy for Data - The Graph Database.
 http://www.ops4j.org     - New Energy for OSS Communities - Open
 Participation Software.
 http://www.oredev.org   - Where Good Geeks Grok.



 On Mon, Jul 6, 2009 at 10:38 AM, Symeon (Akis)
 Papadopoulospapa...@iti.gr wrote:

 Hi,

 I have been experimenting with incremental building of large graphs and
 I realized that the graph update process would be much faster if there
 was a possibility to index relationships between pairs of nodes in order
 to have the possibility for quick lookups. Currently, each time I want
 to create or update a relationship between two nodes (say n1 and n2), I
 first need to iterate through all relationships (of the particular type)
 of n1 and check whether the other node is n2. Is there any effort within
 neo4j.util.index to provide such functionality or should I try to
 develop something on my own?

 Best regards,
 Symeon (Akis)
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user


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







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




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


Re: [Neo] More complex comparisons for IndexService

2009-07-07 Thread Mattias Persson
 to improve it furthermore if
 necessary!



 On Wed, Jul 1, 2009 at 3:47 AM, Mattias
 Perssonmatt...@neotechnology.com wrote:
 Great initiative, btw have you looked at the
 LuceneFulltextIndexService in the same package? It might be able to do
 what you're asking for.

 By @Overriding the formQuery method you can construct whatever queries
 you like based on key and search value (I just altered the signature
 to also take the key in addition to value for greater flexibility).
 Please have a look at that first and see if that helps you!

 Also do an 'svn up' on the index-util component since I committed it 
 just now :)

 2009/6/30 Peter Neubauer neubauer.pe...@gmail.com:
 Adam,
 we would love to get your contribution into the codebase, just contact
 us regarding the CLA etc and we will get you through it!

 /peter

 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     - New Energy for Data - The Graph Database.
 http://www.ops4j.org     - New Energy for OSS Communities - Open
 Participation Software.
 http://www.oredev.org   - Where Good Geeks Grok.



 On Tue, Jun 30, 2009 at 10:13 PM, Anders
 Nawrothand...@neotechnology.com wrote:
 Hi and welcome!

 I can't answer your questions, but regarding the formatting we use an
 Eclipse code formatter which you can download from this page:
 http://wiki.neo4j.org/content/Coding_Standard

 This page could be of some interest as well:
 http://wiki.neo4j.org/content/Code_Contributor%27s_Guide

 /anders


 Adam Rabung skrev:
 Hi,
 I was wondering if anyone's interested in more complex queries against
 Neo's Lucene (and others) indexes, like so:

 long twoHoursAgo = System.currentTimeMillis() - (2 * 60 * 60 * 1000);
 indexService.getNodes(new Comparison(modifiedTime,
 ComparisonType.GREATER_THAN, twoHoursAgo);

 I hacked this into my local
 IndexService/LuceneIndexService/LuceneTransaction, and it seems to
 work.  For less than/greater than at least, the Lucene code itself is
 very straightforward (use a different Query class).  A little trickier
 when considering the added/updated/deleted nodes in the current tx,
 but not that bad.  There's _plenty_ of problems with my implementation
 - I applied it only to LuceneIndexService, type conversions, not too
 confident w/ some of the Neo-specific changes I made - but I was very
 encouraged by how easy it was to get a draft version running.

 Is there any chance at all this kind of thing could make a near-term
 Neo4j release?  If not, would it be possible to expose internals of
 some the classes so that third parties could easily add custom
 searches?

 Proof of concept patch attached.  Not really a patch - just 3 files
 - LuceneIndexService, LuceneTransaction and a new class called
 Comparison.  Eclipse formatting ruined my ability to quickly make you
 a nice patch.

 Thanks for a great product!

 

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



 --
 Anders Nawroth [and...@neotechnology.com]
 GTalk, Skype: anders.nawroth
 Phone: +46 737 894 163
 http://twitter.com/nawroth
 http://blog.nawroth.com/

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

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




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

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




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

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




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

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




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


Re: [Neo] Which version of Neo4j?!

2009-07-20 Thread Mattias Persson
For higher first-time insertion speeds there's the BatchInserter API,
but it only exists in b9 (I think).

2009/7/18 Amir Hossein Jadidinejad amir.jad...@yahoo.com:
 Dear Andreas,
 Excuse me, I thought that there is an integration problem between b8 and b9 
 versions!, If not, for the time being I prefer stable version to produce my 
 graph.
 My project is a mined ontology from the WEB that contains 2M concepts and 16M 
 relations (weighted-undirected).
 Approximately, how long does it take to complete? (add all nodes and 
 relations)Do you have any consideration or offers to better maintenance of 
 such a huge graph?Also, I need to find a node and get all neighbors as a 
 weighted list for follow-up works. So it's important for this graph to handle 
 such requests efficiently.
 Thank you and kind regards,
 Amir

 --- On Sat, 7/18/09, Andreas Kollegger akolleg...@tembopublic.org wrote:

 From: Andreas Kollegger akolleg...@tembopublic.org
 Subject: Re: [Neo] Which version of Neo4j?!
 To: Neo user discussions user@lists.neo4j.org
 Date: Saturday, July 18, 2009, 8:07 AM

 Hi Amir,

 The usual trade-offs apply: neo4j-b8 is stable and should be used for
 production code; neo4j-b9 snapshots are where the latest bugfixes and
 improvements appear, but the changes can lead to uncertainty.
 Personally, I prefer developing against trunk for any project, picking
 a stable build when my own projects enter the final integration phase
 for a milestone release. What's your timeframe like?

 I don't think there are any compatibility concerns for the graph data
 itself when moving from b8 to b9, which would probably be the bigger
 concern for you. Core developers, am I right to think that?

 Best,
 Andreas

 On Jul 18, 2009, at 4:14 AM, Amir Hossein Jadidinejad wrote:

 Hi,
 I'm going to develop a huge graph database with Neo4j that take a
 long time to complete and so I can't reproduce it again!
 There are two version is available: the standard neo4j-b8 and the
 snapshot version depending on neo4j-b9.
 What's the difference?, Which one you prefer?
 Thanks.




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

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




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




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


Re: [Neo] neo-meta properties

2009-07-20 Thread Mattias Persson
2009/7/17 Andreas Kollegger akolleg...@tembopublic.org:
 Glancing through the neo-rdf code, it does look to use neo-meta, as
 does owl2neo (though that package appears to be using an older version
 of the neo-meta api). Not sure how the components use neo-meta.

 Mattias, thanks for the guidance about establishing the relationship
 between neilPert and his lugwigKit. Are there plans for expressing
 these kinds of things through the API, so that the class restrictions
 will get applied?
There hasn't been a strong usecase to drive it forward so such
features hasn't been implemented yet. Any useful such additions and
improvements are very welcome indeed.

 Also, what about simple properties like strings? That should be a
 regular node property, right? So, to name neilPert I'd say:

 MetaStructureProperty name = namespace.getMetaProperty(name, true);
 artist.getDirectProperties().add(name);
 neilPert.setProperty(name.getName(), Neil Pert);

 Best,
 Andreas

 On Jul 17, 2009, at 5:51 AM, Rob Challen wrote:

 Can the neo-meta package be used within a neo-rdf / neo-rdf-sail
 implementation? I would guess there would need to be the same handling
 of namespaces, and depend on the underlying representation of the RDF
 in neo

 for example something like this as an alternative to the above:

 org.neo4j.rdf.model.Resource neilPert;
 drummer.getInstances().add(neilPert.nativeRepresentation());

 How does all of this relate to the owl2neo component? is the owl2neo
 stuff built on top of the neo-meta package?

 Cheers,

 Rob.


 On Thu, Jul 16, 2009 at 9:17 PM, Mattias Persson
 matt...@neotechnology.com wrote:

 Right, we should probably add such a method. What you can do is:

 DynamicRelationshipType.withName( plays.getName() )

 to get that relationship type (plays).

 2009/7/16 Andreas Kollegger akolleg...@tembopublic.org:
 It just occurred to me that I started a thread before the weekend to
 which I need to respond. Before I get back to that, I have a
 practical
 question about using neo-meta.

 Consider the following code snippet (a realization of the neo-meta
 introduction):

           MetaStructureClass artist =
 namespace.getMetaClass(artist, true);
           MetaStructureProperty plays =
 namespace.getMetaProperty(plays,
 true);
           artist.getDirectProperties().add(plays);
           MetaStructureClass drummer =
 namespace.getMetaClass(drummer,
 true);
           artist.getDirectSubs().add(drummer);
           MetaStructureClass instrument =
 namespace.getMetaClass(instrument, true);
           MetaStructureClass drums =
 namespace.getMetaClass(drums, true);

           drummer.getDirectSupers().add( artist );
           drums.getDirectSupers().add( instrument );

           plays.setRange( new
 MetaStructureClassRange( instrument ) );
           MetaStructureRestriction playsRestriction =
               drummer.getRestriction( plays, true );
           playsRestriction.setRange( new
 MetaStructureClassRange( drums ) );
           playsRestriction.setCardinality( 1 );

        Transaction tx = neo.beginTx();
        try {
                   Node neilPert = neo.createNode();
                   drummer.getInstances().add(neilPert);

                   Node ludwigKit = neo.createNode();
                   drums.getInstances().add(ludwigKit);

        }
        finally
        {
               tx.finish();
        }

 ...

 That lets me get to the point of saying that neilPert is a drummer,
 and that ludwigKit is an instance of drums. What I'm not clear about
 is how to express that neilPert plays ludwigKit.

 I need to establish a relationship between neilPert and lugwigKit,
 but
 am not sure the proper way to do that. I think I want something
 like:


 neilPert.createRelationshipTo(ludwigKit,
 plays.getRelationshipType());

 What's the correct way to do this?


 Thanks for any guidance,
 Andreas

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




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

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




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


Re: [Neo] Side effect

2009-07-28 Thread Mattias Persson
I just committed a fix for it (rev. 3017) ... it should do the trick

2009/7/28 Mattias Persson matt...@neotechnology.com:
 You're absolutely right... I see the problem in the iterator
 implementation of that method. I or Johan will fix that soon.

 2009/7/27 Neil Ellis neil.el...@peepwl.com:
 Hi guys

 I noticed a side-effect in the iterator for all nodes.

 If you do not do a hasNext() before a next() you get a no such element
 exception. So even if I have a million nodes .next() on the first node
 throws an exception, unless I do a hasNext() check first. I believe a
 hasXXX() method should be without side effect, is that fair comment?

 All the best
 Neil


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




 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com




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


Re: [Neo] Transformer...

2009-07-30 Thread Mattias Persson
Yeah absolutely, those can be used in more ways than wrapping
another iterable and maybe another name would be appropriate, but your
transformer is just one special case for that. So whatever name we
pick there will be uses of it that wont fit well with the name.

I think it's nice to see you use such utilities and finding new ways
of doing so. Keep it up!


/ Mattias

2009/7/29 Mattias Ask mattias@jayway.se:
 I just wanted to share something I just realized...

 Today I've been looking at the Functors API in commons-collections to
 see how that is applicable to the Traverser API in Neo. The one thing
 I was missing in the Traverser API was Transformer. There are two
 Predicate-like interfaces in the StopEvaluator and ReturnEvaluator but
 I miss something like the Transformer interface. As I was playing
 around with this I realized (as maybe many of you have done) that
 there indeed is something Transformer-like in Neo, namely
 IterableWrapper (in neo-utils). Up until now I've only used this for
 things like this:

 public IterableReceiver getRecieversOfDonations() {
                Traverser traverser = ... //My traverser that returns 
 RecieverNodes

                return new IterableWrapperReceiver, Node(traverser) {
                       �...@override
                        protected Receiver underlyingObjectToObject(Node 
 object) {
                                return new ReceiverNode(object);
                        }
                };
        }

 What I realized today is that this is more powerful than that, and
 that I can do whatever I want with it, for example:

 IterableSomeBean iterable = new IterableWrapperSomeBean,
 Node(traverser){
       �...@override
        protected SomeBean underlyingObjectToObject(Node node) {
                CreditNode creditNode = new CreditNode(node);
                DateTime createdDateTime = creditNode.getCreatedDateTime();
                Relationship someRelationship = creditNode
                                .getSingleRelationship(...);
                CreditNode someOtherCredit = new CreditNode(someRelationship
                                .getStartNode());
                AnotherNode anotherNode = new
 AnotherNode(someOtherCredit.traverse(...)
                                .iterator().next());
                return new SomeBean(
                                createdDateTime, 
 someOtherCredit.getSomething(),
 anotherNode.getName(), creditNode.getSomething());
        }
 };

 When used like this the name may be somewhat inaccurate
 (IterableTransformer?), but I think this is really powerful. What do
 you think?

 Best regards, Mattias Ask
 ---
 Jayway AB, +46 701 469284
 www.jayway.com

 Jayway is the founder of Öredev and Qi4J
 www.oredev.org
 www.qi4j.org




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




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


Re: [Neo] Searching 'links', based on their attributes ?

2009-07-31 Thread Mattias Persson
Hi Sebastian,

I'm not sure I really grasp your problem, but one solution that seems
appropriate would be to connect all those object graphs to one super
root node of your choice. So that you create this super root node,
maybe connect it to the neo reference node and let all your object
graphs have some relationship to that super root node. That way
they'll all be connected in a way and you could have that node as a
starting node when you traverse.

Alternatively you could connect all your object graphs to the neo
reference node directly and use that as a starting point for your
traversals.

Would that help you?

2009/7/31 sebastien nichele snich...@sqli.com:
 Hi,

 I'm currently evaluating neo4j and I'am really satisfied/impressed by it.

 However, I'm asking myself several questions.

 In my node space I have several dissocied objects graphs.
 Links between nodes bears two attributes startDate and endDate.

  At one time, i want to display all nodes in my graph that have links
  that match some combinations of startDate and endDate (ie. 'give me all
 nodes linked by links that
  have dates between 1st january and 3 march'), whatever the link nature is.

  I started using traversing for that, using exemples I found on
 documentation.
  My problem is that I don't have any super root node in my node space to
 start traversing (since traversing needs a 'root' node), but several graphs
 with several root nodes.

  In realize that in fact, I don't really want to traverse a graph, but
 simply pick links based on their attributes, and then, return nodes on links
 sides.

  I digged upon the documentation, but didn't find a way to do that simply
 and efficiently.

  I have the feeling that I am missing something...

  Can anyone shed some light on my matter ? ;)

  Thanks in advance for your answers,

  Best regards,

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




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


Re: [Neo] Searching 'links', based on their attributes ? [SOLUTION]

2009-08-01 Thread Mattias Persson
Allright I think the reason you aren't getting any answers is that a
traverser doesn't visit the same node twice during its lifetime. So if
the traverser is traversing from world to n3 it won't follow the
KNOWS relationship to n2 since you specified only OUTGOING such
relationship in the traverser. Then the traverser may come to the n2
node and wont go via KNOWS to the n3 node since it has already been
there.

Another solution would be to create one traverser for each object graph like:

for ( Relationship graphRelationship : world.getRelationships(
MyRelationshipTypes.CONTAINS, Direction.OUTGOING ) )
{
Traverser traverser = graphRelationship.getEndNode().traverse(
Traverser.Order.DEPTH_FIRST,

}


And, yeah, it's generally not a good idea to iterate over a nodes
every relationship... could be a performance problem if the graph
grows.

2009/7/31 sebastien nichele snich...@sqli.com:
 Mattias,

 Ok well, after a little bit of greymatter work, I finally got it.

 I didn't realized that links provides reachability of the nodes, not
 filtering of the nodes.

 Since all nodes are linked to a root node, i can reach all nodes by
 traversing from rootnode only on CONTAINS links.
 I have then to filter nodes depending on interesting attributes...

 The following code does what I want.

        final int sOffset = 3;
        Traverser friendsTraverser = world.traverse(
                Traverser.Order.BREADTH_FIRST,
                StopEvaluator.END_OF_GRAPH,
                new ReturnableEvaluator() {
                    public boolean isReturnableNode(TraversalPosition pos) {

                        boolean atLeastAnIncomingKnowsBoundedLink = false;
                        boolean atLeastAnOutgoingKnowsBoundedLink = false;

                        Iterator allOutRels =
 pos.currentNode().getRelationships(Direction.OUTGOING).iterator();

                        while (allOutRels.hasNext()) {
                            Relationship object = (Relationship)
 allOutRels.next();

 if(((Integer)object.getProperty(beginDateOffset)) = sOffset){
                                    atLeastAnOutgoingKnowsBoundedLink |=
 true;
                                }
                        }
                        Iterator allInRels =
 pos.currentNode().getRelationships(Direction.INCOMING).iterator();
                        while (allInRels.hasNext()) {
                            Relationship object = (Relationship)
 allInRels.next();

 if(((Integer)object.getProperty(beginDateOffset)) = sOffset){
                                    atLeastAnIncomingKnowsBoundedLink |=
 true;
                                }
                        }

                        return atLeastAnIncomingKnowsBoundedLink ||
 atLeastAnOutgoingKnowsBoundedLink;
                    }
                },
                MyRelationshipTypes.CONTAINS,
                Direction.OUTGOING);

 Since I can reach all nodes with CONTAINS link type, I doesn't need to
 'traverse' the other type like I've naively done before.

 I tried various values for the links properties, and the result is OK !

 On top of that, I would add a subsidiary question : is my solution not
 performance killer ? Iterating through all incoming and outgoing links from
 a node is not overkill ?

 Thank you in advance,

 Best regards,

 sni.





 2009/7/31 user-requ...@lists.neo4j.org

 Send User mailing list submissions to
        u...@lists.neo4j.org

 To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.neo4j.org/mailman/listinfo/user
 or, via email, send a message with subject or body 'help' to
        user-requ...@lists.neo4j.org

 You can reach the person managing the list at
        user-ow...@lists.neo4j.org

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of User digest...


 Today's Topics:

   1. Re: Searching 'links', based on their attributes ?
      (Mattias Persson)


 --

 Message: 1
 Date: Fri, 31 Jul 2009 10:50:24 +0200
 From: Mattias Persson matt...@neotechnology.com
 Subject: Re: [Neo] Searching 'links', based on their attributes ?
 To: Neo user discussions user@lists.neo4j.org
 Message-ID:
        acdd47330907310150q19969efgae877de00d783...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8

 Hi Sebastian,

 I'm not sure I really grasp your problem, but one solution that seems
 appropriate would be to connect all those object graphs to one super
 root node of your choice. So that you create this super root node,
 maybe connect it to the neo reference node and let all your object
 graphs have some relationship to that super root node. That way
 they'll all be connected in a way and you could have that node as a
 starting node when you traverse.

 Alternatively you could connect all your object graphs to the neo
 reference node directly and use that as a starting point for your
 traversals.

 Would

Re: [Neo] Wikipedia entries for graph database, Neo4f?

2009-08-03 Thread Mattias Persson
Yeah, I think that a mentioning of graph databases should definately
be in there somewhere!

2009/8/3 Rich Morin r...@cfcl.com:
 Looking at http://en.wikipedia.org/wiki/Database, I see nothing
 about graph databases.  Nor do I see a page on either this topic
 in general or Neo4j in particular.  Maybe some astroturf is in
 order...

 -r
 --
 http://www.cfcl.com/rdm            Rich Morin
 http://www.cfcl.com/rdm/resume     r...@cfcl.com
 http://www.cfcl.com/rdm/weblog     +1 650-873-7841

 Technical editing and writing, programming, and web development
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] meta structure

2009-08-03 Thread Mattias Persson
Oh ok, you use the same methods for getting the classes and properties
as for creating them:
(the true/false 2:nd argument is the allowCreate option, so that if
true then the class/property will be created if it didn't already
exist).

MetaStructureClass myClass =
namespace.getMetaClass( myClass, false );
MetaStructureProperty myProperty =
namespace.getMetaProperty( myProperty, false );
myProperty.setCardinalty( 1 );

for ( MetaStructureProperty propertyAssociatedWithMyClass :
myClass.getDirectProperties() )
{
}
...or...
for ( MetaStructureProperty propertyAssociatedWithMyClass :
myClass.getAllProperties() )
{
}


At least that's what I think you mean :)

2009/8/3 Jerry Juanico jtjuan...@gmail.com:
 Hi Mattias,

 With this information I was able to fix my dilemma.Thanks.

 One more thing. OK I already set-up the schema.
 Along with it is the expected values, range, data type, etc.

 But the thing is I cannot access or put values on the properties that I have
 created.
 I ran out of options, can u give me some hint?
 Thanks again

 Jers

 On Mon, Aug 3, 2009 at 5:39 PM, Mattias Persson
 matt...@neotechnology.comwrote:

 Hi,

 I think you'd like to use something like this:

 MetaStructureClass userClass = ...
 MetaStructureClass accountClass = ...
 MetaStructureProperty userHasAccount =
    namespace.getMetaProperty( user_has_account, true );
 userClass.getDirectProperties().add( userHasAccount );
 userHasAccount.setRange(
    new MetaStructureClassRange( accountClass ) );

 Is that what you're looking for?

 2009/8/3 Jerry Juanico jtjuan...@gmail.com:
  Hi All,
 
  I am currently working with one of the features of ne04j, which is the
 meta
  structure.
  I have tried implementing the test examples and it works fine.
  But the whole concept is still vague to me.
 
  I have noticed that the relationship type is automatic once I invoke the
  class and property instance.
 
  I am expecting that it's possible to defined specific relationship type
 as I
  did in a simple node/relationship/property structure, but I cannot find
 any
  from the list of  meta structure API.
 
  Can someone tell me how?
 
  Thanks.
 
  Jerry
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 



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

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




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


Re: [Neo] meta structure

2009-08-03 Thread Mattias Persson
Well, the meta structure is really just a helper for keeping data
according to a certain structure... if you make those checks against
it yourself, that is. There's nothing automatic in validation or
insertion by using this framework as of yet.

Inserting data is still done by using the neo4j API...
NeoService#createNode(), Node#setProperty( String, Object ) a.s.o. See
http://wiki.neo4j.org/ for more info there.

2009/8/4 Jerry Juanico jtjuan...@gmail.com:
 Oh I see,
 Maybe I have to refresh again.
 Anyway, just another question.
 For example I already have configured the meta structure, with all the data
 type( string, integer...), data range, etc.
 Can you give an idea on how can I use or put values in it?
 I'm lost here. Thanks.

 Jers

 On Mon, Aug 3, 2009 at 11:08 PM, Mattias Persson
 matt...@neotechnology.comwrote:

 2009/8/3 Jerry Juanico jtjuan...@gmail.com:
  Using the sample provided I was able to retrieve the properties, but what
 I
  wanted  is to be able to put values in it.
  Here is a sample code:
         MetaStructureClass employee = namespace.getMetaClass( employee,
  true );
         MetaStructureProperty firstName = namespace.getMetaProperty(
  firstName, true );
         firstName.setRange( new DatatypeClassRange( String.class ) );
         MetaStructureProperty lastName = namespace.getMetaProperty(
  lastName, true );
         lastName.setRange( new DatatypeClassRange( String.class ) );
         MetaStructureProperty middleName = namespace.getMetaProperty(
  middleName, true );
         middleName.setRange( new DatatypeClassRange( String.class ) );
         MetaStructureProperty age = namespace.getMetaProperty( age, true
  );
         age.setRange( new DatatypeClassRange( Integer.class ) );
         employee.getDirectProperties().add( firstName );
         employee.getDirectProperties().add( lastName );
         employee.getDirectProperties().add( middleName );
         employee.getDirectProperties().add( age );
 
  My objective is to put/add property values to the ff as in:
  firstName = John;
  lastName = Doe;
  middleName = Smith;
  age = 25;
 
  That's what I understand using meta structure, but would that be
 possible?
  If yes can you please show me how?
 
  Thanks.
 
  Jers
 

 May I ask what ff means? And currently there's no way of inserting
 data via the meta structure... that'd certainly be nice to have, but
 you have to do those things manually at the moment.

 
  On Mon, Aug 3, 2009 at 9:30 PM, Mattias Persson
  matt...@neotechnology.comwrote:
 
  Oh ok, you use the same methods for getting the classes and properties
  as for creating them:
  (the true/false 2:nd argument is the allowCreate option, so that if
  true then the class/property will be created if it didn't already
  exist).
 
  MetaStructureClass myClass =
     namespace.getMetaClass( myClass, false );
  MetaStructureProperty myProperty =
     namespace.getMetaProperty( myProperty, false );
  myProperty.setCardinalty( 1 );
 
  for ( MetaStructureProperty propertyAssociatedWithMyClass :
     myClass.getDirectProperties() )
  {
  }
  ...or...
  for ( MetaStructureProperty propertyAssociatedWithMyClass :
     myClass.getAllProperties() )
  {
  }
 
 
  At least that's what I think you mean :)
 
  2009/8/3 Jerry Juanico jtjuan...@gmail.com:
   Hi Mattias,
  
   With this information I was able to fix my dilemma.Thanks.
  
   One more thing. OK I already set-up the schema.
   Along with it is the expected values, range, data type, etc.
  
   But the thing is I cannot access or put values on the properties that
 I
  have
   created.
   I ran out of options, can u give me some hint?
   Thanks again
  
   Jers
  
   On Mon, Aug 3, 2009 at 5:39 PM, Mattias Persson
   matt...@neotechnology.comwrote:
  
   Hi,
  
   I think you'd like to use something like this:
  
   MetaStructureClass userClass = ...
   MetaStructureClass accountClass = ...
   MetaStructureProperty userHasAccount =
      namespace.getMetaProperty( user_has_account, true );
   userClass.getDirectProperties().add( userHasAccount );
   userHasAccount.setRange(
      new MetaStructureClassRange( accountClass ) );
  
   Is that what you're looking for?
  
   2009/8/3 Jerry Juanico jtjuan...@gmail.com:
Hi All,
   
I am currently working with one of the features of ne04j, which is
 the
   meta
structure.
I have tried implementing the test examples and it works fine.
But the whole concept is still vague to me.
   
I have noticed that the relationship type is automatic once I
 invoke
  the
class and property instance.
   
I am expecting that it's possible to defined specific relationship
  type
   as I
did in a simple node/relationship/property structure, but I cannot
  find
   any
from the list of  meta structure API.
   
Can someone tell me how?
   
Thanks.
   
Jerry
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo

Re: [Neo] neo4j Beginner Question

2009-08-14 Thread Mattias Persson
2009/8/14 Onur AKTAS onur.ak...@live.com:

 Thank you for your response. I'm trying to understand the main concept, 
 please correct me if I am wrong.

 For example, there are many users of an application and each represented as 
 Node.  And each User has a UserId in RDBMS. I have checked Node class 
 and saw that there is a method called as  getId()  but I could not see 
 setId() for mapping the User in the RDBMS to neo4j.

 Sample data: (UserId / Friends Ids)
 1 - [2, 4]
 2 - [1, 3]
 3 - [10]
 4 - [1, 3, 5]
 5 - [3]

 And I need to query  What are the all shortest paths from 1 to 10 for max 
 length 4 
 And results should be,

 1 - 2 - 3 - 10
 1 - 4 - 3 - 10
 * 1 - 4 - 5 - 3 - 10 (It will not be shown because it exceeds the length 
 4).

 You mean that it can be handled with neo4j, but how can I map each User in 
 RDBMS, to Nodes by their original Ids?

You can just come up with your own property key which will represent
that RDBMS id... f.ex:

node.setProperty( rdbms_id, myRdbmsId );

The node.getId() is just the internal id the node have in neo, which
is unique, but not over time since ids can be reused if they gets
deleted.


 Thanks.



 From: neubauer.pe...@gmail.com
 Date: Wed, 5 Aug 2009 11:16:15 +0200
 To: user@lists.neo4j.org
 Subject: Re: [Neo] neo4j Beginner Question

 Hi Onur

 2009/8/4 Onur AKTAS onur.ak...@live.com:
  Calculating,friends of friends, 3rd degree contacts or 4th degree etc. 
  is not a good idea with RDBMS. In short words, neo4j fits perfectly for 
  these kinds of jobs?
 yes, that is the kind of problems Neo4j and Graph Databases are trying
 to solve in general. Semi-structured data, havy use of relational
 information between information entities and complex analysis of high
 depth fast are some of the common use cases for using a graph
 database.

  Do we have a chance to scale neo4j by adding nodes, does it support 
  distributed processing? Also, can we delete any node in the graph when we 
  need to delete user or we must create the entire graph again when we need 
  any updates? Do graph objects have id's that helps us to find the node 
  quickly?

 Neo4j atm does not support distributed processing or partitioning the
 graph. There is high-availability and online-backup being worked on
 which feels more acute since Neo4j on a single instance scales over 1
 Billion primitives, which should be enough for most immediate
 scenarios.
 But there are of course ways to achieve a custom partitioning using
 targeted techniques - but that depends on your use case ...

 HTH

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

 _
 Anılarınızı istediğiniz herkesle çevrimiçi paylaşın.
 http://www.microsoft.com/turkiye/windows/windowslive/products/photos-share.aspx?tab=1
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] neo4j Beginner Question

2009-08-14 Thread Mattias Persson
// One instance per NeoService is enough
IndexService indexService = new LuceneIndexService( neoService );

and that will be your index, fully transactional and participates in
your neo transactions.

2009/8/14 Onur AKTAS onur.ak...@live.com:

 So I must build it on the top of Lucene?
 Hmm, shouldn't it be a native property of neo4j? Do we have a chance to get 
 Node's id after we insert it?
 So I can use an additional key - value based database for keeping the 
 relation between Node and User like below:
 (rdbms_user_id, neo4j_node_id)

 Is it a good idea?

 From: neil.el...@mangala.co.uk
 To: user@lists.neo4j.org
 Date: Fri, 14 Aug 2009 16:21:38 +0100
 Subject: Re: [Neo] neo4j Beginner Question

 And then use the index-utils to find the node (it's a good simple and
 efficient integration with Lucene).

 On 14 Aug 2009, at 16:10, Dan Heaver wrote:

  Onur, add a property to each node to hold the surragate key from your
  RDBMS...
 
  Dan
 
  On 14 Aug 2009, at 15:30, Onur AKTAS onur.ak...@live.com wrote:
 
 
  Thank you for your response. I'm trying to understand the main
  concept, please correct me if I am wrong.
 
  For example, there are many users of an application and each
  represented as Node.  And each User has a UserId in RDBMS. I
  have checked Node class and saw that there is a method called as 
  getId()  but I could not see setId() for mapping the User in the
  RDBMS to neo4j.
 
  Sample data: (UserId / Friends Ids)
  1 - [2, 4]
  2 - [1, 3]
  3 - [10]
  4 - [1, 3, 5]
  5 - [3]
 
  And I need to query  What are the all shortest paths from 1 to 10
  for max length 4 
  And results should be,
 
  1 - 2 - 3 - 10
  1 - 4 - 3 - 10
  * 1 - 4 - 5 - 3 - 10 (It will not be shown because it exceeds
  the length 4).
 
  You mean that it can be handled with neo4j, but how can I map each
  User in RDBMS, to Nodes by their original Ids?
 
  Thanks.
 
 
 
  From: neubauer.pe...@gmail.com
  Date: Wed, 5 Aug 2009 11:16:15 +0200
  To: user@lists.neo4j.org
  Subject: Re: [Neo] neo4j Beginner Question
 
  Hi Onur
 
  2009/8/4 Onur AKTAS onur.ak...@live.com:
  Calculating,friends of friends, 3rd degree contacts or 4th
  degree etc. is not a good idea with RDBMS. In short words, neo4j
  fits perfectly for these kinds of jobs?
  yes, that is the kind of problems Neo4j and Graph Databases are
  trying
  to solve in general. Semi-structured data, havy use of relational
  information between information entities and complex analysis of
  high
  depth fast are some of the common use cases for using a graph
  database.
 
  Do we have a chance to scale neo4j by adding nodes, does it
  support distributed processing? Also, can we delete any node in
  the graph when we need to delete user or we must create the entire
  graph again when we need any updates? Do graph objects have id's
  that helps us to find the node quickly?
 
  Neo4j atm does not support distributed processing or partitioning
  the
  graph. There is high-availability and online-backup being worked on
  which feels more acute since Neo4j on a single instance scales
  over 1
  Billion primitives, which should be enough for most immediate
  scenarios.
  But there are of course ways to achieve a custom partitioning using
  targeted techniques - but that depends on your use case ...
 
  HTH
 
  /peter
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 
  _
  Anılarınızı istediğiniz herkesle çevrimiçi paylaşın.
  http://www.microsoft.com/turkiye/windows/windowslive/products/photos-share.aspx?tab=1
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user

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

 _
 Windows Live tüm arkadaşlarınızla tek bir yerden iletişim kurmanıza yardımcı 
 olur.
 http://www.microsoft.com/turkiye/windows/windowslive/products/social-network-connector.aspx
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Question about RDF

2009-08-26 Thread Mattias Persson
Hi Oleg,

Take a look at the neo-rdf and neo-rdf-sail components, they are
designed to turn neo4j into a triple/quad store!

http://components.neo4j.org/neo-rdf/
http://components.neo4j.org/neo-rdf-sail/

The neo-rdf-sail component is optional and just makes you use the
neo-rdf as a SAIL.


/ Mattias

2009/8/26 Oleg Aravin oara...@griddynamics.com:
  Hi!
  My name Oleg!
  Please help me for resolve one problem. I have jena Model, particularly an
 RDF representation of it. Then i read about neo4j and wanted to use neo4j to
 work with my RDF model. I read documentation and search in google, but i not
 found any way how to lod RDF (xml) model into neo4j classes. How can i do
 this? Is neo4j support this way or i must iterate my model and create each
 relation?


  I shall be grateful for the help.
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Load hugh graph

2009-08-26 Thread Mattias Persson
Please use the name() method on the RelationshipType to print the
actual name of it... and also as equality tests between relationship
types. See http://api.neo4j.org/current/org/neo4j/api/core/RelationshipType.html
for more information about that.

2009/8/26 Vanessa Junquero Trabado vanessitajunqu...@hotmail.com:

 Ok.
 The speed has increased a lot, but if I remove the property RelationshipType 
 of the
 edges, I have the following problem when I try to get the type of a
 relationship:
 My code is:

 iter = neo.getRelationshipIds(eNode).iterator();

 long rel = iter.next();
 System.out.print(neo.getRelatoinshipById(rel).getType());

 And the result is:

 org.neo4j.impl.batchinsert.batchinserterimpl$relationshiptypei...@17494c8

 The definition of the relationships is:



     enum MyRelationshipTypes implements RelationshipType
     {
         REF_TITLE, REF_IMAGE
     }

 Thank you for all.

 Vanesa.
 _
 Comparte las noticias que te interesan. Con MSN Reporter puedes compartir con 
 otros internautas las noticias que más te interesan, y votar las que otras 
 personas han destacado.
 http://reporter.es.msn.com/?days=1view=News
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Question about RDF

2009-08-26 Thread Mattias Persson
Great chipping in there Olivier with the last peace of this puzzle!

2009/8/26 Olivier Rossel olivier.ros...@gmail.com:
 feel free to give us feedback on this list about your success in RDF
 management with neo4j.

 On Wed, Aug 26, 2009 at 11:43 AM, Oleg Aravinoara...@griddynamics.com wrote:
 Thank you Olivier!
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

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




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


Re: [Neo] NeoServiceLifecycle in OSGi

2009-08-26 Thread Mattias Persson
2009/8/26 Andreas Kollegger akolleg...@tembopublic.org:
 Hi Mattias,

 Thanks for the class. I had started to code up a similar approach when
 it occurred to me
 that I should first look whether an implementation existed.

 I also would prefer renaming the current implementation to
 NeoServiceLifecycleImpl and
 adding the interface, but am reluctant to change a published api.

 Would this be disruptive to many people?
I don't think so... it's a fairly new class and I don't think many
people have found it :) I say go for it.

 On Aug 26, 2009, at 6:19 AM, Mattias Persson wrote:

 Hi Andreas,

 sorry for my non-OSGi skills (the author of this class).

 I'd vote for something else, rather than INeoServiceLifecycle since,
 as you pointed out, it'd go against the neo4j conventions. Maybe have
 the interface named NeoServiceLifecycle and the implementation be
 named NeoServiceLifecycleImpl... but that's not the best either, I
 guess, although slightly better...

 2009/8/25 Andreas Kollegger akolleg...@tembopublic.org:
 Hi all,

 To make NeoServiceLifecycle a bit more digestible in OSGi
 environments, I'd like to refactor the class into an interface/
 implementation pair. To avoid breaking current use of the class, I
 propose to add an interface above NeoServiceLifecycle which matches
 the public methods and then make NeoServiceLifecycle implement the
 interface.

 The name of the interface could simply be INeoServiceLifecycle --
 though that isn't part of the current neo naming scheme.

 So two things: would people be ok with this change, and what should
 the interface be called?

 -Andreas
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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

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




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


Re: [Neo] Lucene Full text bathinserter

2009-09-07 Thread Mattias Persson
Hi Bob,

I just committed a LuceneFulltextIndexBatchInserter which does just
that. You'll probably be the first to try it out though, except some
unit tests :)

2009/9/5 Rob Challen rjchal...@gmail.com:
 Hi there,

 Is there any way to use a full text lucene index service with the
 BatchInserter, or with the EmbeddedReadOnlyNeo service?

 Thanks,

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




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


Re: [Neo] Api - setProperties(Map properties) ?

2009-09-08 Thread Mattias Persson
I guess there are arguments against adding something like that to the
API (others will have to chime in with exactly why), but itsn't it
just as easily accomplished by you writing a public static utility
method like setMapProperties( PropertyContainer target, MapString,
Object properties )?

2009/9/8 Dan Heaver dan.hea...@peepwl.com:
 Guys, I've been working with Neo quite a lot of late (as you are aware from
 the amount of bothering you we have been doing...)
 One thing I keep finding myself doing is writing loops to pull properties
 out of a Map and add them to a Node.

 I keep wondering if there isn't an argument for a setProperties(Map
 properties) method on the PropertyContainer class?

 Any thoughts?

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




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


Re: [Neo] Looking at DB contents

2009-09-09 Thread Mattias Persson
I don't follow entirely... you mean that the shell held locks on nodes
which made another traverser (executed via script or something) wait?
At the moment every command in the shell is wrapped in its own
transaction.

2009/9/7 Todd Stavish toddstav...@gmail.com:
 Hi Martin, Anders,

 The standalone version of neoclipse works like a charm, thanks. I was
 surprised that the shell locked out a non-updating traverse
 application that I wrote. Where do I explicitly declare locking? My
 natural assumption was in beginTx( kindOfLock ).

 Thanks,
 Todd


 On Mon, Sep 7, 2009 at 1:17 AM, Martin Filipczyk i...@mupitu.de wrote:
 Hi Todd,

 have you already tried the neoclipse standalone version?

 -Martin

 Todd Stavish schrieb:
 Thanks I'll give the shell a try.


 Was it crashing on opening the database or what happened?


 It shows the reference node and then just hangs. I am using Galileo
 though and maybe the wrong version of GEF. So no big deal.

 -Todd




 /anders

 --
 Anders Nawroth [and...@neotechnology.com]
 GTalk, Skype: anders.nawroth
 Phone: +46 737 894 163
 http://twitter.com/nawroth
 http://blog.nawroth.com/

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


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


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

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




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


Re: [Neo] Looking at DB contents

2009-09-09 Thread Mattias Persson
That's strange since the shell only wraps commands in transactions.
This means that leaving the shell open, just standing on a node
doesn't create/hold a lock or transaction whatsoever. You could debug
this kind of problem (when it appears) by making a complete thread
dump and you'll see which threads are holding neo4j locks, to see if
it's really the shell which has locks or not.

2009/9/9 Todd Stavish toddstav...@gmail.com:
 Hi Mattias,

 Yes, that is correct. I think fundamentally I do not understand how your
 locking works. I assumed that both the shell and traverser would have read
 only locks. However, I left the shell open and the traverser was blocked. I
 did not do anything in the shell other than read-only commands.

 -Todd


 On Wed, Sep 9, 2009 at 5:47 AM, Mattias Persson
 matt...@neotechnology.comwrote:

 I don't follow entirely... you mean that the shell held locks on nodes
 which made another traverser (executed via script or something) wait?
 At the moment every command in the shell is wrapped in its own
 transaction.

 2009/9/7 Todd Stavish toddstav...@gmail.com:
  Hi Martin, Anders,
 
  The standalone version of neoclipse works like a charm, thanks. I was
  surprised that the shell locked out a non-updating traverse
  application that I wrote. Where do I explicitly declare locking? My
  natural assumption was in beginTx( kindOfLock ).
 
  Thanks,
  Todd
 
 
  On Mon, Sep 7, 2009 at 1:17 AM, Martin Filipczyk i...@mupitu.de wrote:
  Hi Todd,
 
  have you already tried the neoclipse standalone version?
 
  -Martin
 
  Todd Stavish schrieb:
  Thanks I'll give the shell a try.
 
 
  Was it crashing on opening the database or what happened?
 
 
  It shows the reference node and then just hangs. I am using Galileo
  though and maybe the wrong version of GEF. So no big deal.
 
  -Todd
 
 
 
 
  /anders
 
  --
  Anders Nawroth [and...@neotechnology.com]
  GTalk, Skype: anders.nawroth
  Phone: +46 737 894 163
  http://twitter.com/nawroth
  http://blog.nawroth.com/
 
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 
 
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 
 
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 



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

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




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


Re: [Neo] Looking at DB contents

2009-09-09 Thread Mattias Persson
Btw. are you using the shell to connect remotely to a running
NeoService or or you using it to start a local one? If you're starting
a local (inside the shell JVM) you might have the problem that the
neo4j files are locked so that you cannot start up your traverser
application... is that the case?

2009/9/9 Mattias Persson matt...@neotechnology.com:
 That's strange since the shell only wraps commands in transactions.
 This means that leaving the shell open, just standing on a node
 doesn't create/hold a lock or transaction whatsoever. You could debug
 this kind of problem (when it appears) by making a complete thread
 dump and you'll see which threads are holding neo4j locks, to see if
 it's really the shell which has locks or not.

 2009/9/9 Todd Stavish toddstav...@gmail.com:
 Hi Mattias,

 Yes, that is correct. I think fundamentally I do not understand how your
 locking works. I assumed that both the shell and traverser would have read
 only locks. However, I left the shell open and the traverser was blocked. I
 did not do anything in the shell other than read-only commands.

 -Todd


 On Wed, Sep 9, 2009 at 5:47 AM, Mattias Persson
 matt...@neotechnology.comwrote:

 I don't follow entirely... you mean that the shell held locks on nodes
 which made another traverser (executed via script or something) wait?
 At the moment every command in the shell is wrapped in its own
 transaction.

 2009/9/7 Todd Stavish toddstav...@gmail.com:
  Hi Martin, Anders,
 
  The standalone version of neoclipse works like a charm, thanks. I was
  surprised that the shell locked out a non-updating traverse
  application that I wrote. Where do I explicitly declare locking? My
  natural assumption was in beginTx( kindOfLock ).
 
  Thanks,
  Todd
 
 
  On Mon, Sep 7, 2009 at 1:17 AM, Martin Filipczyk i...@mupitu.de wrote:
  Hi Todd,
 
  have you already tried the neoclipse standalone version?
 
  -Martin
 
  Todd Stavish schrieb:
  Thanks I'll give the shell a try.
 
 
  Was it crashing on opening the database or what happened?
 
 
  It shows the reference node and then just hangs. I am using Galileo
  though and maybe the wrong version of GEF. So no big deal.
 
  -Todd
 
 
 
 
  /anders
 
  --
  Anders Nawroth [and...@neotechnology.com]
  GTalk, Skype: anders.nawroth
  Phone: +46 737 894 163
  http://twitter.com/nawroth
  http://blog.nawroth.com/
 
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 
 
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 
 
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 



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

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




 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com




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


Re: [Neo] Counting nodes

2009-09-18 Thread Mattias Persson
Looking at the Lucene javadocs I can see that you can ask an index
(IndexReader) the number of documents there are in it and it'd be
simple to expose a size() method in the IndexService interface or
perhaps on the LuceneIndexService class...

Would that be something worth/good to implement?

2009/9/18 Andreas Guenther andreas.guent...@web.de:
 actually, disregard my suggestion as I didn't read the word index in your 
 question before.

 -AndreasAndreas Guenther wrote:

 The service API has a getAllNodes() call. Iterate and count through it.



 -AndreasAndreas Kollegger wrote:



 Hi all,







 For nodes that are kept in the indexed service, is there a more clever



 (and hopefully efficient) way to get the node count than manually



 iterating over all the nodes in the index and actually counting. I



 don't see anything obvious in the IndexService() interface, and am not



 sure if I've overlooked something useful somewhere else.







 I suppose I could always keep a running tally somewhere, but then I'd



 have to be careful to keep it in sync with reality. Ideally the count



 would be closer to the metal.







 Thanks,



 Andreas



 ___



 Neo mailing list



 User@lists.neo4j.org



 https://lists.neo4j.org/mailman/listinfo/user





 ___

 Neo mailing list

 User@lists.neo4j.org

 https://lists.neo4j.org/mailman/listinfo/user


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




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


Re: [Neo] [Commits] r3108 - components/index-util/trunk/src/main/java/org/neo4j/util/index

2009-09-18 Thread Mattias Persson
() );
 -            if ( list == null )
 -            {
 -                list = new ArrayListRemoveCommand();
 -                removeCommandMap.put( removeCommand.getKey(), list );
 -            }
 -            list.add( removeCommand );
 -        }
 -        else
 -        {
 -            throw new RuntimeException( Unknown command:  + command );
 -        }
 +        list.add( luceneCommand );
     }

     @Override
 @@ -192,34 +170,32 @@
         luceneDs.getWriteLock();
         try
         {
 -            for ( String key : removeCommandMap.keySet() )
 +            for ( Map.EntryString, ListLuceneCommand entry :
 +                this.commandMap.entrySet() )
             {
 -                IndexSearcher searcher = luceneDs.getIndexSearcher( key );
 -                if ( searcher != null ) // meaning such a index exist
 +                String key = entry.getKey();
 +                IndexWriter writer = luceneDs.getIndexWriter( key );
 +                for ( LuceneCommand command : entry.getValue() )
                 {
 -                    ListRemoveCommand commands = removeCommandMap.get( key 
 );
 -                    for ( RemoveCommand cmd : commands )
 +                    if ( command instanceof AddCommand )
                     {
 -                        String value = cmd.getValue();
 -                        long id = cmd.getNodeId();
 -                        luceneDs.deleteDocumentUsingReader( searcher, id,
 -                            value );
 -                        luceneDs.invalidateCache( key, value );
 +                        indexWriter( writer, command.getNodeId(), key,
 +                            command.getValue() );
                     }
 +                    else if ( command instanceof RemoveCommand )
 +                    {
 +                        luceneDs.deleteDocumentsUsingWriter(
 +                            writer, command.getNodeId(), command.getValue() 
 );
 +                    }
 +                    else
 +                    {
 +                        throw new RuntimeException( Unknown command type  +
 +                            command + ,  + command.getClass() );
 +                    }
 +                    luceneDs.invalidateCache( key, command.getValue() );
                 }
 -                luceneDs.removeIndexSearcher( key );
 -            }
 -            for ( String key : addCommandMap.keySet() )
 -            {
 -                IndexWriter writer = luceneDs.getIndexWriter( key );
 -                ListAddCommand commands = addCommandMap.get( key );
 -                for ( AddCommand cmd : commands )
 -                {
 -                    indexWriter( writer, cmd.getNodeId(), key, 
 cmd.getValue() );
 -                    luceneDs.invalidateCache( key, cmd.getValue() );
 -                }
                 luceneDs.removeWriter( key, writer );
 -                luceneDs.removeIndexSearcher( key );
 +                luceneDs.invalidateIndexSearcher( key );
             }
         }
         finally
 @@ -227,7 +203,7 @@
             luceneDs.releaseWriteLock();
         }
     }
 -
 +
     @Override
     protected void doPrepare()
     {
 @@ -260,8 +236,7 @@
     protected void doRollback()
     {
         // TODO Auto-generated method stub
 -        addCommandMap.clear();
 -        removeCommandMap.clear();
 +        commandMap.clear();
         txIndexed.clear();
         txRemoved.clear();
     }

 ___
 Commits mailing list
 comm...@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/commits




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


Re: [Neo] Neo4j bundle packaging

2009-09-21 Thread Mattias Persson
Bump.

Any progress here anyone? It should be dealt with rather soon do
prevent strange behaviour and confusion.

2009/9/20 Peter Neubauer peter.neuba...@jayway.se:
 Hi folks,
 Mattias noted packaging problem where dependencies got embedded into
 e.g. the neo-utils final jar. I propose changing the master pom so
 that we will explicitely scope all dependencies and only deps with
 scope runtime or compile get embedded and not imported into the
 final bundles, something along the lines of

 Index: neo-utils/trunk/pom.xml
 ===
 --- neo-utils/trunk/pom.xml     (revision 3108)
 +++ neo-utils/trunk/pom.xml     (working copy)
 @@ -63,16 +63,19 @@
       groupIdorg.neo4j/groupId
       artifactIdneo/artifactId
       version1.0-b10-SNAPSHOT/version
 +      scopeprovided/scope
     /dependency
     dependency
       groupIdorg.neo4j/groupId
       artifactIdneo-component-commons/artifactId
       version0.3-SNAPSHOT/version
 +      scopeprovided/scope
     /dependency
     dependency
       groupIdorg.neo4j/groupId
       artifactIdindex-util/artifactId
       version0.8-SNAPSHOT/version
 +      scopeprovided/scope
     /dependency
   /dependencies
  /project
 Index: pom.xml
 ===
 --- pom.xml     (revision 3108)
 +++ pom.xml     (working copy)
 @@ -119,6 +119,7 @@
             Bundle-Version${pom.version}/Bundle-Version
             
 Export-Package!${bundle.namespace}.internal.*,${bundle.namespace}.*;version=${pom.version}/Export-Package
             Private-Package${bundle.namespace}.internal.*/Private-Package
 +                       
 Embed-Dependency*;scope=compile|runtime/Embed-Dependency
             !-- Allow each bundle to override these settings by
 creating a file named osgi.bnd
                  in the same directory as the component's pom.xml.
 See components/neo/trunk/osgi.bnd
                  for an example.



 WDYAT? Andreas, any thoughts?

 /peter

 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                - Relations count.
 http://www.oredev.se                - The best thing since the wall came down.
 http://www.linkedprocess.org   - Distributed computing on LinkedData scale
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Neo4j bundle packaging

2009-09-22 Thread Mattias Persson
2009/9/22 Andreas Kollegger akolleg...@tembopublic.org:
 Looking at neo-utils, I don't see any embedded dependencies in the
 neo-utils jar. The manifest would have entries like Include-Resource
 or Bundle-Classpath and there'd be jars within the jar.

 Oh, wait. I think I see the problem. neo-utils depends on index-util
 which produce classes in overlapping package name spaces. Ah. Yes, that
 effectively is embedding dependencies, except that the culprit
 is actually a problem with the Export-Package. The parent has this:

 Export-Package!${bundle.namespace}.internal.*,$
 {bundle.namespace}.*;version=${pom.version}/Export-Package

 Which for neo-utils means any available class in the org.neo4j.util.*
 packages
 except for org.neo4j.util.internal classes will be included in the jar.

 So, we need a local osgi.bnd file to specifically exclude the non neo-
 utils
 package namespaces. This should do it:

 Export-Package: !org.neo4j.util.internal.*,!org.neo4j.util.index,!
 org.neo4j.util.map,!org.neo4j.util.timeline,!org.neo4j.util.btree,!
 org.neo4j.util.sortedtree,org.neo4j.util.*;version=${pom.version}

This sounds like a good and subtle fix to me!


 I'm sorry. I remember coming across this early on, and was sure that I'd
 taken care of it when committing the bundle stuff. This is my fault.

 As for things like JTA: I don't think we should embed that in core
 unless we also produce a version without it embedded. We should be
 able to do that with an assembly. My own project is atypical, I know,
 but I actually deploy multiple persistence technologies (jpa, db4o,
 neo4j), in a best tool for the job approach. Having multiple JTAs
 in different bundles would be awkward to overcome.

 Alternatively, we could start a neo-commons (or neo-deps?) multi-module
 project with modules that wrap any required third party stuff to keep
 it all in the family, while maintaining maximum flexibility when
 provisioning a runtime.

I believe that's something like what the APOC bundle is, right?

 Thoughts? Preferences?

 -Andreas


 On Sep 21, 2009, at 5:18 PM, Peter Neubauer wrote:

 Hi Andreas,
 basically getting rid of unwanted includes is the case. I am thinking
 the master pom addition would clear things up and exclude deps in an
 obvious way. via the bnd files we can then fine tune e.g. exports in
 case that is necessary. WDYT?

 Then, we could e.g. explicitely state the JTA jar as scope runtime
 to make it clear it wil be packaged with the core bundle ...

 /peter

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

 http://www.neo4j.org                - Relationships count.
 http://www.oredev.se               - The best thing since the wall
 came down.
 http://www.linkedprocess.org   - Distributed computing on LinkedData
 scale



 On Mon, Sep 21, 2009 at 10:51 PM, Andreas Kollegger
 akolleg...@tembopublic.org wrote:
 Hey, just catching up on this thread.

 Adding an explicit provided scope to dependencies seems fine to me.
 I'm not sure about adding Embed-Dependency to the parent pom, though.

 Without an explicit Embed-Dependency instruction, I wouldn't expect
 anything other than compiled source to be in the final jar. Are you
 saying that was happening? Or that you want dependencies embedded?

 If the latter, then the component which wants different behavior
 from the bundle plugin can create a filed named osgi.bnd in the same
 directory as it's pom. Any instructions in there will override the
 instructions in the plugin configuration.

 So, is it getting rid of unwanted dependencies that are being
 included,
 or adding in dependencies that are wanted?

 -Andreas


 On Sep 21, 2009, at 4:27 PM, Peter Neubauer wrote:

 Yeah, I guess I can do it, but need the rights first,
 alternatively I
 can send you a patch that includes all the updates in the different
 poms (basically just adding the right scope elements). Can work on
 it
 more tomorrow.

 /peter

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

 http://www.neo4j.org                - Relationships count.
 http://www.oredev.se               - The best thing since the wall
 came down.
 http://www.linkedprocess.org   - Distributed computing on LinkedData
 scale



 On Mon, Sep 21, 2009 at 10:25 PM, Mattias Persson
 matt...@neotechnology.com wrote:
 Oh, ok... I'd vote for someone with a little more OSGi knowledge
 though, who could test it a bit before committing it. But I guess I
 _could_ do it.

 2009/9/21 Peter Neubauer neubauer.pe...@gmail.com:
 Well, I figure you have to commit the patch, since I don't have
 sufficient privileges for the master pom ...

 /peter

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

Re: [Neo] Neo4j bundle packaging

2009-09-22 Thread Mattias Persson
2009/9/22 Mattias Persson matt...@neotechnology.com:
 2009/9/22 Peter Neubauer neubauer.pe...@gmail.com:
 Hi there,

 On Tue, Sep 22, 2009 at 9:44 AM, Mattias Persson
 matt...@neotechnology.com wrote:
 2009/9/22 Andreas Kollegger akolleg...@tembopublic.org:
 Export-Package!${bundle.namespace}.internal.*,$
 {bundle.namespace}.*;version=${pom.version}/Export-Package

 Which for neo-utils means any available class in the org.neo4j.util.*
 packages
 except for org.neo4j.util.internal classes will be included in the jar.

 So, we need a local osgi.bnd file to specifically exclude the non neo-
 utils
 package namespaces. This should do it:

 Export-Package: !org.neo4j.util.internal.*,!org.neo4j.util.index,!
 org.neo4j.util.map,!org.neo4j.util.timeline,!org.neo4j.util.btree,!
 org.neo4j.util.sortedtree,org.neo4j.util.*;version=${pom.version}

 This sounds like a good and subtle fix to me!
 Yeah, this sounds good, although I agree with Andreas in that we
 should have better naming conventions in the utils and index-utils
 components so they don't overlap in the hierarchical structure in the
 long run. Will do that tonight.
 Great, I agree with having better package names/hierarchy, which may
 be the best solution of them all.
Maybe just adding a sub-package for the classes in neo-utils, like
org.neo4j.util.xxx, where xxx could be common, asorted, extras
or something like that.



 I'm sorry. I remember coming across this early on, and was sure that I'd
 taken care of it when committing the bundle stuff. This is my fault.

 As for things like JTA: I don't think we should embed that in core
 unless we also produce a version without it embedded. We should be
 able to do that with an assembly. My own project is atypical, I know,
 but I actually deploy multiple persistence technologies (jpa, db4o,
 neo4j), in a best tool for the job approach. Having multiple JTAs
 in different bundles would be awkward to overcome.

 Yes, then the current bundling is wrong and we need to import the JTA
 packages instead of embedding the jta.jar into the bundle. will change
 that too.

 Alternatively, we could start a neo-commons (or neo-deps?) multi-module
 project with modules that wrap any required third party stuff to keep
 it all in the family, while maintaining maximum flexibility when
 provisioning a runtime.

 I believe that's something like what the APOC bundle is, right?

 Yes and no. We could as part of the APOC bundle provide a wrapped JTA
 library bundle (if there is none already out there), but that would be
 purely used in the OSGi scenarios, not otherwise, so I am not sure it
 should be in there, maybe it's best to have it in the examples
 instead, as part of the runtime provisioning setup?

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




 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com




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


Re: [Neo] threading

2009-10-12 Thread Mattias Persson
Johan I recognize these characteristics from a previous bug (in the
normal EmbeddedNeo). Do you remember it as well? So if there's an old
ticket we perhaps could find it and get a clue from there?

2009/10/11, Johan Svensson jo...@neotechnology.com:
 On Sun, Oct 11, 2009 at 6:01 PM, Marc Preddie mpred...@gmail.com wrote:
 Hi Johan,
 That's what I initially suspected, and so I ran a small test to output the
 relationship in question, and there is only one.

 But wouldn't the same error occur when using a single thread, if there
 were
 more than one relationship of the same type and I invoked
 getSingleRelationship...

 If there is no writing going on it shouldn't matter if you are reading
 with one or many threads, they should all return the same
 relationships.


 If it helps at all I'm running on winxp 64bit.

 I'm going to try to replicate the issue with using a small sample and if I
 can, would it be helpful to send it you?


 It would be very helpful if you can send me sample code that reproduce
 the issue.

 Regards,
 -Johan
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user



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


Re: [Neo] NPE during XA transaction

2009-11-11 Thread Mattias Persson
Great to hear that this worked out for you in the end.

/ Mattias

2009/11/11 Andreas Guenther andreas.guent...@web.de:
 Well, as it turns out all my fault as another backup process I have kicked in 
 and interfered with my reprocessing. After I synchronized these two competing 
 resources everything runs as smooth as usual again.

 Sorry for bothering but we are close to end of our release cycle ;)
 -Andreas

 P.S.
 Neo rocks!

Thanks, I know :)


 -Ursprüngliche Nachricht-
 Von: Andreas Guenther andreas.guent...@web.de
 Gesendet: 11.11.09 20:57:51
 An: user@lists.neo4j.org
 Betreff: [Neo] NPE during XA transaction


 Hi,

 I am trying to reprocess requests available from a queue into my neo store. 
 I intentionally avoid using the bulk load feature. The idea behind the 
 feature is to have the ability synchronizing neo with the database in case 
 neo missed transactions and also to be able to reconstruct the store from 
 scratch if needed. Everything works just fine when processing the queue in 
 production, that is, where requests come in infrequently, all distributed 
 during the day. It unfortunately fails when trying to reprocess them in fast 
 order. It consistently happens after approx 2000 processing requests.

 Any idea what could have caused the NPE as pasted below? Looks like the 
 'LogBuffer writeBuffer' got assigned to NULL at one point, probably during 
 either releaseCurrentLogFile() or close(). Anything related to log rotation, 
 maybe? This happens on Linux with Neo4j 1.0-b10.

 Any workarounds or explanations appreciated,
 -Andreas

 org.neo4j.impl.transaction.TransactionFailureException: Unable to commit 
 transaction
 ...
 Caused by: java.lang.NullPointerException
         at 
 org.neo4j.impl.transaction.xaframework.XaLogicalLog.done(XaLogicalLog.java:462)
         at 
 org.neo4j.impl.transaction.xaframework.XaResourceManager.commit(XaResourceManager.java:400)
         at 
 org.neo4j.impl.transaction.xaframework.XaResourceHelpImpl.commit(XaResourceHelpImpl.java:64)
         at 
 org.neo4j.impl.transaction.TransactionImpl.doCommit(TransactionImpl.java:514)
         at org.neo4j.impl.transaction.TxManager.commit(TxManager.java:573)
         at org.neo4j.impl.transaction.TxManager.commit(TxManager.java:543)
         at 
 org.neo4j.impl.transaction.TransactionImpl.commit(TransactionImpl.java:102)
         at 
 org.neo4j.api.core.EmbeddedNeoImpl$TransactionImpl.finish(EmbeddedNeoImpl.java:395)
 __
 GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
 Jetzt freischalten unter http://movieflat.web.de

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



 __
 GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
 Jetzt freischalten unter http://movieflat.web.de

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




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


Re: [Neo] Lucene version

2009-11-18 Thread Mattias Persson
 After playing with it more, the culprit seems to be not the symbolic
 link but the local drive :-/ When I delete the neo4j directory with the
 db and start the application from the local drive then I'm getting the
 NPEs - even if I shut the server down and start it again. When I delete
 the neo directory and start jboss from the directory on the nfs drive
 then it works fine, without NPEs. When I then start the application from
 the local drive again (without deleting the neo dir) then it again works
 fine, without NPEs.
 I have no idea why this is happening.. I verified that the index service
 is being initialized in the same thread that uses it later when the
 exception occurs so it shouldn't be a problem with some asynchronicity
 introduced by JBoss.


That is quite strange. I've never come across a problem like this and
we don't have automated tests for situations like these. Could you
perhaps provide me with the stacktrace you get? That would be very
helpful.


 One last note: the described behaviour holds for the combination of
        index-util-0.9-20091112.150844-2.jar
        neo-1.0-b11-20091114.181002-8.jar

 with
        index-util-0.9-20091116.160830-4.jar
        neo-1.0-b11-20091114.181002-8.jar

 I get NPEs in both cases (local/nfs). Which combination should I
 actually be using?

The best thing is to use the index-util-0.9-SNAPSHOT and
neo-1.0-b11-SNAPSHOT versions (i.e. the latest of both those
components).
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Lucene version

2009-11-18 Thread Mattias Persson
Thanks, there seems to be some known problems with lucene on NFS. If
you're calling getNodes on a non-existing index then I committed a fix
for that (added one extra null check), but if that index should exist
it could just be that lucene is having trouble with NFS.

I'll look into this further to see if there's something to be done to
help lucene in these areas.

2009/11/18 Jakub Kotowski jakubkotow...@gmx.net:
 Mattias Persson schrieb:
 After playing with it more, the culprit seems to be not the symbolic
 link but the local drive :-/ When I delete the neo4j directory with the
 db and start the application from the local drive then I'm getting the
 NPEs - even if I shut the server down and start it again. When I delete
 the neo directory and start jboss from the directory on the nfs drive
 then it works fine, without NPEs. When I then start the application from
 the local drive again (without deleting the neo dir) then it again works
 fine, without NPEs.
 I have no idea why this is happening.. I verified that the index service
 is being initialized in the same thread that uses it later when the
 exception occurs so it shouldn't be a problem with some asynchronicity
 introduced by JBoss.


 That is quite strange. I've never come across a problem like this and
 we don't have automated tests for situations like these. Could you
 perhaps provide me with the stacktrace you get? That would be very
 helpful.

 Sorry, I forgot to include the stack trace but it seems to be the same
 as the original one I was getting with the new lucene and neo for the
 older lucene.

 Here it is:

 Caused by: java.lang.NullPointerException
        at
 org.neo4j.util.index.LuceneDataSource.getIndexSearcher(LuceneDataSource.java:301)
        at
 org.neo4j.util.index.LuceneIndexService.getNodes(LuceneIndexService.java:143)
        at
 org.neo4j.util.index.LuceneIndexService.getSingleNode(LuceneIndexService.java:242)
        at
 kiwi.service.reasoning.reasonmaintenance.ReasonMaintenanceServiceImpl.addJustification(ReasonMaintenanceServiceImpl.java:55)

 The full stack trace is attached.

 The best thing is to use the index-util-0.9-SNAPSHOT and
 neo-1.0-b11-SNAPSHOT versions (i.e. the latest of both those
 components).
 So simply the latest from
 http://m2.neo4j.org/org/neo4j/index-util/0.9-SNAPSHOT/ and the
 respective directory for neo.
 Sorry, I'm not used to Maven much.

 Jakub


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


 11:26:24,415 INFO  [NeoFactory] Neo4j initialized on path /tmp/kiwi/neo4j
 11:26:24,418 INFO  [NeoIndexServiceFactory] Initializing Neo4j's Lucene index 
 service ...
 11:26:24,469 INFO  [NeoIndexServiceFactory] Neo4js Lucene index service 
 initialized.Thread[DefaultQuartzScheduler_Worker-6,5,jboss]
 11:26:24,469 DEBUG [ReasonMaintenanceServiceImpl] Adding justification 
 IN(229381)RULE(-2079806943)FACT(229391) 
 Thread[DefaultQuartzScheduler_Worker-6,5,jboss]
 11:26:24,506 ERROR [TxPolicy] IllegalStateException while setting transaction 
 for rollback only
 java.lang.IllegalStateException: 
 [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] 
 [com.arjuna.ats.internal.jta.transaction.arjunacore.inactive] The transaction 
 is not active!
        at 
 com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.setRollbackOnly(TransactionImple.java:380)
        at org.jboss.aspects.tx.TxPolicy.setRollbackOnly(TxPolicy.java:212)
        at 
 org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:81)
        at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
        at 
 org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
        at 
 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
 org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
        at 
 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
 org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
        at 
 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
 org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
        at 
 org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
        at 
 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
 org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
        at 
 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
 org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
        at 
 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
        at 
 org.jboss.ejb3

Re: [Neo] Relationship Design Question

2009-11-20 Thread Mattias Persson
The names IS_PARENT and IS_SON doesn't really explain which direction
it is, right? A better naming would be IS_PARENT_OF or IS_SON_OF. Then
you would immediately see which direction they have. But if you choose
to go with the father or son naming is up to you, whatever feels more
natural.

2009/11/19 Anders Nawroth and...@neotechnology.com:
 Hi and welcome Matt!

 What is the best way to design this type of relationship? What direction is
 best to use?


 The one that makes the most sense to you in your code, I think! Or
 rather: how would you draw this on a whiteboard when explaining the
 application domain to someone?! In my case I'd go with HAS_CHILD
 relationships as this direction feels more natural to me.

 There's no need to add relationships twice to cover the directions, as
 Neo4j can traverse both incoming and outgoing relationships or simply
 ignore their direction (that is use Direction.BOTH or leave the
 direction unspecified).

 I noticed in the matrix example, relationships point from Neo to the other
 characters.

 Even if Neo4j relationships always have a start node and an end node
 (and a direction) it's up to the application to decide what semantics
 goes with this. In the Matrix example the KNOWS relationship likely
 should count as undirected, as someone you know also knows you. The
 CODED_BY relationship is different, as the direction of it is really
 significant.

  Is there also a relationship from the reference node to Neo, or
 does Neo point to the reference node?


 There are different variations of this example, both with and without a
 relationship from the reference node to the Thomas Andersson/Neo node.
 This one has such a relationship:
 http://wiki.neo4j.org/content/The_Matrix

 For real applications it often a good idea to add a few nodes that are
 used as subreference nodes - have a look here:
 http://wiki.neo4j.org/content/Design_Guide#Organizing_your_Nodespace


 /anders


 --
 Anders Nawroth [and...@neotechnology.com]
 GTalk, Skype: anders.nawroth
 Phone: +46 737 894 163
 http://twitter.com/nawroth
 http://blog.nawroth.com/

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




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


Re: [Neo] Persistance of nodeID

2009-11-20 Thread Mattias Persson
The best way to achieve that is to create relationships to those
nodes... such as

ReferenceNode --[CONFIGURATION]-- ConfigurationNode
ReferenceNode --[INDEX]-- IndexNode
a.s.o.

That's more of a neo-style-approach. The node ids persist over time
until they are deleted and deleted ids may be reused in the future.

2009/11/20 Laurent Laborde kerdez...@gmail.com:
 Friendly greetings !

 I'm a new user and... not a  coder. I'm sysadmin  Postgresql DBA at
 http://www.over-blog.com/

 I'm confused about the documentation.
 I'm not 100% sure that a nodeID persist over time, restart, update.
 Can you tell me please ?

 I'd like to store in the referenceNode some information like :
 - MyConfigurationNode : NodeID
 - MyIndexNode : NodeID
 - LastUpdatedNode : NodeID
 - SequenceStoreNode : NodeID
 - etc ...

 And to be able to retrieve some various custom information at startup,
 easily, just by reading the referenceNode.
 Will it work ?

 Thank you

 --
 ker2x
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Persistance of nodeID

2009-11-20 Thread Mattias Persson
2009/11/20 Mattias Persson matt...@neotechnology.com:
 The best way to achieve that is to create relationships to those
 nodes... such as

 ReferenceNode --[CONFIGURATION]-- ConfigurationNode
 ReferenceNode --[INDEX]-- IndexNode
 a.s.o.

 That's more of a neo-style-approach. The node ids persist over time
 until they are deleted and deleted ids may be reused in the future.
And I should add: so therefore it's not a good idea to store node ids
as properties, in any such case use a relationship instead.

 2009/11/20 Laurent Laborde kerdez...@gmail.com:
 Friendly greetings !

 I'm a new user and... not a  coder. I'm sysadmin  Postgresql DBA at
 http://www.over-blog.com/

 I'm confused about the documentation.
 I'm not 100% sure that a nodeID persist over time, restart, update.
 Can you tell me please ?

 I'd like to store in the referenceNode some information like :
 - MyConfigurationNode : NodeID
 - MyIndexNode : NodeID
 - LastUpdatedNode : NodeID
 - SequenceStoreNode : NodeID
 - etc ...

 And to be able to retrieve some various custom information at startup,
 easily, just by reading the referenceNode.
 Will it work ?

 Thank you

 --
 ker2x
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com




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


Re: [Neo] Persistance of nodeID

2009-11-20 Thread Mattias Persson
2009/11/20 Laurent Laborde kerdez...@gmail.com:
 On Fri, Nov 20, 2009 at 12:19 PM, Mattias Persson
 matt...@neotechnology.com wrote:
 2009/11/20 Mattias Persson matt...@neotechnology.com:
 The best way to achieve that is to create relationships to those
 nodes... such as

 ReferenceNode --[CONFIGURATION]-- ConfigurationNode
 ReferenceNode --[INDEX]-- IndexNode
 a.s.o.

 That's more of a neo-style-approach. The node ids persist over time
 until they are deleted and deleted ids may be reused in the future.
 And I should add: so therefore it's not a good idea to store node ids
 as properties, in any such case use a relationship instead.

 Ok thank you.
 So, when i run my app :
 - I check if the referenceNode have a relationship of type
 configuration, index, whatever i want. (traverser depth_one ?)
 - if yes, i can retrieve all the info i need on thoses various node.
 - if no : i create one of my system node. create a relationtype
 according type from referencenode to my new systeme node
 - and, finally : i do whatever i want with thoses new nodes :)
That's right, there's such a utility in the neo-utils component
http://components.neo4j.org/neo-utils/ where you do something like:

NeoUtil neoUtil = new NeoUtil( neo );
Node configurationNode = neoUtil.getOrCreateSubreferenceNode(
MyRelTypes.CONFIGURATION );


 The question is : isn't it much more simple to just store nodeID ? :)

The algorithm would still be the same woldn't it?

o Check to see if we have a configuration node (be it checking a
property or a relationship, see
http://api.neo4j.org/current/org/neo4j/api/core/Node.html#getSingleRelationship(org.neo4j.api.core.RelationshipType,%20org.neo4j.api.core.Direction))
o If not found then create a node
o If we created a node then connect it with the reference node (be it
via property or createRelationship)

And as we mentioned earlier it's not a good practice to rely on node IDs.


 --
 Ker2x
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Persistance of nodeID

2009-11-20 Thread Mattias Persson
2009/11/20 Laurent Laborde kerdez...@gmail.com:
 Mmmm ... and if i want to store the, eg, latest updated node before
 clean shutdown ?
 I create a relationship to_latest_updated_node from referenceNode to
 this Node before shutting down ?
Sure, that'd be good for that as well.

 --
 Ker2x


 On Fri, Nov 20, 2009 at 12:19 PM, Mattias Persson
 matt...@neotechnology.com wrote:
 2009/11/20 Mattias Persson matt...@neotechnology.com:
 The best way to achieve that is to create relationships to those
 nodes... such as

 ReferenceNode --[CONFIGURATION]-- ConfigurationNode
 ReferenceNode --[INDEX]-- IndexNode
 a.s.o.

 That's more of a neo-style-approach. The node ids persist over time
 until they are deleted and deleted ids may be reused in the future.
 And I should add: so therefore it's not a good idea to store node ids
 as properties, in any such case use a relationship instead.

 2009/11/20 Laurent Laborde kerdez...@gmail.com:
 Friendly greetings !

 I'm a new user and... not a  coder. I'm sysadmin  Postgresql DBA at
 http://www.over-blog.com/

 I'm confused about the documentation.
 I'm not 100% sure that a nodeID persist over time, restart, update.
 Can you tell me please ?

 I'd like to store in the referenceNode some information like :
 - MyConfigurationNode : NodeID
 - MyIndexNode : NodeID
 - LastUpdatedNode : NodeID
 - SequenceStoreNode : NodeID
 - etc ...

 And to be able to retrieve some various custom information at startup,
 easily, just by reading the referenceNode.
 Will it work ?

 Thank you

 --
 ker2x
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com




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




 --
 F4FQM
 Kerunix Flan
 Laurent Laborde
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Persistance of nodeID

2009-11-20 Thread Mattias Persson
Great, I'd be glad to answer more questions as they come along... and
enjoy your lunch!

Best,
Mattias

2009/11/20 Laurent Laborde kerdez...@gmail.com:
 Thank you for your very fast replies.
 I will have more question, soon.
 But it's time to eat and i'll have some code to do before jumping to
 the next problem.

 --
 Ker2x
 sysadmin  DBA @ http://www.over-blog.com/
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Confused about version and documention

2009-11-21 Thread Mattias Persson
You should however use the IndexService interface when using indexing
in neo4j. (Best implementations is probably
org.neo4j.util.index.LuceneIndexService, which uses lucene
http://lucene.apache.org/ as the name tells you)

2009/11/20 Laurent Laborde kerdez...@gmail.com:
 On Fri, Nov 20, 2009 at 5:26 PM, Tobias Ivarsson
 tobias.ivars...@neotechnology.com wrote:
 Hi,

 These are flaws in the documentation, great that you point them out.

 1. It probably should not say re-create an already existing index, but
 rather restore an already existing index,
  The old index will not be removed, it will rather be loaded again from the
 index-tree in the graph.

 Indeed ! Thank you for the details :)

 2. You are correct in that when passing null as the name of the index an
 IllegalArgumentException will be thrown,
  We should remove the part in the documentation that states that you can
 pass null for the name.

 :))

 I will update the documentation, it will take a short while before it makes
 it out to the servers.

 Cheers,

 *hugs*

 --
 ker2x
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Missing views and options in Neoclipse

2009-11-23 Thread Mattias Persson
That might be from the apoc examples. They create an example node
space just to have something in there to play around with (recently
added some KNOWS relationships as well).

Maybe your problem is related to that you have the depth setting set
to 1 or something (I think that's the default). If you increase it (+
and - buttons in the toolbarat the top) you'll see more of the graph.

About the view: I think the relationship type view is on by default,
but maybe you could open it in some Views menu?

2009/11/23 Eddy Respondek eddy.respon...@gmail.com:
 I recently installed the Neoclipse plugin for Eclipse (version Galileo on
 Mac OS X). At first it didn't work at all until after a full restart of the
 computer. I now have the Neo4j perspective with Graph and Properties view
 working. However I don't have Relationship Types view and I don't have the
 options as shown in this image
 http://wiki.neo4j.org/content/Image:Neoclipse.properties.types.png as
 described in the Neoclipse Guide (
 http://wiki.neo4j.org/content/Neoclipse_Guide).

 Does anybody why this might be?

 Also, I haven't read all the docs yet and don't understand exactly whats
 going on but what is this first users graph that appears? There are 102
 nodes with property username and value user...@neo4j.org

 Thanks
 Eddy

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





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


Re: [Neo] LuceneIndexBatchInserter doubt

2009-12-04 Thread Mattias Persson
I think I found the problem... it's indexing as it should, but it
isn't reflected in getNodes/getSingleNode properly until you
flush/optimize/shutdown the index. I'll try to fix it today!

2009/12/3 Núria Trench nuriatre...@gmail.com:
 Thank you very much for your response.
 If you need more information, you only have to send an e-mail and I will try
 to explain it better.

 Núria.

 2009/12/3 Mattias Persson matt...@neotechnology.com

 This is something I'd like to reproduce and I'll do some testing on
 this tomorrow

 2009/12/3 Núria Trench nuriatre...@gmail.com:
  Hello,
 
  Last week, I decided to download your graph database core in order to use
  it. First, I created a new project to parse my CSV files and create a new
  graph database with Neo4j. This CSV files contain 150 milion edges and 20
  milion nodes.
 
  When I finished to write the code which will create the graph database, I
  executed it and, after six hours of execution, the program crashes
 because
  of a Lucene exception. The exception is related to the index merging and
 it
  has the following message:
  mergeFields produced an invalid result: docCount is 385282378 but fdx
 file
  size is 3082259028; now aborting this merge to prevent index corruption
 
  I have searched on the net and I found that it is a lucene bug. The
  libraries used for executing my project were:
  neo-1.0-b10
  index-util-0.7
  lucene-core-2.4.0
 
  So, I decided to use a newer Lucene version. I found that you have a
 newer
  index-util version so I updated the libraries:
  neo-1.0-b10
  index-util-0.9
  lucene-core-2.9.1
 
  When I had updated those libraries, I tried to execute my project again
 and
  I found that, in many occassions, it was not indexing properly. So, I
 tried
  to optimize the index after every time I indexed something. This was a
  solution because, after that, it was indexing properly but the time
  execution increased a lot.
 
  I am not using transactions, instead of this, I am using the Batch
 Inserter
  with the LuceneIndexBatchInserter.
 
  So, my question is: What can I do to solve this problem? If use
  index-util-0.7 I cannot finish the execution of creating the graph
 database
  and I use index-util-0.9 I have to optimize the index in every insertion
 and
  the execution never ever ends.
 
  Thank you very much in advance,
 
  Núria.
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 



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

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




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


Re: [Neo] Maven Dependency For Neo Util for Lucene BatchInserter?

2009-12-04 Thread Mattias Persson
2009/12/4 Todd Stavish toddstav...@gmail.com:
 I am using the Lucene Batch Inserter with attributes that have a space
 (combined first name and last name).

 Exception in thread main java.lang.NoSuchMethodError:
 org.neo4j.impl.util.FileUtils.fixSeparatorsInPath(Ljava/lang/String;)Ljava/lang/String;
        at 
 org.neo4j.util.index.LuceneIndexBatchInserterImpl.fixPath(LuceneIndexBatchInserterImpl.java:61)
        at 
 org.neo4j.util.index.LuceneIndexBatchInserterImpl.init(LuceneIndexBatchInserterImpl.java:51)
        at com.cisco.collectiveintelligence.QueryNeo.addData(QueryNeo.java:135)
        at com.cisco.collectiveintelligence.QueryNeo.main(QueryNeo.java:43)

 I tried the obvious:

 dependency
        groupIdorg.neo4j/groupId
        artifactIdutil/artifactId
Try 'neo-utils' instead
        version1.0-b9/version
 /dependency

 Anyone know where I can find this?

 Thanks,
 Todd
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] LuceneIndexBatchInserter doubt

2009-12-07 Thread Mattias Persson
Todd, are you sure you have the latest index-util 0.9-SNAPSHOT? This
is a bug that we fixed yesterday... (assuming it's the same bug).

2009/12/7 Todd Stavish toddstav...@gmail.com:
 Hi Mattias, Núria.

 I am also running into scalability problems with the Lucene batch
 inserter at much smaller numbers, 30,000 indexed nodes. I tried
 calling optimize more. Increasing ulimit didn't help.

 INFO] Exception in thread main java.lang.RuntimeException:
 java.io.FileNotFoundException:
 /Users/todd/Code/neo4Jprototype/target/classes/data/graph/lucene/name/_0.cfx
 (Too many open files)
 [INFO]  at 
 org.neo4j.util.index.LuceneIndexBatchInserterImpl.getNodes(LuceneIndexBatchInserterImpl.java:186)
 [INFO]  at 
 org.neo4j.util.index.LuceneIndexBatchInserterImpl.getSingleNode(LuceneIndexBatchInserterImpl.java:238)
 [INFO]  at 
 com.collectiveintelligence.QueryNeo.loadDataToGraph(QueryNeo.java:277)
 [INFO]  at com.collectiveintelligence.QueryNeo.main(QueryNeo.java:57)
 [INFO] Caused by: java.io.FileNotFoundException:
 /Users/todd/Code/neo4Jprototype/target/classes/data/graph/lucene/name/_0.cfx
 (Too many open files)

 I tried breaking up to separate batchinserter instances, and it hangs
 now. Can I create more than one batch inserter per process if they run
 sequentially and non-threaded?

 Thanks,
 Todd





 On Mon, Dec 7, 2009 at 7:28 AM, Núria Trench nuriatre...@gmail.com wrote:
 Hi again Mattias,

 I have tried to execute my application with the last version available in
 the maven repository and I still have the same problem. After creating and
 indexing all the nodes, the application calls the optimize method and,
 then, it creates all the edges by calling the method getNodes in order to
 select the tail and head node of the edge, but it doesn't work because many
 nodes are not found.

 I have tried to create only 30 nodes and 15 edges and it works properly, but
 if I try to create a big graph (180 million edges + 20 million nodes) it
 doesn't.

 I have also tried to call the optimize method every time the application
 has been created 1 million nodes but it doesn't work.

 Have you tried to create as many nodes as I have said with the newer
 index-util version?

 Thank you,

 Núria.

 2009/12/4 Núria Trench nuriatre...@gmail.com

 Hi Mattias,

 Thank you very much for fixing the problem so fast. I will try it as soon
 as the new changes will be available in the maven repository.

 Núria.


 2009/12/4 Mattias Persson matt...@neotechnology.com

 I fixed the problem and also added a cache per key for faster
 getNodes/getSingleNode lookup during the insert process. However the
 cache assumes that there's nothing in the index when the process
 starts (which almost always will be true) to speed things up even
 further.

 You can control the cache size and if it should be used by overriding
 the (this is also documented in the Javadoc):

 boolean useCache()
 int getMaxCacheSizePerKey()

 methods in your LuceneIndexBatchInserterImpl instance. The new changes
 should be available in the maven repository within an hour.

 2009/12/4 Mattias Persson matt...@neotechnology.com:
  I think I found the problem... it's indexing as it should, but it
  isn't reflected in getNodes/getSingleNode properly until you
  flush/optimize/shutdown the index. I'll try to fix it today!
 
  2009/12/3 Núria Trench nuriatre...@gmail.com:
  Thank you very much for your response.
  If you need more information, you only have to send an e-mail and I
 will try
  to explain it better.
 
  Núria.
 
  2009/12/3 Mattias Persson matt...@neotechnology.com
 
  This is something I'd like to reproduce and I'll do some testing on
  this tomorrow
 
  2009/12/3 Núria Trench nuriatre...@gmail.com:
   Hello,
  
   Last week, I decided to download your graph database core in order
 to use
   it. First, I created a new project to parse my CSV files and create
 a new
   graph database with Neo4j. This CSV files contain 150 milion edges
 and 20
   milion nodes.
  
   When I finished to write the code which will create the graph
 database, I
   executed it and, after six hours of execution, the program crashes
  because
   of a Lucene exception. The exception is related to the index merging
 and
  it
   has the following message:
   mergeFields produced an invalid result: docCount is 385282378 but
 fdx
  file
   size is 3082259028; now aborting this merge to prevent index
 corruption
  
   I have searched on the net and I found that it is a lucene bug. The
   libraries used for executing my project were:
   neo-1.0-b10
   index-util-0.7
   lucene-core-2.4.0
  
   So, I decided to use a newer Lucene version. I found that you have a
  newer
   index-util version so I updated the libraries:
   neo-1.0-b10
   index-util-0.9
   lucene-core-2.9.1
  
   When I had updated those libraries, I tried to execute my project
 again
  and
   I found that, in many occassions, it was not indexing properly. So,
 I
  tried
   to optimize the index after every time I indexed something

Re: [Neo] LuceneIndexBatchInserter doubt

2009-12-09 Thread Mattias Persson
Hi again, Núria (it was I, Mattias who asked for the sample code).
Well... the fact that you parse 4 csv files doesn't really help me
setup a test for this... I mean how can I know that my test will be
similar to yours? Would it be ok to attach your code/csv files as
well?

/ Mattias

2009/12/9 Núria Trench nuriatre...@gmail.com:
 Hi Todd,

 The sample code creates nodes and relationships by parsing 4 csv files.
 Thank you for trying to trigger this behaviour with this sample.

 Núria

 2009/12/9 Mattias Persson matt...@neotechnology.com

 Could you provide me with some sample code which can trigger this
 behaviour with the latest index-util-0.9-SNAPSHOT Núria?

 2009/12/9 Núria Trench nuriatre...@gmail.com:
  Todd,
 
  I haven't the same problem. In my case, after indexing all the
  attributes/properties of each node, the application creates all the edges
 by
  looking up the tail node and the head node. So, it calls the method
  org.neo4j.util.index.
  LuceneIndexBatchInserterImpl.getSingleNode which returns -1 (no found
 node)
  in many occasions.
 
  Any one has an alternative to get a node with indexex
 attributes/properties?
 
  Thank you,
 
  Núria.
 
 
  2009/12/7 Mattias Persson matt...@neotechnology.com
 
  Todd, are you sure you have the latest index-util 0.9-SNAPSHOT? This
  is a bug that we fixed yesterday... (assuming it's the same bug).
 
  2009/12/7 Todd Stavish toddstav...@gmail.com:
   Hi Mattias, Núria.
  
   I am also running into scalability problems with the Lucene batch
   inserter at much smaller numbers, 30,000 indexed nodes. I tried
   calling optimize more. Increasing ulimit didn't help.
  
   INFO] Exception in thread main java.lang.RuntimeException:
   java.io.FileNotFoundException:
  
 
 /Users/todd/Code/neo4Jprototype/target/classes/data/graph/lucene/name/_0.cfx
   (Too many open files)
   [INFO]  at
 
 org.neo4j.util.index.LuceneIndexBatchInserterImpl.getNodes(LuceneIndexBatchInserterImpl.java:186)
   [INFO]  at
 
 org.neo4j.util.index.LuceneIndexBatchInserterImpl.getSingleNode(LuceneIndexBatchInserterImpl.java:238)
   [INFO]  at
  com.collectiveintelligence.QueryNeo.loadDataToGraph(QueryNeo.java:277)
   [INFO]  at com.collectiveintelligence.QueryNeo.main(QueryNeo.java:57)
   [INFO] Caused by: java.io.FileNotFoundException:
  
 
 /Users/todd/Code/neo4Jprototype/target/classes/data/graph/lucene/name/_0.cfx
   (Too many open files)
  
   I tried breaking up to separate batchinserter instances, and it hangs
   now. Can I create more than one batch inserter per process if they run
   sequentially and non-threaded?
  
   Thanks,
   Todd
  
  
  
  
  
   On Mon, Dec 7, 2009 at 7:28 AM, Núria Trench nuriatre...@gmail.com
  wrote:
   Hi again Mattias,
  
   I have tried to execute my application with the last version
 available
  in
   the maven repository and I still have the same problem. After
 creating
  and
   indexing all the nodes, the application calls the optimize method
 and,
   then, it creates all the edges by calling the method getNodes in
 order
  to
   select the tail and head node of the edge, but it doesn't work
 because
  many
   nodes are not found.
  
   I have tried to create only 30 nodes and 15 edges and it works
 properly,
  but
   if I try to create a big graph (180 million edges + 20 million nodes)
 it
   doesn't.
  
   I have also tried to call the optimize method every time the
  application
   has been created 1 million nodes but it doesn't work.
  
   Have you tried to create as many nodes as I have said with the newer
   index-util version?
  
   Thank you,
  
   Núria.
  
   2009/12/4 Núria Trench nuriatre...@gmail.com
  
   Hi Mattias,
  
   Thank you very much for fixing the problem so fast. I will try it as
  soon
   as the new changes will be available in the maven repository.
  
   Núria.
  
  
   2009/12/4 Mattias Persson matt...@neotechnology.com
  
   I fixed the problem and also added a cache per key for faster
   getNodes/getSingleNode lookup during the insert process. However
 the
   cache assumes that there's nothing in the index when the process
   starts (which almost always will be true) to speed things up even
   further.
  
   You can control the cache size and if it should be used by
 overriding
   the (this is also documented in the Javadoc):
  
   boolean useCache()
   int getMaxCacheSizePerKey()
  
   methods in your LuceneIndexBatchInserterImpl instance. The new
 changes
   should be available in the maven repository within an hour.
  
   2009/12/4 Mattias Persson matt...@neotechnology.com:
I think I found the problem... it's indexing as it should, but it
isn't reflected in getNodes/getSingleNode properly until you
flush/optimize/shutdown the index. I'll try to fix it today!
   
2009/12/3 Núria Trench nuriatre...@gmail.com:
Thank you very much for your response.
If you need more information, you only have to send an e-mail
 and I
   will try
to explain it better.
   
Núria.
   
2009/12/3

Re: [Neo] LuceneIndexBatchInserter doubt

2009-12-09 Thread Mattias Persson
Oh ok, It could be our attachments filter / security or something...
could you try to mail them to me directly at matt...@neotechnology.com
?

2009/12/9 Núria Trench nuriatre...@gmail.com:
 Hi Mattias,

 In my last e-mail I have attached the sample code, haven't you received it?
 I will try to attach it again.

 Núria.

 2009/12/9 Mattias Persson matt...@neotechnology.com

 Hi again, Núria (it was I, Mattias who asked for the sample code).
 Well... the fact that you parse 4 csv files doesn't really help me
 setup a test for this... I mean how can I know that my test will be
 similar to yours? Would it be ok to attach your code/csv files as
 well?

 / Mattias

 2009/12/9 Núria Trench nuriatre...@gmail.com:
  Hi Todd,
 
  The sample code creates nodes and relationships by parsing 4 csv files.
  Thank you for trying to trigger this behaviour with this sample.
 
  Núria
 
  2009/12/9 Mattias Persson matt...@neotechnology.com
 
  Could you provide me with some sample code which can trigger this
  behaviour with the latest index-util-0.9-SNAPSHOT Núria?
 
  2009/12/9 Núria Trench nuriatre...@gmail.com:
   Todd,
  
   I haven't the same problem. In my case, after indexing all the
   attributes/properties of each node, the application creates all the
 edges
  by
   looking up the tail node and the head node. So, it calls the method
   org.neo4j.util.index.
   LuceneIndexBatchInserterImpl.getSingleNode which returns -1 (no found
  node)
   in many occasions.
  
   Any one has an alternative to get a node with indexex
  attributes/properties?
  
   Thank you,
  
   Núria.
  
  
   2009/12/7 Mattias Persson matt...@neotechnology.com
  
   Todd, are you sure you have the latest index-util 0.9-SNAPSHOT? This
   is a bug that we fixed yesterday... (assuming it's the same bug).
  
   2009/12/7 Todd Stavish toddstav...@gmail.com:
Hi Mattias, Núria.
   
I am also running into scalability problems with the Lucene batch
inserter at much smaller numbers, 30,000 indexed nodes. I tried
calling optimize more. Increasing ulimit didn't help.
   
INFO] Exception in thread main java.lang.RuntimeException:
java.io.FileNotFoundException:
   
  
 
 /Users/todd/Code/neo4Jprototype/target/classes/data/graph/lucene/name/_0.cfx
(Too many open files)
[INFO]  at
  
 
 org.neo4j.util.index.LuceneIndexBatchInserterImpl.getNodes(LuceneIndexBatchInserterImpl.java:186)
[INFO]  at
  
 
 org.neo4j.util.index.LuceneIndexBatchInserterImpl.getSingleNode(LuceneIndexBatchInserterImpl.java:238)
[INFO]  at
  
 com.collectiveintelligence.QueryNeo.loadDataToGraph(QueryNeo.java:277)
[INFO]  at
 com.collectiveintelligence.QueryNeo.main(QueryNeo.java:57)
[INFO] Caused by: java.io.FileNotFoundException:
   
  
 
 /Users/todd/Code/neo4Jprototype/target/classes/data/graph/lucene/name/_0.cfx
(Too many open files)
   
I tried breaking up to separate batchinserter instances, and it
 hangs
now. Can I create more than one batch inserter per process if they
 run
sequentially and non-threaded?
   
Thanks,
Todd
   
   
   
   
   
On Mon, Dec 7, 2009 at 7:28 AM, Núria Trench 
 nuriatre...@gmail.com
   wrote:
Hi again Mattias,
   
I have tried to execute my application with the last version
  available
   in
the maven repository and I still have the same problem. After
  creating
   and
indexing all the nodes, the application calls the optimize
 method
  and,
then, it creates all the edges by calling the method getNodes in
  order
   to
select the tail and head node of the edge, but it doesn't work
  because
   many
nodes are not found.
   
I have tried to create only 30 nodes and 15 edges and it works
  properly,
   but
if I try to create a big graph (180 million edges + 20 million
 nodes)
  it
doesn't.
   
I have also tried to call the optimize method every time the
   application
has been created 1 million nodes but it doesn't work.
   
Have you tried to create as many nodes as I have said with the
 newer
index-util version?
   
Thank you,
   
Núria.
   
2009/12/4 Núria Trench nuriatre...@gmail.com
   
Hi Mattias,
   
Thank you very much for fixing the problem so fast. I will try it
 as
   soon
as the new changes will be available in the maven repository.
   
Núria.
   
   
2009/12/4 Mattias Persson matt...@neotechnology.com
   
I fixed the problem and also added a cache per key for faster
getNodes/getSingleNode lookup during the insert process. However
  the
cache assumes that there's nothing in the index when the process
starts (which almost always will be true) to speed things up
 even
further.
   
You can control the cache size and if it should be used by
  overriding
the (this is also documented in the Javadoc):
   
boolean useCache()
int getMaxCacheSizePerKey()
   
methods in your LuceneIndexBatchInserterImpl instance. The new
  changes
should be available

Re: [Neo] LuceneIndexBatchInserter doubt

2009-12-10 Thread Mattias Persson
To continue this thread in the user list:

Thanks Núria, I've gotten your samples code/files and I'm running it
now to try to reproduce you problem.

2009/12/9 Núria Trench nuriatre...@gmail.com:
 I have finished uploading the 4 csv files. You'll see an e-mail with the
 other 3 csv files packed in a rar file.
 Thanks,

 Núria.

 2009/12/9 Núria Trench nuriatre...@gmail.com

 Yes, you are right. But there is one csv file that is too big to be packed
 with other files and I am reducing it.
 I am sending the other files now.

 2009/12/9 Mattias Persson matt...@neotechnology.com

 By the way, you might consider packing those files (with zip or tar.gz
 or something) cause they will shrink quite well

 2009/12/9 Mattias Persson matt...@neotechnology.com:
  Great, but I only got the images.csv file... I'm starting to test with
  that at least
 
  2009/12/9 Núria Trench nuriatre...@gmail.com:
  Hi again,
 
  The errors show up after being parsed 2 csv files to create all the
  nodes,
  just in the moment of calling the method getSingleNode for looking
  up the
  tail and head node for creating all the edges by reading the other two
  csv
  files.
 
  I am sending with Sprend the four csv files that will help you to
  trigger
  index behaviour.
 
  Thank you,
 
  Núria.
 
  2009/12/9 Mattias Persson matt...@neotechnology.com
 
  Hmm, I've no idea... but does the errors show up early in the process
  or do you have to insert a LOT of data to trigger it? In such case
  you
  could send me a part of them... maybe using http://www.sprend.se ,
  WDYT?
 
  2009/12/9 Núria Trench nuriatre...@gmail.com:
   Hi Mattias,
  
   The data isn't confident but the files are very big (5,5 GB).
   How can I send you this data?
  
   2009/12/9 Mattias Persson matt...@neotechnology.com
  
   Yep I got the java code, thanks. Yeah if the data is confident or
   sensitive you can just send me the formatting, else consider
   sending
   the files as well (or a subset if they are big).
  
   2009/12/9 Núria Trench nuriatre...@gmail.com:
   
   
  
  
  
   --
   Mattias Persson, [matt...@neotechnology.com]
   Neo Technology, www.neotechnology.com
  
  
 
 
 
  --
  Mattias Persson, [matt...@neotechnology.com]
  Neo Technology, www.neotechnology.com
 
 
 
 
 
  --
  Mattias Persson, [matt...@neotechnology.com]
  Neo Technology, www.neotechnology.com
 



 --
 Mattias Persson, [matt...@neotechnology.com]
 Neo Technology, www.neotechnology.com






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


Re: [Neo] SingleValueIndex org.neo4j.api.core.NotFoundException: More than one relationship

2009-12-11 Thread Mattias Persson
Hi Arin,

Maye we should document this more, but you shouldn't use that class.
Instead, take a look at the LuceneIndexService and see how that works
out for you.

2009/12/10 Arin Sarkissian a...@rspot.net:
 Hey guys,

 I'm pretty new to Neo4j, especially the indexing stuff.

 Here's my situation. I want to be able to get nodes via one of their
 properties; in this case let's say the Nodes represent a user  I want
 to be able to grab a User's node via their username.

 So, my initial attempt may be naive (no batching etc) but I've been
 reading thru a a large text file (CSV format: username, userid),
 creating a node for each of these lines  indexing the username
 component.

 Now this needs to be unique (given that usernames are unique) so I've
 been using the SingleValueIndex and have run into a problem: It looks
 like the SingleValueIndex actually does allow multiple values for a
 given lookup (ex: username = phatduckk) however when trying to fetch a
 Node from the index that has multiples (ie: username=phatduckk was
 indexed twice) I get a NotFoundException with More than one
 relationship  as the message.

 I have posted a skeleton piece of code that surfaces this problem over
 at: http://gist.github.com/253553
 This code does not make sure that the Node being indexed for a key is
 always the same - it actually does the opposite: it tries to index
 username=phatduckk w/ a different node each time.

 The bit of code at http://gist.github.com/253569 does the opposite: i
 tries to index the same node for the index username=phatduckk each
 time.

 I also have a few random questions sprinkled in the code as comments
 which illustrate my noobiness =)

 Honestly, I'm not claiming this is a bug - I may be completely
 misusing and misunderstanding the indexing functionality but with my
 limited experience it doesn't seem that SingleValueIndex is single
 at all (hopefully - i'm just wrong and made a dumb mistake).

 Thanks for the help guys,
 Arin
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo] Counting nodes

2009-12-11 Thread Mattias Persson
I saw this old thread and could just fill in with more information.

So, the IndexService.getNodes() now returns an IndexHits result, which
is an Iterable with a size() method on it. The size is given back from
lucene so there's no overhead in calling size() at all.

The LuceneIndexService will create a new document for each call to
LuceneIndexService.index() method. This is because it'd be quite slow
to try to merge with potential existing matches a.s.o.

2009/9/18 Andreas Kollegger akolleg...@tembopublic.org:
 For my use cases at least, total node counts are needed so often that
 I'd love the optimized version. What's the relationship between
 number of documents and nodes? Would that be all indexed nodes
 regardless of the key?

 On Sep 18, 2009, at 3:46 AM, Mattias Persson wrote:

 Looking at the Lucene javadocs I can see that you can ask an index
 (IndexReader) the number of documents there are in it and it'd be
 simple to expose a size() method in the IndexService interface or
 perhaps on the LuceneIndexService class...

 Would that be something worth/good to implement?

 2009/9/18 Andreas Guenther andreas.guent...@web.de:
 actually, disregard my suggestion as I didn't read the word index
 in your question before.

 -AndreasAndreas Guenther wrote:

 The service API has a getAllNodes() call. Iterate and count through
 it.



 -AndreasAndreas Kollegger wrote:



 Hi all,







 For nodes that are kept in the indexed service, is there a more
 clever



 (and hopefully efficient) way to get the node count than manually



 iterating over all the nodes in the index and actually counting. I



 don't see anything obvious in the IndexService() interface, and am
 not



 sure if I've overlooked something useful somewhere else.







 I suppose I could always keep a running tally somewhere, but then I'd



 have to be careful to keep it in sync with reality. Ideally the count



 would be closer to the metal.







 Thanks,



 Andreas



 ___



 Neo mailing list



 User@lists.neo4j.org



 https://lists.neo4j.org/mailman/listinfo/user





 ___

 Neo mailing list

 User@lists.neo4j.org

 https://lists.neo4j.org/mailman/listinfo/user


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




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

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




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


Re: [Neo] LuceneIndexBatchInserter doubt

2009-12-11 Thread Mattias Persson
I've tried this a couple of times now and first of all I see some
problems in your code:

1) In the method createRelationsTitleImage you have an inverted head
!= -1 check where it should be head == -1

2) You index relationships in createRelationsBetweenTitles method,
this isn't ok since the index can only manage nodes.

And I recently committed a fix which removed the caching layer in
the LuceneIndexBatchInserterImpl (and therefore also
LuceneFulltextIndexBatchInserter). This probably fixes your problems.
I'm also working on a performance fix which makes consecutive getNodes
calls faster.

So I think that with these fixes (1) and (2) and the latest index-util
0.9-SNAPSHOT your sample will run fine. Also you could try without
calling optimize. See more information at
http://wiki.neo4j.org/content/Indexing_with_BatchInserter

2009/12/10 Mattias Persson matt...@neotechnology.com:
 To continue this thread in the user list:

 Thanks Núria, I've gotten your samples code/files and I'm running it
 now to try to reproduce you problem.

 2009/12/9 Núria Trench nuriatre...@gmail.com:
 I have finished uploading the 4 csv files. You'll see an e-mail with the
 other 3 csv files packed in a rar file.
 Thanks,

 Núria.

 2009/12/9 Núria Trench nuriatre...@gmail.com

 Yes, you are right. But there is one csv file that is too big to be packed
 with other files and I am reducing it.
 I am sending the other files now.

 2009/12/9 Mattias Persson matt...@neotechnology.com

 By the way, you might consider packing those files (with zip or tar.gz
 or something) cause they will shrink quite well

 2009/12/9 Mattias Persson matt...@neotechnology.com:
  Great, but I only got the images.csv file... I'm starting to test with
  that at least
 
  2009/12/9 Núria Trench nuriatre...@gmail.com:
  Hi again,
 
  The errors show up after being parsed 2 csv files to create all the
  nodes,
  just in the moment of calling the method getSingleNode for looking
  up the
  tail and head node for creating all the edges by reading the other two
  csv
  files.
 
  I am sending with Sprend the four csv files that will help you to
  trigger
  index behaviour.
 
  Thank you,
 
  Núria.
 
  2009/12/9 Mattias Persson matt...@neotechnology.com
 
  Hmm, I've no idea... but does the errors show up early in the process
  or do you have to insert a LOT of data to trigger it? In such case
  you
  could send me a part of them... maybe using http://www.sprend.se ,
  WDYT?
 
  2009/12/9 Núria Trench nuriatre...@gmail.com:
   Hi Mattias,
  
   The data isn't confident but the files are very big (5,5 GB).
   How can I send you this data?
  
   2009/12/9 Mattias Persson matt...@neotechnology.com
  
   Yep I got the java code, thanks. Yeah if the data is confident or
   sensitive you can just send me the formatting, else consider
   sending
   the files as well (or a subset if they are big).
  
   2009/12/9 Núria Trench nuriatre...@gmail.com:



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


Re: [Neo] Neo Shell listing a relationship's property

2009-12-12 Thread Mattias Persson
This can be done. You're using b11 right? In that case you do a:

ls -rv to list your relationships with their ids (the -v flag)

then you take the relationship's id and do a:

cd -r relationship-id

you're now standing on that relationship and can do operations like
ls, set, rm a.s.o. From there you can then do cd .. to get back or
cd start or cd end to go to its start/end node
2009/12/11, Todd Stavish toddstav...@gmail.com:
 Is there a way to list a property of a relationship in Neo Shell? If
 not, is there another way to do this without using Neoclipse? I am
 SSHing into an EC2 instance.

 Thanks,
 Todd
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user



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


  1   2   3   4   5   6   7   8   9   10   >