Re: [Neo4j] How to query based on properties

2011-02-23 Thread agamdua
Hi David

I was thinking on these lines my self, but was unable to formulate it. I think 
Ill elaborate on the actual problem as you've suggested.

There are a  number of college students who I have gathered various information 
about, example:

1. What their major is (4 options)
2. What year they are in (4 options)
3. Favourite genre of music and movies (4 options each)
4. A few yes/no questions
5. I have a list of who's friends with who in this sample

Now I want to see the people belonging to Person A's  most populated common 
property set.
Assuming that number is 5properties out of 10, I next want to see for 4 
properties (which may be different, but obviously for the same5-1 as well).

I hope this makes it clearer.

Thanks!
Sent on my BlackBerry® from Vodafone

-Original Message-
From: David Montag 
Sender: user-boun...@lists.neo4j.org
Date: Wed, 23 Feb 2011 23:30:11 
To: Neo4j user discussions
Reply-To: Neo4j user discussions 
Subject: Re: [Neo4j] How to query based on properties

Agam,

Depending on the set of possible values, you could represent the properties
with relationships instead. A unique property value can then be represented
by a node, which would be linked to all nodes that have that value. The
relationship type could indicate the property. The "value" nodes would then
be indexed so that you can find the right node when setting the "property"
(i.e. creating a relationship to the value node).

Also, it would be great if you could elaborate a bit more on the actual use
case behind this algorithm. That way, a more suitable solution might emerge,
solving your problem in a different way.

Thanks,
David

On Wed, Feb 23, 2011 at 10:36 PM, Agam Dua  wrote:

> Hey
>
> I'm a graph database and Neo4j newbie and I'm in a bit of a fix:
>
> *Problem Description*
> Let's say I have 'n' nodes in the graph, representing the same type of
> object. They have certain undirected links between them.
> Now each of these 'n' nodes has the same 10 properties, the *values* of
> which may differ.
>
> *Problem Statement*
> Take starting node A. I need to find a way to traverse all the nodes of the
> graph and print out which nodes have the most properties in common with A.
> For example, if A, C, D, E, F, G have 'x' properties in common I want to
> print the nodes.
> Then, I want to print the nodes which have 'x-1' properties with the same
> value. Then 'x-2', and so on.
>
> *Question*
> Now my question is, is this possible? If so, what would be the best way to
> go about it?
>
> Thanks in advance!
> Agam.
> *
> *
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
David Montag
Neo Technology, www.neotechnology.com
Cell: 650.556.4411
david.mon...@neotechnology.com
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Cache sharding blog post

2011-02-23 Thread Mark Harwood
A nice clear post. The choice of "Router" is obviously key. For the given 
routing examples based on user or geo it should be possible to map a request to 
a server. For many other situations it may prove much harder to determine which 
server has a warm cache because there is no user and there is no overarching 
idea of locality that you have with the geo example to organise the graph into 
logical shards? Are you not left with the partitioning problem in these cases?
Cheers 
Mark

On 24 Feb 2011, at 00:17, Jim Webber  wrote:

> Hi folks,
> 
> I've written up my thoughts on the cache sharding pattern on my blog. See:
> 
> http://jim.webber.name/2011/02/23/abe72f61-27fb-4c1b-8ce1-d0db7583497b.aspx
> 
> Jim
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] How to query based on properties

2011-02-23 Thread David Montag
Agam,

Depending on the set of possible values, you could represent the properties
with relationships instead. A unique property value can then be represented
by a node, which would be linked to all nodes that have that value. The
relationship type could indicate the property. The "value" nodes would then
be indexed so that you can find the right node when setting the "property"
(i.e. creating a relationship to the value node).

Also, it would be great if you could elaborate a bit more on the actual use
case behind this algorithm. That way, a more suitable solution might emerge,
solving your problem in a different way.

Thanks,
David

On Wed, Feb 23, 2011 at 10:36 PM, Agam Dua  wrote:

> Hey
>
> I'm a graph database and Neo4j newbie and I'm in a bit of a fix:
>
> *Problem Description*
> Let's say I have 'n' nodes in the graph, representing the same type of
> object. They have certain undirected links between them.
> Now each of these 'n' nodes has the same 10 properties, the *values* of
> which may differ.
>
> *Problem Statement*
> Take starting node A. I need to find a way to traverse all the nodes of the
> graph and print out which nodes have the most properties in common with A.
> For example, if A, C, D, E, F, G have 'x' properties in common I want to
> print the nodes.
> Then, I want to print the nodes which have 'x-1' properties with the same
> value. Then 'x-2', and so on.
>
> *Question*
> Now my question is, is this possible? If so, what would be the best way to
> go about it?
>
> Thanks in advance!
> Agam.
> *
> *
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
David Montag
Neo Technology, www.neotechnology.com
Cell: 650.556.4411
david.mon...@neotechnology.com
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] How to query based on properties

2011-02-23 Thread agamdua
Hi Cedric, thanks for the quick reply!

Yes, it's not very 'graphy' but it is a viable solution. My only concern is, 
what may not have been so clear earlier:
The properties have to be the same, i.e.,
If A, C, D, E, F, G are the nodes that have the 'x=4' properties in common, the 
properties may be {p1, p2, p5, p8} as an example property set.
Then the next may see properties for 'x=3' {p1, p5, p8} which will include more 
nodes with these as a subset, and an alternative A, B, F sharing {p1, p2, p3} 
property set.

Suggestions?
Sent on my BlackBerry® from Vodafone

-Original Message-
From: Cedric Hurst 
Sender: user-boun...@lists.neo4j.org
Date: Thu, 24 Feb 2011 00:49:37 
To: Neo4j user discussions
Reply-To: Neo4j user discussions 
Subject: Re: [Neo4j] How to query based on properties

Not sure if its the best one, but one possible strategy would be to
define a comparator with a constructor that takes an argument of your
comparison node (A), and then implement the compareTo() function to
retrieve the number of common properties for one node against the
number of common properties for other node and return the difference.
Then, you would simply iterate through all the nodes using
graph.getAllNodes(), load them into an arraylist, sort it using your
comparator, and navigate it in reverse.   This doesn't leverage any
features of the graph, really, but it does give you a solution.  I'm
curious to know if there's a "graphier" way of doing this.

On Thu, Feb 24, 2011 at 12:36 AM, Agam Dua  wrote:
> Hey
>
> I'm a graph database and Neo4j newbie and I'm in a bit of a fix:
>
> *Problem Description*
> Let's say I have 'n' nodes in the graph, representing the same type of
> object. They have certain undirected links between them.
> Now each of these 'n' nodes has the same 10 properties, the *values* of
> which may differ.
>
> *Problem Statement*
> Take starting node A. I need to find a way to traverse all the nodes of the
> graph and print out which nodes have the most properties in common with A.
> For example, if A, C, D, E, F, G have 'x' properties in common I want to
> print the nodes.
> Then, I want to print the nodes which have 'x-1' properties with the same
> value. Then 'x-2', and so on.
>
> *Question*
> Now my question is, is this possible? If so, what would be the best way to
> go about it?
>
> Thanks in advance!
> Agam.
> *
> *
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] [Blog Post] Using graph databases for knowledge representation and reasoning.

2011-02-23 Thread Peter Neubauer
Very nice post Marko, clean and to the point!

Cheers,

/peter neubauer

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

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



On Thu, Feb 24, 2011 at 12:27 AM, Marko Rodriguez  wrote:
> Hi,
>
> I wrote a blog post regarding knowledge representation and reasoning using 
> graph databases:
>        
> http://markorodriguez.com/2011/02/23/knowledge-representation-and-reasoning-with-graph-databases/
>
> Automated reasoning is currently dominated by RDF and its stack of 
> technologies. However, the standard meta modeling language OWL is restricted 
> to description logics. While this is all fine and good, it must be said that 
> there are numerous types of logics. I think that because graph databases 
> don't have a such strict "layered cake," the graph database scene is ripe to 
> be a foundation for the exploration and exploitation of other reasoning 
> structures and algorithms.
>
> Thats that,
> Marko.
>
> http://markorodriguez.com
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] How to query based on properties

2011-02-23 Thread Max De Marzi Jr.
Traverse the graph returning all nodes with at least 1 matching property.
For each node returned add up the matching properties to node A and
put that in a list.
Sort the list.


On Thu, Feb 24, 2011 at 1:49 AM, Cedric Hurst  wrote:
> Not sure if its the best one, but one possible strategy would be to
> define a comparator with a constructor that takes an argument of your
> comparison node (A), and then implement the compareTo() function to
> retrieve the number of common properties for one node against the
> number of common properties for other node and return the difference.
> Then, you would simply iterate through all the nodes using
> graph.getAllNodes(), load them into an arraylist, sort it using your
> comparator, and navigate it in reverse.   This doesn't leverage any
> features of the graph, really, but it does give you a solution.  I'm
> curious to know if there's a "graphier" way of doing this.
>
> On Thu, Feb 24, 2011 at 12:36 AM, Agam Dua  wrote:
>> Hey
>>
>> I'm a graph database and Neo4j newbie and I'm in a bit of a fix:
>>
>> *Problem Description*
>> Let's say I have 'n' nodes in the graph, representing the same type of
>> object. They have certain undirected links between them.
>> Now each of these 'n' nodes has the same 10 properties, the *values* of
>> which may differ.
>>
>> *Problem Statement*
>> Take starting node A. I need to find a way to traverse all the nodes of the
>> graph and print out which nodes have the most properties in common with A.
>> For example, if A, C, D, E, F, G have 'x' properties in common I want to
>> print the nodes.
>> Then, I want to print the nodes which have 'x-1' properties with the same
>> value. Then 'x-2', and so on.
>>
>> *Question*
>> Now my question is, is this possible? If so, what would be the best way to
>> go about it?
>>
>> Thanks in advance!
>> Agam.
>> *
>> *
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Maven clean install error "The source must not be a directory"

2011-02-23 Thread Peter Neubauer
Brendan,
I saw something similar on Windows,I don't remember what was the
cause, but could you run mvn clean install in order to make sure
things are cleaned up properly?

Cheers,

/peter neubauer

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

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



On Thu, Feb 24, 2011 at 6:03 AM, Brendan Cheng  wrote:
> Hi,
>
> I tried to build from the source code with Maven but failed with "The
> source must not be a directory."
> I did some search on internet found this is a unresolved bug.
>
> I wonder how do you overcome it?
>
> Cheers,
>
> Brendan
>
> --- maven-dependency-plugin:2.1:unpack-dependencies (get-sources) @ neo4j ---
> Unpacking C:\neo4j\com\target\classes to
>  C:\neo4j\neo4j\target\sources
>   with includes null and excludes:null
> org.codehaus.plexus.archiver.ArchiverException: The source must not be
> a directory.
>        at 
> org.codehaus.plexus.archiver.AbstractUnArchiver.validate(AbstractUnArchiver.java:174)
>        at 
> org.codehaus.plexus.archiver.AbstractUnArchiver.extract(AbstractUnArchiver.java:107)
>        at 
> org.apache.maven.plugin.dependency.AbstractDependencyMojo.unpack(AbstractDependencyMojo.java:260)
>        at 
> org.apache.maven.plugin.dependency.UnpackDependenciesMojo.execute(UnpackDependenciesMojo.java:90)
>        at 
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
>        at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
>        at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
>        at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
>        at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
>        at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
>        at 
> org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
>        at 
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
>        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
>        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
>        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
>        at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
>        at 
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
>        at 
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> 
> Reactor Summary:
>
> Neo4j - Graph Database Kernel . SUCCESS [7.535s]
> Neo4j - Graph Database Monitoring and Management tools  SUCCESS [1.794s]
> Neo4j - Communication Package . SUCCESS [6.068s]
> Neo4j - Usage Data Collection . SUCCESS [1.092s]
> Neo4j - Lucene Index .. SUCCESS [2.418s]
> Neo4j - Graph Algorithms .. SUCCESS [1.872s]
> Neo4j - High Availability . SUCCESS [2.465s]
> Neo4j . FAILURE [0.608s]
> Neo4j Embedded Build .. SKIPPED
> 
> BUILD FAILURE
> 
> Total time: 24.632s
> Finished at: Thu Feb 24 11:05:41 CST 2011
> Final Memory: 40M/247M
> 
> [ERROR]Failed to execute goal
> org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies
> (get-sources) on project neo4j: Error unpacking file:
> C:\neo4j\com\target\classes to: C:\neo4j\neo4j\target\sources
> [ERROR]org.codehaus.plexus.archiver.ArchiverException: The source must
> not be a directory.
> [ERROR]-> [Help 1]
> [ERROR]
> [ERROR]To see the full stack trace of the errors, re-run Maven with
> 

Re: [Neo4j] CQL Support in Neo4j Spatial

2011-02-23 Thread Peter Neubauer
Craig,
great work!

Tobias helped me to refactor the BerkeleyDB index to work with the
latest Indexing changes, so we should be able to upgrade even that
part to Neo4j 1.3.M03 next week and test. Together, we might be able
to get a better grip on insert performance, which is the main annoying
thing before starting to test on bigger OSM datasets.

Great job, David and Craig!

Cheers,

/peter neubauer

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

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



On Thu, Feb 24, 2011 at 12:12 AM, Craig Taverner  wrote:
> Hi,
>
> I just merged in David Winslows CQL support into Neo4j Spatial. Basically it
> is an alternative to the JSON based DynamicLayers we provided for OSM. The
> main advantages of CQL are:
>
>   - Works on the Geometries themselves, using the very extensive CQL
>   syntax, an SQL-like syntax for querying geometries and their attributes
>   - Works on more data than just OSM, so any layer that extends
>   DynamicLayer has easy and direct support
>   - It is a known standard, well supported in geotools, geoserver and udig
>   (see http://docs.codehaus.org/display/GEOTOOLS/ECQL+Parser+Design, and
>   http://www.loc.gov/standards/sru/specs/cql.html)
>
> The original JSON format is still supported, and it has its own advantages:
>
>   - Is a graph-matching syntax, and so can query non-spatial data (any
>   sub-graph in your data model)
>   - Should be faster than CQL because the geometries do not need to be
>   created, only a traversal done
>
> I pushed this to github along with a few other changes I was working on,
> notably initial support for changesets and users in the OSM model. This
> change also reduces the disk space of the database, and should also
> facilitate some of the performance enhancements Peter and I are working on
> for OSM import and query.
>
> The full set of commits I, copied from the hudson server are:
>
>   1. Started supporting more efficient changeset and user structures for
>   OSM 
> (detail
>   )
>   2. Initial code for cool NEO4J text sample data in unit tests
> (detail
>   )
>   3. Added new test class for testing performance of OSM imports as we
>   refactor the OSM structures
> (detail
>   )
>   4. Update version to match Peters changes to the dependencies
> (detail
>   )
>   5. Updated the very old README to be somewhat more relevant to the
>   current code.
> (detail
>   )
>   6. Missing license header on new test class TestOSMImport
> (detail
>   )
>   7. Reverse some of the memory settings that are too large, and support
>   optional large memory settings
> (detail
>   )
>   8. Reduce memory settings for tests to more normal levels
> (detail
>   )
>   9. Some refinements to the ongoing OSM changeset support
> (detail
>   )
>   10. Manually merged in David Winslows CQL support so that we can support
>   both JSON and CQL based filtering for Dynamic Layers. The CQL support is now
>   also directly in the DynamicLayer class because it should work for non-OSM
>   layers as well as OSM layers. CQL allows much more complex filtering on the
>   Geometry objects themselves, while the previous JSON filter was really a
>   graph-matching query de-coupled from the Geometries.
> (detail
>   )
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] How to query based on properties

2011-02-23 Thread Cedric Hurst
Not sure if its the best one, but one possible strategy would be to
define a comparator with a constructor that takes an argument of your
comparison node (A), and then implement the compareTo() function to
retrieve the number of common properties for one node against the
number of common properties for other node and return the difference.
Then, you would simply iterate through all the nodes using
graph.getAllNodes(), load them into an arraylist, sort it using your
comparator, and navigate it in reverse.   This doesn't leverage any
features of the graph, really, but it does give you a solution.  I'm
curious to know if there's a "graphier" way of doing this.

On Thu, Feb 24, 2011 at 12:36 AM, Agam Dua  wrote:
> Hey
>
> I'm a graph database and Neo4j newbie and I'm in a bit of a fix:
>
> *Problem Description*
> Let's say I have 'n' nodes in the graph, representing the same type of
> object. They have certain undirected links between them.
> Now each of these 'n' nodes has the same 10 properties, the *values* of
> which may differ.
>
> *Problem Statement*
> Take starting node A. I need to find a way to traverse all the nodes of the
> graph and print out which nodes have the most properties in common with A.
> For example, if A, C, D, E, F, G have 'x' properties in common I want to
> print the nodes.
> Then, I want to print the nodes which have 'x-1' properties with the same
> value. Then 'x-2', and so on.
>
> *Question*
> Now my question is, is this possible? If so, what would be the best way to
> go about it?
>
> Thanks in advance!
> Agam.
> *
> *
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] How to query based on properties

2011-02-23 Thread Agam Dua
Hey

I'm a graph database and Neo4j newbie and I'm in a bit of a fix:

*Problem Description*
Let's say I have 'n' nodes in the graph, representing the same type of
object. They have certain undirected links between them.
Now each of these 'n' nodes has the same 10 properties, the *values* of
which may differ.

*Problem Statement*
Take starting node A. I need to find a way to traverse all the nodes of the
graph and print out which nodes have the most properties in common with A.
For example, if A, C, D, E, F, G have 'x' properties in common I want to
print the nodes.
Then, I want to print the nodes which have 'x-1' properties with the same
value. Then 'x-2', and so on.

*Question*
Now my question is, is this possible? If so, what would be the best way to
go about it?

Thanks in advance!
Agam.
*
*
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Neo4jTemplate

2011-02-23 Thread cedric.hurst

Hi David and Michael,

Firstly, I knew that field argument had to be there for a reason, I
just couldn't figure it out from the examples.  ;-)  I think your
explanation is exactly what I was looking for, Michael.  I'll give it
a shot tomorrow.

And David, you are correct, I'm looking to create two queries, one to
retrieve all B's related to A and another to retrieve all C's related
to A.  I somewhat obfuscated my use case for the sake of simplicity,
but I'm actually investigating the use of a graph database to more
flexibly drive conflict resolution in a rule engine, Drools in my
case.  In this model, each rule would have a representation as a node
on the graph, and the conditions would relate to specific fact nodes
or patterns.  So lets say we have something like this:

Rule[name: 'red car costs one hundred dollars', price: 100] --
REQUIRES --> CarColor[name: red]
Rule[name: 'sedan costs five hundred dollars', price: 500] -- REQUIRES
--> CarTrim[name: sedan]

These nodes have a parity in our rule engine so that when we evaluate
a red car, its price gets set to 100; and when we evaluate a sedan its
price gets set to 500.  However, if I try to evaluate a red sedan, the
price is ambiguous.  Typically, rule engines provide a notion of
"salience," which would allow me to assign numeric priority to each
rule.  Whichever rule has the highest priority wins, and the loser
gets evicted from the "agenda."  The problem with this is that
eventually you end up writing QBASIC-like rules where one rule has a
salience of 10 and another has a salience of 20.  That way, if we have
a rule that sits in between them, we can give it a salience of 25.
This only goes so far, though, soI'm looking to do something a bit
better.  By specifying a graph hierarchy, I expect to be able to use
node traversals to do things:

1. "Discover" conflicts by detecting any other rule nodes that do not
have a "requires" constraint pointing to a node of the same type.  For
example, a rule for a red car and a rule for a green car are not in
conflict; but if i define a rule for a red car and a rule for a sedan
that doesn't also require some non-red color, I need to specify which
rule takes priority should I hit an intersection of conditions.
2. Define mechanisms for rules to "override" or "extend" other rules.
For example, if I wanted the sedan rule to take priority, I'd specify:

Rule[name: 'sedan...'] -- OVERRIDES --> Rule[name: 'red car...']

Then, in the rules engine, I'd plug in a conflict resolution strategy
take takes in an agenda of rules to fire and uses the graph to evict
the rules that were overridden by other rules on the agenda.

In the case of extension, I could have something like:

Rule[name: 'red car...', price: 100] -- EXTENDS --> Rule[name: 'red
sedan', price: 600] -- REQUIRES --> CarTrim[name: 'sedan']

This effectively defines a sub-rule for the intersection of a red car
and a sedan, but the constraints would need to be collected through a
node traversal, continue+excluding extends relationships and
include+pruning from the requires relationships (CarTrim and
CarColors).  In order to accurately compile a rule from this model,
though, I'd need to get a list of trims and color requirements
separately (as they are distinct attributes of a Car fact).

This is where the aforementioned A, B, C scenario comes into play.  Of
course, I could define separate relationship types for each attribute,
e.g. REQUIRES_TRIM, REQUIRES_COLOR, but that just seemed like a lot of
extra work.  The nature of the relationship is the same, and ideally
I'd like to derive the meaning from the Java type of the end node.  It
also allows us to add other types of constraint relationships in the
future (like CANNOT_HAVE, etc).

I'm just playing around with Neo4j for now, but so far I'm really
liking what I've seen.  On a separate, completely unrelated project,
we were able to adapt "fishhook" style parent/child hierarchies from
SQL to a graph and its opened up a whole new world of use cases for
our dev team to explore.  We're now able to navigate through
company/organization hierarchies with way less code and much better
response times.

Keep up the good work!

On Wed, Feb 23, 2011 at 7:42 PM, David Montag [via Neo4J User List]
 wrote:
> Cedric,
>
> Thank you for your feedback! We value it highly.
>
> I'm trying to understand your use case. You have entities of classes A, B,
> and C. Your graph looks like this:
>
> A --RELATED_TO--> B
> A --RELATED_TO--> C
>
> And you want to provide query methods for getting all B's and C's for a
> given A. Correct?
>
> If yes, could you please elaborate a bit more on the actual use case? I.e.
> what are the A's and B's and C's. It would be interesting to know what kind
> of a use case would drive this graph and these queries.
>
> Thanks,
> David
>
> On Wed, Feb 23, 2011 at 2:10 PM, cedric.hurst <[hidden email]> wrote:
>
>>
>> Firstly, thanks for your great work on the Spring Data Graph API so far.
>>  I
>> took a look at the dr

Re: [Neo4j] Neo4J Rest server API

2011-02-23 Thread francoisk6

Thx Mattias.

-
Regards,
Francois Kassis.
-- 
View this message in context: 
http://neo4j-user-list.438527.n3.nabble.com/Neo4J-Rest-server-API-tp2559737p2565570.html
Sent from the Neo4J User List mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Maven clean install error "The source must not be a directory"

2011-02-23 Thread Brendan Cheng
Hi,

I tried to build from the source code with Maven but failed with "The
source must not be a directory."
I did some search on internet found this is a unresolved bug.

I wonder how do you overcome it?

Cheers,

Brendan

--- maven-dependency-plugin:2.1:unpack-dependencies (get-sources) @ neo4j ---
Unpacking C:\neo4j\com\target\classes to
  C:\neo4j\neo4j\target\sources
   with includes null and excludes:null
org.codehaus.plexus.archiver.ArchiverException: The source must not be
a directory.
at 
org.codehaus.plexus.archiver.AbstractUnArchiver.validate(AbstractUnArchiver.java:174)
at 
org.codehaus.plexus.archiver.AbstractUnArchiver.extract(AbstractUnArchiver.java:107)
at 
org.apache.maven.plugin.dependency.AbstractDependencyMojo.unpack(AbstractDependencyMojo.java:260)
at 
org.apache.maven.plugin.dependency.UnpackDependenciesMojo.execute(UnpackDependenciesMojo.java:90)
at 
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at 
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at 
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at 
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at 
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at 
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at 
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at 
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

Reactor Summary:

Neo4j - Graph Database Kernel . SUCCESS [7.535s]
Neo4j - Graph Database Monitoring and Management tools  SUCCESS [1.794s]
Neo4j - Communication Package . SUCCESS [6.068s]
Neo4j - Usage Data Collection . SUCCESS [1.092s]
Neo4j - Lucene Index .. SUCCESS [2.418s]
Neo4j - Graph Algorithms .. SUCCESS [1.872s]
Neo4j - High Availability . SUCCESS [2.465s]
Neo4j . FAILURE [0.608s]
Neo4j Embedded Build .. SKIPPED

BUILD FAILURE

Total time: 24.632s
Finished at: Thu Feb 24 11:05:41 CST 2011
Final Memory: 40M/247M

[ERROR]Failed to execute goal
org.apache.maven.plugins:maven-dependency-plugin:2.1:unpack-dependencies
(get-sources) on project neo4j: Error unpacking file:
C:\neo4j\com\target\classes to: C:\neo4j\neo4j\target\sources
[ERROR]org.codehaus.plexus.archiver.ArchiverException: The source must
not be a directory.
[ERROR]-> [Help 1]
[ERROR]
[ERROR]To see the full stack trace of the errors, re-run Maven with
the -e switch.
[ERROR]Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR]For more information about the errors and possible solutions,
please read the following articles:
[ERROR][Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR]After correcting the problems, you can resume the build with the command
[ERROR]  mvn  -rf :neo4j
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Neo4jTemplate

2011-02-23 Thread David Montag
Cedric,

Thank you for your feedback! We value it highly.

I'm trying to understand your use case. You have entities of classes A, B,
and C. Your graph looks like this:

A --RELATED_TO--> B
A --RELATED_TO--> C

And you want to provide query methods for getting all B's and C's for a
given A. Correct?

If yes, could you please elaborate a bit more on the actual use case? I.e.
what are the A's and B's and C's. It would be interesting to know what kind
of a use case would drive this graph and these queries.

Thanks,
David

On Wed, Feb 23, 2011 at 2:10 PM, cedric.hurst  wrote:

>
> Firstly, thanks for your great work on the Spring Data Graph API so far.  I
> took a look at the draft you had out here:
>
> https://gist.github.com/835408
>
> And it looks like an awesome start.  I'm relatively new to Neo4J (saw the
> SpringOne keynote and the roo talk), but one thing I think would be very
> useful is if there was some sort of higher-level PathMapper that worked at
> the GraphBacked level, instead of working at the Neo4j node level.
>
> In my immediate case, I have three NodeBacked types in my graph: TypeA,
> TypeB, and TypeC.  Types B and C can be related to Type A through the same
> relationship type, but I want to define two traversals that include only
> each type respectively.  I'm using the FieldTraversalDescriptionBuilder but
> its falling down when I try to do something like the following:
>
> class TypeA {
>@GraphTraversal(traversalBuilder = RelatedTraversalBuilder.class,
> elementClass = TypeB.class)
>private Iterable typeBs;
>
>@GraphTraversal(traversalBuilder = RelatedTraversalBuilder.class,
> elementClass = TypeC.class)
>private Iterable typeCs;
>
>private static class RelatedTraversalBuilder implements
> FieldTraversalDescriptionBuilder {
>   public TraversalDescription build(NodeBacked start, Field field) {
>return new
> TraversalDescriptionImpl().relationships(RelTypes.RELATED_TO);
>   }
>}
> }
>
> In this particular case, the traversal will return a mix of TypeB and TypeC
> and throw a class cast exception.
>
> I'd love to have some abstraction of a Path such that path.startNode() and
> path.endNode() would return the actual NodeBacked classes themselves, so I
> could write my PathMappers to use something like:
>
> class MyPathMapper implements PathMapper {
>  public Void mapPath(GraphPath path) {
>   if(path.endNode() instanceof TypeB) {
>  return Evaluator.INCLUDE_AND_PRUNE
>   } else {
>  return Evaluator.EXCLUDE_AND_PRUNE
>   }
>  }
> }
>
> It seems like the template should be able to provide this with something
> along the lines of:
>
> interface PathMapper {
>   ...
>@Override
>   public Void mapPath(GraphPath graphPath) {
>   eachPath(graphPath);
>   return null;
>   }
> }
>
> interface GraphPath {
>   NodeBacked startNode();
>   NodeBacked endNode();
>   ...
> }
>
> The key here is, of course, that GraphPath provides NodeBacked classes
> instead of primitive neo4j nodes.  Beyond the simple instanceof example I
> gave, I think it would also be useful for evaluating paths using on
> NodeEntity properties rather than having to call
> node.getProperty('somePropertyNameThatIWillProbablyMisspell').
>
> Not sure if my request makes sense, or is reasonable to implement, but I
> think it would certainly make my life a lot easier.
> --
> View this message in context:
> http://neo4j-user-list.438527.n3.nabble.com/Neo4j-Spring-Neo4jTemplate-tp2525460p2563548.html
> Sent from the Neo4J User List mailing list archive at Nabble.com.
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
David Montag
Neo Technology, www.neotechnology.com
Cell: 650.556.4411
david.mon...@neotechnology.com
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Cache sharding blog post

2011-02-23 Thread Andreas Kollegger
I do say, the good gentleman has produced a clearly written, appropriately 
illustrated, and highly valuable post. 

Cheers,
Andreas

ps. Excepting a few tiny errors in spelling and punctuation.

On Feb 24, 2011, at 1:17 AM, Jim Webber wrote:

> Hi folks,
> 
> I've written up my thoughts on the cache sharding pattern on my blog. See:
> 
> http://jim.webber.name/2011/02/23/abe72f61-27fb-4c1b-8ce1-d0db7583497b.aspx
> 
> Jim
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

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


[Neo4j] Cache sharding blog post

2011-02-23 Thread Jim Webber
Hi folks,

I've written up my thoughts on the cache sharding pattern on my blog. See:

http://jim.webber.name/2011/02/23/abe72f61-27fb-4c1b-8ce1-d0db7583497b.aspx

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


[Neo4j] [Blog Post] Using graph databases for knowledge representation and reasoning.

2011-02-23 Thread Marko Rodriguez
Hi,

I wrote a blog post regarding knowledge representation and reasoning using 
graph databases:

http://markorodriguez.com/2011/02/23/knowledge-representation-and-reasoning-with-graph-databases/

Automated reasoning is currently dominated by RDF and its stack of 
technologies. However, the standard meta modeling language OWL is restricted to 
description logics. While this is all fine and good, it must be said that there 
are numerous types of logics. I think that because graph databases don't have a 
such strict "layered cake," the graph database scene is ripe to be a foundation 
for the exploration and exploitation of other reasoning structures and 
algorithms.

Thats that,
Marko.

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


Re: [Neo4j] Spring Neo4jTemplate

2011-02-23 Thread Michael Hunger
Cedric,

thanks so much for your feedback.

By now I kept the template and the NodeBacked kind of separate.

The Neo4jTemplate API has changed a bit :) see here:
https://github.com/SpringSource/spring-data-graph/blob/master/spring-data-neo4j/src/main/java/org/springframework/data/graph/neo4j/template/Neo4jOperations.java

You'd be right to expect support for the NodeBacked entities in the template as 
well.

Or at least create a separate template (or rather a repository) that is 
pre-configured to support
a certain kind of NodeBacked instances, so its methods would automatically 
return instances of that
nodebacked-instance.

It would be interesting though how to handle that with the paths. Because in 
the path you can't statically reason about the
type of the nodebacked and relationshipbacked that is contained in the full 
path.
So although with the help of the node-type strategy (if one is set) we could 
figure out a NodeBacked type and return instances of 
that one, you as an user wouldn't get any compile time support for that. 
(Except if we were able to configure the Path with the types of the NodeBacked 
that we 
expect in there (for all paths) which is tricky if you take the dynamic nature 
of the graph into account.

Something that could be more feasible is to use the projectTo facilities to 
have the NodeBacked/RelationshipBacked within a path be set to a common 
superset of the ones
expected in there (e.g. Named) and then during the processing of the path 
project them to the concrete type that you want it to be used as.

So I'll think about an "GraphEntityPath" and which constraints it would have to 
ensure.

Regarding your traversal builder 
as you're passed the field on build() you can get the Annotation and from it 
the target class and then use an Evaluator which gets the type node via the 
INSTANCE_OF relationship
and if that fits the type from the annotation then use INCLUDE_AND_CONTINUE and 
otherwise EXCLUDE_AND_PRUNE. (or EXCLUDE_AND_CONTINUE if you want to follow the 
path and not stop here).
We could provide such an evaluator out of the box, that would actually be a 
good thing to have. That would then be a GraphEntityEvaluator that doesn't get 
a path but a GraphEntityPath.

Really great ideas. Will try to do something around this for M4 :)

Cheers

Michael

Am 23.02.2011 um 23:10 schrieb cedric.hurst:

> 
> Firstly, thanks for your great work on the Spring Data Graph API so far.  I
> took a look at the draft you had out here:
> 
> https://gist.github.com/835408
> 
> And it looks like an awesome start.  I'm relatively new to Neo4J (saw the
> SpringOne keynote and the roo talk), but one thing I think would be very
> useful is if there was some sort of higher-level PathMapper that worked at
> the GraphBacked level, instead of working at the Neo4j node level.
> 
> In my immediate case, I have three NodeBacked types in my graph: TypeA,
> TypeB, and TypeC.  Types B and C can be related to Type A through the same
> relationship type, but I want to define two traversals that include only
> each type respectively.  I'm using the FieldTraversalDescriptionBuilder but
> its falling down when I try to do something like the following:
> 
> class TypeA {
>@GraphTraversal(traversalBuilder = RelatedTraversalBuilder.class,
> elementClass = TypeB.class)
>private Iterable typeBs;
> 
>@GraphTraversal(traversalBuilder = RelatedTraversalBuilder.class,
> elementClass = TypeC.class)
>private Iterable typeCs;
> 
>private static class RelatedTraversalBuilder implements
> FieldTraversalDescriptionBuilder {
>   public TraversalDescription build(NodeBacked start, Field field) {
>   return new 
> TraversalDescriptionImpl().relationships(RelTypes.RELATED_TO);
>   }
>}
> }
> 
> In this particular case, the traversal will return a mix of TypeB and TypeC
> and throw a class cast exception.
> 
> I'd love to have some abstraction of a Path such that path.startNode() and
> path.endNode() would return the actual NodeBacked classes themselves, so I
> could write my PathMappers to use something like:
> 
> class MyPathMapper implements PathMapper {
> public Void mapPath(GraphPath path) {
>   if(path.endNode() instanceof TypeB) {
>  return Evaluator.INCLUDE_AND_PRUNE
>   } else {
>  return Evaluator.EXCLUDE_AND_PRUNE
>   }
>  }
> }
> 
> It seems like the template should be able to provide this with something
> along the lines of:
> 
> interface PathMapper {
>   ...
>@Override
>   public Void mapPath(GraphPath graphPath) {
>   eachPath(graphPath);
>   return null;
>   }
> }
> 
> interface GraphPath {
>   NodeBacked startNode();
>   NodeBacked endNode();
>   ...
> }
> 
> The key here is, of course, that GraphPath provides NodeBacked classes
> instead of primitive neo4j nodes.  Beyond the simple instanceof example I
> gave, I think it would also be useful for evaluating paths using on
> NodeEntity properties rather than having to call
> node.getProp

[Neo4j] CQL Support in Neo4j Spatial

2011-02-23 Thread Craig Taverner
Hi,

I just merged in David Winslows CQL support into Neo4j Spatial. Basically it
is an alternative to the JSON based DynamicLayers we provided for OSM. The
main advantages of CQL are:

   - Works on the Geometries themselves, using the very extensive CQL
   syntax, an SQL-like syntax for querying geometries and their attributes
   - Works on more data than just OSM, so any layer that extends
   DynamicLayer has easy and direct support
   - It is a known standard, well supported in geotools, geoserver and udig
   (see http://docs.codehaus.org/display/GEOTOOLS/ECQL+Parser+Design, and
   http://www.loc.gov/standards/sru/specs/cql.html)

The original JSON format is still supported, and it has its own advantages:

   - Is a graph-matching syntax, and so can query non-spatial data (any
   sub-graph in your data model)
   - Should be faster than CQL because the geometries do not need to be
   created, only a traversal done

I pushed this to github along with a few other changes I was working on,
notably initial support for changesets and users in the OSM model. This
change also reduces the disk space of the database, and should also
facilitate some of the performance enhancements Peter and I are working on
for OSM import and query.

The full set of commits I, copied from the hudson server are:

   1. Started supporting more efficient changeset and user structures for
   OSM (detail
   )
   2. Initial code for cool NEO4J text sample data in unit tests
(detail
   )
   3. Added new test class for testing performance of OSM imports as we
   refactor the OSM structures
(detail
   )
   4. Update version to match Peters changes to the dependencies
(detail
   )
   5. Updated the very old README to be somewhat more relevant to the
   current code.
(detail
   )
   6. Missing license header on new test class TestOSMImport
(detail
   )
   7. Reverse some of the memory settings that are too large, and support
   optional large memory settings
(detail
   )
   8. Reduce memory settings for tests to more normal levels
(detail
   )
   9. Some refinements to the ongoing OSM changeset support
(detail
   )
   10. Manually merged in David Winslows CQL support so that we can support
   both JSON and CQL based filtering for Dynamic Layers. The CQL support is now
   also directly in the DynamicLayer class because it should work for non-OSM
   layers as well as OSM layers. CQL allows much more complex filtering on the
   Geometry objects themselves, while the previous JSON filter was really a
   graph-matching query de-coupled from the Geometries.
(detail
   )
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Spring Neo4jTemplate

2011-02-23 Thread cedric.hurst

Firstly, thanks for your great work on the Spring Data Graph API so far.  I
took a look at the draft you had out here:

https://gist.github.com/835408

And it looks like an awesome start.  I'm relatively new to Neo4J (saw the
SpringOne keynote and the roo talk), but one thing I think would be very
useful is if there was some sort of higher-level PathMapper that worked at
the GraphBacked level, instead of working at the Neo4j node level.

In my immediate case, I have three NodeBacked types in my graph: TypeA,
TypeB, and TypeC.  Types B and C can be related to Type A through the same
relationship type, but I want to define two traversals that include only
each type respectively.  I'm using the FieldTraversalDescriptionBuilder but
its falling down when I try to do something like the following:

class TypeA {
@GraphTraversal(traversalBuilder = RelatedTraversalBuilder.class,
elementClass = TypeB.class)
private Iterable typeBs;

@GraphTraversal(traversalBuilder = RelatedTraversalBuilder.class,
elementClass = TypeC.class)
private Iterable typeCs;

private static class RelatedTraversalBuilder implements
FieldTraversalDescriptionBuilder {
   public TraversalDescription build(NodeBacked start, Field field) {
return new 
TraversalDescriptionImpl().relationships(RelTypes.RELATED_TO);
   }
}
}

In this particular case, the traversal will return a mix of TypeB and TypeC
and throw a class cast exception.

I'd love to have some abstraction of a Path such that path.startNode() and
path.endNode() would return the actual NodeBacked classes themselves, so I
could write my PathMappers to use something like:

class MyPathMapper implements PathMapper {
 public Void mapPath(GraphPath path) {
   if(path.endNode() instanceof TypeB) {
  return Evaluator.INCLUDE_AND_PRUNE
   } else {
  return Evaluator.EXCLUDE_AND_PRUNE
   }
  }
}

It seems like the template should be able to provide this with something
along the lines of:

interface PathMapper {
   ...
@Override
   public Void mapPath(GraphPath graphPath) {
   eachPath(graphPath);
   return null;
   }
}

interface GraphPath {
   NodeBacked startNode();
   NodeBacked endNode();
   ...
}

The key here is, of course, that GraphPath provides NodeBacked classes
instead of primitive neo4j nodes.  Beyond the simple instanceof example I
gave, I think it would also be useful for evaluating paths using on
NodeEntity properties rather than having to call
node.getProperty('somePropertyNameThatIWillProbablyMisspell').

Not sure if my request makes sense, or is reasonable to implement, but I
think it would certainly make my life a lot easier.
-- 
View this message in context: 
http://neo4j-user-list.438527.n3.nabble.com/Neo4j-Spring-Neo4jTemplate-tp2525460p2563548.html
Sent from the Neo4J User List mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Online backup works in full but not incremental

2011-02-23 Thread Mattias Persson
2011/2/22 Brendan Cheng 

> Hi Mattias,
>
> Does the latest online backup work on backup to a running read only db?
>

I think there may be problems with cache invalidation on that running
read-only database and I just tried and there were other problems as well...
so, no... not at the moment.

>
> Brendan
>
> On 21 February 2011 23:09,   wrote:
> > Date: Mon, 21 Feb 2011 15:27:30 +0100
> > From: Mattias Persson 
> > Subject: Re: [Neo4j] Online backup works in full but not incremental
> > To: Neo4j user discussions 
> > Message-ID:
> >
> > Content-Type: text/plain; charset=UTF-8
> >
> > I just can't reproduce your problems. How are you doing backup? It looks
> > like (from your wrapper.log) that it's the server which somehow requests
> to
> > do the incremental backup. Aren't you doing backup of the server
> database?
> >
> > 2011/2/21 Brendan Cheng 
> >
> >> Tobias,
> >>
> >> Here s the stack trace and part of the wrapper.log:
> >> run:
> >> Mon Feb 21 10:28:59 CST 2011: Client connected to 192.168.1.101:6362
> >> Mon Feb 21 10:29:00 CST 2011: Opened a new channel to /
> 192.168.1.101:6362
> >> 21-Feb-2011 10:29:20 itags.Sync.SyncData main
> >> SEVERE: null
> >> org.neo4j.com.ComException: org.neo4j.com.ComException:
> >> org.jboss.netty.handler.queue.BlockingReadTimeoutException
> >>at org.neo4j.com.Client.sendRequest(Client.java:183)
> >>at
> >>
> org.neo4j.com.backup.BackupClient.incrementalBackup(BackupClient.java:48)
> >>at
> >> org.neo4j.com.backup.OnlineBackup.incremental(OnlineBackup.java:115)
> >>at
> >> org.neo4j.com.backup.OnlineBackup.incremental(OnlineBackup.java:105)
> >>at itags.Sync.SyncData.RunningOnlineBackup(SyncData.java:57)
> >>at itags.Sync.SyncData.main(SyncData.java:247)
> >> Caused by: org.neo4j.com.ComException:
> >> org.jboss.netty.handler.queue.BlockingReadTimeoutException
> >>at
> >>
> org.neo4j.com.DechunkingChannelBuffer.readNext(DechunkingChannelBuffer.java:61)
> >>at org.neo4j.com.Client$2.readNext(Client.java:155)
> >>at
> >>
> org.neo4j.com.DechunkingChannelBuffer.readNextChunk(DechunkingChannelBuffer.java:79)
> >>at
> >>
> org.neo4j.com.DechunkingChannelBuffer.(DechunkingChannelBuffer.java:50)
> >>at org.neo4j.com.Client$2.(Client.java:151)
> >>at org.neo4j.com.Client.sendRequest(Client.java:150)
> >>... 5 more
> >> Caused by: org.jboss.netty.handler.queue.BlockingReadTimeoutException
> >>at
> >>
> org.jboss.netty.handler.queue.BlockingReadHandler.readEvent(BlockingReadHandler.java:236)
> >>at
> >>
> org.jboss.netty.handler.queue.BlockingReadHandler.read(BlockingReadHandler.java:167)
> >>at
> >>
> org.neo4j.com.DechunkingChannelBuffer.readNext(DechunkingChannelBuffer.java:57)
> >>... 10 more
> >>
> >> Do I miss any configuration?
> >>
> >> cheers,
> >>
> >> Brendan
> >>
> >> > Date: Mon, 21 Feb 2011 01:11:19 +0800
> >> > From: Brendan 
> >> > Subject: [Neo4j] Online backup works in full but not incremental
> >> > To: "user@lists.neo4j.org" 
> >> > Message-ID: 
> >> > Content-Type: text/plain;   charset=us-ascii
> >> >
> >> > Hi,
> >> >
> >> > After I install the neo4j on ubuntu server I'm able to backup the full
> >> database, even repeatedly but it crashed on incremental.
> >> >
> >> > I also fixed the problem with webadmin page loading but I found 2
> issues:
> >> 1 the timeline graph can not be loaded on ie 8. 2 I experienced stack
> >> overflow on the webadmin page during the full online backup running.
> Also
> >> unresponsive in Save changes command issued from webadmin.
> >> >
> >> > I then tried webadmin from chrome and I saw the timeline graph but the
> >> add relationship panel loaded but not functional, can't enter the node
> I'd
> >> URL.
> >> >
> >> > Which browser is most compatible with webadmin?
> >> >
> >> > Your comment is highly appreciated!
> >> >
> >> > Brendan
> >> >
> >> > Sent from my iPad
> >> > Date: Sun, 20 Feb 2011 19:07:02 +0100
> >> > From: Tobias Ivarsson 
> >> > Subject: Re: [Neo4j] Online backup works in full but not incremental
> >> > To: Neo4j user discussions 
> >> > Message-ID:
> >> >
> >> > Content-Type: text/plain; charset=ISO-8859-1
> >> >
> >> > On Sun, Feb 20, 2011 at 6:11 PM, Brendan  wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> After I install the neo4j on ubuntu server I'm able to backup the
> full
> >> >> database, even repeatedly but it crashed on incremental.
> >> >>
> >> >
> >> > Could you please provide a stacktrace, and other kinds of error output
> >> from
> >> > this crash.
> >> >
> >> > Thank you,
> >> > --
> >> > Tobias Ivarsson 
> >> > Hacker, Neo Technology
> >> > www.neotechnology.com
> >> > Cellphone: +46 706 534857
> >> >
> >>
> >> ___
> >> Neo4j mailing list
> >> User@lists.neo4j.org
> >> https://lists.neo4j.org/mailman/listinfo/user
> >>
> >>
> >
> >
> > --
> > Mattias Persson, [matt...@neotechnology.com]
> > Hacker

Re: [Neo4j] Neo4J Rest server API

2011-02-23 Thread Mattias Persson
2011/2/23 francoisk6 

>
> Hi michael, thx for the reply.
>
> ok, if this is the new way to index:
> graphdb.index().forNodes(indexName).add(node,field,value) .
> What about the lucene fulltext search and the query search.
> What i need at end of the day, is to index data using java. and then using
> the rest api to search for nodes.
>
> My old way:
> IndexService index = new LuceneIndexService(graphDb);
> IndexService fulltextindex = new LuceneFulltextIndexService(graphDb);
> index.index(tempSectorNode, index_name, value);
> fulltextindex.index(tempSectorNode, index_name, value);
>
> New way:
> graphdb.index().forNodes(indexName).add(node,field,value)
> fulltext ???
>

Have a look here: http://wiki.neo4j.org/content/Index_Framework and
specifically here:
http://wiki.neo4j.org/content/Index_Framework#Advanced_creation_and_fulltext

Instead of one index service where you index key/value pairs you can now
divide stuff into different indexes, this enables querying of multiple
key/values pairs per query. It's all in the above links.

Exact lookups (Index#get) is what the REST API now exposes, but there will
be added query support also (Index#query) where fulltext/wildcard/etc
queries can be entered.


>
> I was informed that a non-exact search is not yet available thru rest api.
> so i was building an extension to do so.
>
> Thx again Michael and appreciate your help.
>
>
>
> -
> Regards,
> Francois Kassis.
> --
> View this message in context:
> http://neo4j-user-list.438527.n3.nabble.com/Neo4J-Rest-server-API-tp2559737p2560303.html
> Sent from the Neo4J User List mailing list archive at Nabble.com.
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



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


Re: [Neo4j] No index provider 'lucene' found with Tomcat/Trinidad

2011-02-23 Thread Pablo Pareja
Hi,

I tried adding both jars you said at server-project level with and it
finally worked !

However when these two jars where included in libraries which where maven
dependencies used by the server project, it
was like they weren't there and I kept getting the same error.
I have to say that I don't know much about maven, just enough to get things
working.
Still, I don't understand why this happens...

Cheers,

Pablo

PS: (I always wonder why maven is "so" "user-friendly" and intuitive :P)

On Tue, Feb 22, 2011 at 11:44 PM, Pablo Pareja  wrote:

> Hi Mattias,
>
> I'll try that tomorrow and I'll let you know,
>
> Pablo
>
>
> On Tue, Feb 22, 2011 at 9:00 PM, Mattias Persson <
> matt...@neotechnology.com> wrote:
>
>> 2011/2/22 Pablo Pareja 
>>
>> > Hi,
>> >
>> > I just moved my code to the new index API but I cannot deploy my server.
>> > I've already tried with glassfishv3 and jetty and neither of them works.
>> > The exception I get is:
>> >
>> > java.lang.Exception: java.lang.IllegalStateException:
>> > ContainerBase.addChild: start: org.apache.catalina.LifecycleException:
>> > java.lang.IllegalArgumentException: No index provider 'lucene' found
>> >
>> > I've already tried directly adding the apache bundle lucene jar to with
>> no
>> > luck.
>> > any ideas of what could be happening?
>> >
>>
>> Could be java service API not loading stuff as it should probably (index
>> providers are loaded that way).
>>
>> You say you tried adding the apache bundle lucene jar directly... did you
>> also add neo4j-lucene-index jar file? The lucene index provider for neo4j
>> consists of Lucene (lucene-core or lucene bundle) and a wrapper to make it
>> participate nicely in Neo4j transactions/lifecycle (neo4j-lucene-index).
>>
>> >
>> > Cheers,
>> >
>> > Pablo
>> >
>> > On Thu, Feb 17, 2011 at 11:31 AM, Peter Neubauer <
>> > peter.neuba...@neotechnology.com> wrote:
>> >
>> > > Mmmh,
>> > > the main issue here I suspect is that the Java Service Loader is not
>> > > finding the META-INF/services  files. It might be that it is not
>> > > triggered when you add files dynamically to the classloader. That is,
>> > > the JARs are only scanned at startup time for any non-class files.
>> > > Could that be an issue?
>> > >
>> > > Cheers,
>> > >
>> > > /peter neubauer
>> > >
>> > > GTalk:  neubauer.peter
>> > > Skype   peter.neubauer
>> > > Phone   +46 704 106975
>> > > LinkedIn   http://www.linkedin.com/in/neubauer
>> > > Twitter  http://twitter.com/peterneubauer
>> > >
>> > > http://www.neo4j.org   - Your high performance graph
>> > database.
>> > > http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing
>> party.
>> > >
>> > >
>> > >
>> > > On Thu, Feb 17, 2011 at 11:28 AM, Andreas Ronge <
>> andreas.ro...@gmail.com
>> > >
>> > > wrote:
>> > > > Hi
>> > > >
>> > > > I have found a work around - I added all the jar files needed in the
>> > > > classpath before I start Tomcat/Trinidad (put them in the lib
>> folder)
>> > > > This is awkward since I don't know which jar files should be added
>> > > > (it's in a configuration file).
>> > > > Also, I have not managed to get the online backup working in Tomcat
>> > > > even when I add all the jar files to the classpath.
>> > > > It works when I run it standalone by just adding the online jar file
>> > > > at runtime, but not from Tomcat because of some classloading issue ?
>> > > >
>> > > > So, why can't I load the JAR files dynamically like this in Tomcat ?
>> > > > (which is the same as in ruby: require 'myjar.jar')
>> > > >
>> > > >  URL url = getURL(jarFile);
>> > > >  getRuntime().getJRubyClassLoader().addURL(url);
>> > > >
>> > > > Is there an alternative of loading the jar files dynamically at
>> runtime
>> > ?
>> > > > (from
>> > > http://thinkincode.net/2011/02/09/jruby-class-loader-by-example.html)
>> > > >
>> > > > /Andreas
>> > > >
>> > > > On Thu, Feb 17, 2011 at 9:33 AM, Anders Nawroth
>> > > >  wrote:
>> > > >> Hi!
>> > > >>
>> > > >> This is included as a dependency:
>> > > >>
>> > >
>> >
>> org.apache.servicemix.bundles:org.apache.servicemix.bundles.lucene:jar:3.0.1_2:compile
>> > > >>
>> > > >> That's an OSGi-friendly packaging of Lucene.
>> > > >>
>> > > >> /anders
>> > > >>
>> > > >> On 02/17/2011 09:11 AM, Michael Hunger wrote:
>> > > >>>
>> > > >>> Sorry, didn't see your mail (had Andreas' still open for
>> replying).
>> > > >>>
>> > > >>> It worked, thanks very much. But funnily the lucene jar is not
>> > > recognized
>> > > >>> as dependency by maven for the server (mvn
>> > > dependency:copy-dependencies). I
>> > > >>> assume it is added by the server-build project?
>> > > >>>
>> > > >>> Cheers
>> > > >>>
>> > > >>> Michael
>> > > >>>
>> > > >>> Am 17.02.2011 um 08:49 schrieb Mattias Persson:
>> > > >>>
>> > >  It's probably a classpath issue as you say. You added the
>> > >  neo4j-lucene-index-XXX.jar file manually to the classpath, but
>> also
>> > > make
>> > >  sure the lucene-core-3.0.1.jar is on the c

Re: [Neo4j] Question: Neo4j and semantic-mediawiki

2011-02-23 Thread Marko Rodriguez
Hi Alfredas,

One thing I forgot to mention. You can express pattern match queries in Gremlin:
https://github.com/tinkerpop/gremlin/wiki/SPARQL-vs.-Gremlin

While not having the same syntax, you can still do pattern matching as a 
traversal. But yes, I ultimately want to get an extension to Gremlin that 
provides a more SPARQL look-and-feel for property graphs.

Just a heads up,
Marko.

http://markorodriguez.com

On Feb 22, 2011, at 10:24 AM, Alfredas Chmieliauskas wrote:

> Well I'm in general interested in having all these different
> mechanisms (native (traverse), pipes, gremlin, sparql) to query the
> same graph.
> That would give so much more flexibility when writing domain methods.
> Ideally you would not want to write domain methods at all, but
> annotate interfaces with some queries, something like:
> 
> interface PersonRepository {
> 
> @SparqlQuery(query="where {?p foaf:knows ??person . }")
> public List findMyFriends(Person person);
> 
> @GremlinQuery(query="person.bothE('foaf:knows').bothV.except([person])")
> public List findMyFriends2(Person person);
> 
> }
> 
> That would be quite great, but thats of course a bit more JPA inspired
> approach and many other useful roads can be taken...
> 
> Alfredas
> 
> 
> 
> 
> 
> On Tue, Feb 22, 2011 at 6:03 PM, Marko Rodriguez  wrote:
>> Hi,
>> 
>>> Got it. It would be great to be able to use Sparql on neo4j or any
>>> other Blueprint db.
>> 
>> Yea it would.
>> 
>>> 
>>> Do you think it would be possible to map/translate sparql query to
>>> gremlin/pipes?
>> 
>> I plan to create a new DSL over Gremlin/Pipes that has a syntax flavor like 
>> this. E.g.
>> 
>> x = []; y = []
>> g.select(x, y).where(
>>g.v('marko').outE('knows').inV.var(x)
>>var(x).outE('knows').inV.var(y))
>> 
>> EQUIVALENT TO:
>> 
>> SELECT ?x, ?y WHERE {
>>  marko knows ?x
>>  ?x knows ?y
>> }
>> 
>> In short, traversal-based "SPARQL" (similar to the SPARQL engine developed 
>> by Neo4j). The benefits is that a "line" is property graph-based, not 
>> restricted to RDF graphs only. E.g.
>> 
>> x = []; y = []
>> g.select(x, y).where(
>>g.v('marko').outE('knows').inV.var(x)
>>var(x).outE('knows').inV{it.age > 30}.var(y))
>> 
>> I haven't gotten to starting this project yet, but if anyone is interested 
>> in helping, that would be great.
>> 
>> Thanks,
>> Marko.
>> 
>> http://markorodriguez.com
>> 
>> 
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>> 
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

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


Re: [Neo4j] simple traverse question

2011-02-23 Thread Max De Marzi Jr.
Ok it's out there on 0.0.11

Thing is when you add a node to an index (before creating the index),
Neo4j creates the index on its own.

@neo.create_node_index(name, type, provider)   # creates
an index, defaults are "exact" and "lucene"
@neo.create_relationship_index(name, "fulltext")  # creates a
relationship index with "fulltext" option


On Wed, Feb 23, 2011 at 9:57 AM, Max De Marzi Jr.  wrote:
>>>Since I want to later search for nodes by their mysql_id, do I need to 
>>>create an index and add the
> mysql_id to that index?  It appears as if that is the only way to
> efficiently find nodes by a key
> other than their neo generated ID.  Before I went down the path of
> creating indexes, I wanted to
> make sure that is the correct approach.
>
> This is one way... the other way is to store the neo_id in the relational db.
>
>>>It also appears as if the neography gem does not support index creation.
>
> I'll do it today.
>
>
>
>
>
> On Wed, Feb 23, 2011 at 9:50 AM, charlie  wrote:
>> Very nice, thanks.
>>
>> A follow-on question:
>> Since I want to later search for nodes by their mysql_id, do I need to 
>> create an index and add the
>> mysql_id to that index?  It appears as if that is the only way to 
>> efficiently find nodes by a key
>> other than their neo generated ID.  Before I went down the path of creating 
>> indexes, I wanted to
>> make sure that is the correct approach.
>>
>> It also appears as if the neography gem does not support index creation.  I 
>> can easily curl the
>> index creation so it is not a significant issue.  I just wanted to make sure 
>> that I am not missing
>> something in my understanding of neography.
>>
>> thanks again.
>>
>> Charlie White
>> Avvo, Inc.
>> 1218 Third Avenue, Suite 300neo.get_node_relationships(
>> Seattle, WA 98101
>>
>> On Tuesday 22 February 2011 7:48:35 pm Max De Marzi Jr. wrote:
>>> Here you go...
>>>
>>> Full code with setup:
>>>
>>> https://github.com/maxdemarzi/neography/blob/master/examples/traversal_exam
>>>ple2.rb
>>>
>>> Interesting bit:
>>>
>>> def graduated_with_me(student)
>>>   student = student["self"].split('/').last
>>>   student_attended = @neo.get_node_relationships(student)[0]
>>>   graduated = student_attended["data"]["graduated"]
>>>   school = student_attended["end"].split('/').last
>>>
>>>   @neo.traverse(school,"nodes", {"order" => "breadth first",
>>>                                           "uniqueness" => "node global",
>>>                                           "relationships" => {"type"=>
>>> "attended", "direction" => "in"},
>>>                                           "return filter" => {
>>>                                             "language" => "javascript",
>>>                                             "body" => "position.length() ==
>>> 1 &&
>>> position.endNode().getId() != #{student}
>>>                                                        &&
>>> position.lastRelationship().getProperty(\"graduated\") ==
>>> #{graduated};"}})
>>> end
>>>
>>>
>>> Visualize it (sort of... I need to add relationship properties):
>>> http://neovigator.heroku.com/?neoid=201
>>>
>>> Neo4j guys, how do we use the new Evaluator via Rest?
>>>
>>> Thanks,
>>> Max
>>>
>>> On Tue, Feb 22, 2011 at 6:50 PM, charlie  wrote:
>>> > Hi,
>>> > I am new to neo4j and I am having some difficulty figuring out how to
>>> > query it to get me what I need.  We are using Ruby and not JRuby so I am
>>> > trying to do all my queries via the REST API.
>>> >
>>> > Currently I have a set of "people" nodes and a set of "school" nodes.
>>> >  Each node has an id field and a name.  The ID field is not to be
>>> > confused with the ID field assigned by neo, but rather a key into a
>>> > relational database elsewhere.
>>> > I have created a people and school index so I can find the nodes by ids
>>> > curl -H Accept:application/json
>>> > http://localhost:7474/db/data/index/node/person/person_id/28995
>>> >
>>> > I have also created relationships between each person and school called
>>> > "attended".  I set a graduation date and degree name as attributes of
>>> > each attended relationship.
>>> >
>>> > The query that I want to find all people that attended the same school as
>>> > I did and graduated at the same time.
>>> > person => school => person1, person2, ... personN.
>>> >
>>> >
>>> > More advanced:
>>> > Later I might want to add to that people with the same degree as well as
>>> > graduation date.  And, after that, I would probably want to find
>>> > "friends" of those same people.   Of course that implies that I added a
>>> > relationship of "firend" between people.
>>> >
>>> > Any help that you can provide me on this would be helpful.  I think that
>>> > once I get started with a couple of examples, I will be able to take off.
>>> >
>>> > thanks,
>>> >
>>> > Charlie White
>>> > Avvo, Inc.
>>> > 1218 Third Avenue, Suite 300
>>> > Seattle, WA 98101
>>> > ___
>>> > Neo4j mailing list
>>> > User@li

Re: [Neo4j] simple traverse question

2011-02-23 Thread Max De Marzi Jr.
>>Since I want to later search for nodes by their mysql_id, do I need to create 
>>an index and add the
mysql_id to that index?  It appears as if that is the only way to
efficiently find nodes by a key
other than their neo generated ID.  Before I went down the path of
creating indexes, I wanted to
make sure that is the correct approach.

This is one way... the other way is to store the neo_id in the relational db.

>>It also appears as if the neography gem does not support index creation.

I'll do it today.





On Wed, Feb 23, 2011 at 9:50 AM, charlie  wrote:
> Very nice, thanks.
>
> A follow-on question:
> Since I want to later search for nodes by their mysql_id, do I need to create 
> an index and add the
> mysql_id to that index?  It appears as if that is the only way to efficiently 
> find nodes by a key
> other than their neo generated ID.  Before I went down the path of creating 
> indexes, I wanted to
> make sure that is the correct approach.
>
> It also appears as if the neography gem does not support index creation.  I 
> can easily curl the
> index creation so it is not a significant issue.  I just wanted to make sure 
> that I am not missing
> something in my understanding of neography.
>
> thanks again.
>
> Charlie White
> Avvo, Inc.
> 1218 Third Avenue, Suite 300neo.get_node_relationships(
> Seattle, WA 98101
>
> On Tuesday 22 February 2011 7:48:35 pm Max De Marzi Jr. wrote:
>> Here you go...
>>
>> Full code with setup:
>>
>> https://github.com/maxdemarzi/neography/blob/master/examples/traversal_exam
>>ple2.rb
>>
>> Interesting bit:
>>
>> def graduated_with_me(student)
>>   student = student["self"].split('/').last
>>   student_attended = @neo.get_node_relationships(student)[0]
>>   graduated = student_attended["data"]["graduated"]
>>   school = student_attended["end"].split('/').last
>>
>>   @neo.traverse(school,"nodes", {"order" => "breadth first",
>>                                           "uniqueness" => "node global",
>>                                           "relationships" => {"type"=>
>> "attended", "direction" => "in"},
>>                                           "return filter" => {
>>                                             "language" => "javascript",
>>                                             "body" => "position.length() ==
>> 1 &&
>> position.endNode().getId() != #{student}
>>                                                        &&
>> position.lastRelationship().getProperty(\"graduated\") ==
>> #{graduated};"}})
>> end
>>
>>
>> Visualize it (sort of... I need to add relationship properties):
>> http://neovigator.heroku.com/?neoid=201
>>
>> Neo4j guys, how do we use the new Evaluator via Rest?
>>
>> Thanks,
>> Max
>>
>> On Tue, Feb 22, 2011 at 6:50 PM, charlie  wrote:
>> > Hi,
>> > I am new to neo4j and I am having some difficulty figuring out how to
>> > query it to get me what I need.  We are using Ruby and not JRuby so I am
>> > trying to do all my queries via the REST API.
>> >
>> > Currently I have a set of "people" nodes and a set of "school" nodes.
>> >  Each node has an id field and a name.  The ID field is not to be
>> > confused with the ID field assigned by neo, but rather a key into a
>> > relational database elsewhere.
>> > I have created a people and school index so I can find the nodes by ids
>> > curl -H Accept:application/json
>> > http://localhost:7474/db/data/index/node/person/person_id/28995
>> >
>> > I have also created relationships between each person and school called
>> > "attended".  I set a graduation date and degree name as attributes of
>> > each attended relationship.
>> >
>> > The query that I want to find all people that attended the same school as
>> > I did and graduated at the same time.
>> > person => school => person1, person2, ... personN.
>> >
>> >
>> > More advanced:
>> > Later I might want to add to that people with the same degree as well as
>> > graduation date.  And, after that, I would probably want to find
>> > "friends" of those same people.   Of course that implies that I added a
>> > relationship of "firend" between people.
>> >
>> > Any help that you can provide me on this would be helpful.  I think that
>> > once I get started with a couple of examples, I will be able to take off.
>> >
>> > thanks,
>> >
>> > Charlie White
>> > Avvo, Inc.
>> > 1218 Third Avenue, Suite 300
>> > Seattle, WA 98101
>> > ___
>> > Neo4j mailing list
>> > User@lists.neo4j.org
>> > https://lists.neo4j.org/mailman/listinfo/user
>>
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] simple traverse question

2011-02-23 Thread charlie
Very nice, thanks.

A follow-on question: 
Since I want to later search for nodes by their mysql_id, do I need to create 
an index and add the 
mysql_id to that index?  It appears as if that is the only way to efficiently 
find nodes by a key 
other than their neo generated ID.  Before I went down the path of creating 
indexes, I wanted to 
make sure that is the correct approach.

It also appears as if the neography gem does not support index creation.  I can 
easily curl the 
index creation so it is not a significant issue.  I just wanted to make sure 
that I am not missing 
something in my understanding of neography.

thanks again.

Charlie White
Avvo, Inc.
1218 Third Avenue, Suite 300neo.get_node_relationships(
Seattle, WA 98101

On Tuesday 22 February 2011 7:48:35 pm Max De Marzi Jr. wrote:
> Here you go...
>
> Full code with setup:
>
> https://github.com/maxdemarzi/neography/blob/master/examples/traversal_exam
>ple2.rb
>
> Interesting bit:
>
> def graduated_with_me(student)
>   student = student["self"].split('/').last
>   student_attended = @neo.get_node_relationships(student)[0]
>   graduated = student_attended["data"]["graduated"]
>   school = student_attended["end"].split('/').last
>
>   @neo.traverse(school,"nodes", {"order" => "breadth first",
>   "uniqueness" => "node global",
>   "relationships" => {"type"=>
> "attended", "direction" => "in"},
>   "return filter" => {
> "language" => "javascript",
> "body" => "position.length() ==
> 1 &&
> position.endNode().getId() != #{student}
>&&
> position.lastRelationship().getProperty(\"graduated\") ==
> #{graduated};"}})
> end
>
>
> Visualize it (sort of... I need to add relationship properties):
> http://neovigator.heroku.com/?neoid=201
>
> Neo4j guys, how do we use the new Evaluator via Rest?
>
> Thanks,
> Max
>
> On Tue, Feb 22, 2011 at 6:50 PM, charlie  wrote:
> > Hi,
> > I am new to neo4j and I am having some difficulty figuring out how to
> > query it to get me what I need.  We are using Ruby and not JRuby so I am
> > trying to do all my queries via the REST API.
> >
> > Currently I have a set of "people" nodes and a set of "school" nodes.
> >  Each node has an id field and a name.  The ID field is not to be
> > confused with the ID field assigned by neo, but rather a key into a
> > relational database elsewhere.
> > I have created a people and school index so I can find the nodes by ids
> > curl -H Accept:application/json
> > http://localhost:7474/db/data/index/node/person/person_id/28995
> >
> > I have also created relationships between each person and school called
> > "attended".  I set a graduation date and degree name as attributes of
> > each attended relationship.
> >
> > The query that I want to find all people that attended the same school as
> > I did and graduated at the same time.
> > person => school => person1, person2, ... personN.
> >
> >
> > More advanced:
> > Later I might want to add to that people with the same degree as well as
> > graduation date.  And, after that, I would probably want to find
> > "friends" of those same people.   Of course that implies that I added a
> > relationship of "firend" between people.
> >
> > Any help that you can provide me on this would be helpful.  I think that
> > once I get started with a couple of examples, I will be able to take off.
> >
> > thanks,
> >
> > Charlie White
> > Avvo, Inc.
> > 1218 Third Avenue, Suite 300
> > Seattle, WA 98101
> > ___
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user


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


Re: [Neo4j] Neo4J Rest server API

2011-02-23 Thread francoisk6

Hi michael, thx for the reply.

ok, if this is the new way to index:
graphdb.index().forNodes(indexName).add(node,field,value) .
What about the lucene fulltext search and the query search. 
What i need at end of the day, is to index data using java. and then using
the rest api to search for nodes.

My old way:
IndexService index = new LuceneIndexService(graphDb);
IndexService fulltextindex = new LuceneFulltextIndexService(graphDb);
index.index(tempSectorNode, index_name, value);
fulltextindex.index(tempSectorNode, index_name, value);

New way:
graphdb.index().forNodes(indexName).add(node,field,value) 
fulltext ???

I was informed that a non-exact search is not yet available thru rest api.
so i was building an extension to do so.

Thx again Michael and appreciate your help.



-
Regards,
Francois Kassis.
-- 
View this message in context: 
http://neo4j-user-list.438527.n3.nabble.com/Neo4J-Rest-server-API-tp2559737p2560303.html
Sent from the Neo4J User List mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] server with big (huge?) graph

2011-02-23 Thread Kiss Miklós
Thanks for the response.

Then my idea of a server plugin wasn't a bad idea, great.
My next question is then: how do I traverse only a part of the possible 
sub-graph?
I mean: let's suppose I start traversing from node 'A' and want to get 
all 2 length paths on relationships 'TYPE_X' and 'TYPE_Y'. Let's say 
node 'A' has 5000 'TYPE_X' relationships and all connected nodes have 10 
'TYPE_Y' relationships. If I start my traversing from node 'A' on server 
side, how can I stop after fetching 1000 paths and later continue from 
where I stopped? Or am I missing something very important?

I have an idea to put extra nodes into my graph that collect (let's say) 
100 same typed connections and stand as an intermediate node between 'A' 
and 'B'. Using this would allow me to collect all paths between 'A' and 
'B' in multiple steps, each step returning at most 100 paths only. 
However, this scheme is harder to maintain and makes the connections 
harder to read and also has a performance penalty (direct connections 
becoma indirect 2 step connections).

Or is this something very similar that can be achieved with proper 
indexing (like You mentioned)?

Am I on the right way?

Miklós Kiss

2011.02.23. 14:20 keltezéssel, Michael Hunger írta:
> First - you should perhaps write a Server-Plugin that does your heavy
> lifting on the server and provides a REST endpoint to get the results.
> Not sure if non-GET verbs are supported yet (otherwise you can always
> go for an unmanaged extension defining your own resources).
>
> You can do indexing for certain start nodes and then use the traversal
> facilities to update your graph (if this is fitting). E.g. you can use
> the javascript evaluators not only to evaluate/query but also to
> update the graph.
>
> Hope that helps
>
> Michael
>
> We're also thinking about a more terse or binary API that would server
> interaction more efficient but I think that is the wrong direction for
> your usecase. Rather move into the server what belongs there and
> expose appropriate resources for your clients to interact with.
>
> 2011/2/23 Kiss Miklós:
>> Hi all,
>>
>> I'd like to get ideas on how to handle a (relatively) big graph. My
>> graph is stored in a neo4j server. The structure is simple but highly
>> interconnected:
>> - I have nodes containing longer texts
>> - and I have many nodes containing tokens of those texts.
>> Relationships connect tokens to texts so I have many relationships. The
>> actual graph does have many other nodes too but this is irrelevant now.
>> The graph contains 300k nodes, 2.5 million properties and 1 million
>> relationships (and is still growing).
>>
>> My question is how to execute querys from the graph. I have to execute
>> operations that usually require querying huge parts of the graph. I
>> mean: get all the tokens for some of the texts; or even get all the
>> tokens. (I'm creating a text processing system that is learning and the
>> teaching process involves manipulation of all tokens - I think it's much
>> faster executed in memory rather then querying each token separately).
>>
>> The naive solution (traverse the graph from root node with 1 depth to
>> get all the nodes of a certain type) is now unsusabe since my graph is
>> too big. The server simply runs out of memory (I gave it 1024 MB - this
>> is around the maximum until the server gets a separate hardvare).
>>
>> So my question is how to implement correctly and efficiently the
>> querying of the graph? Should I create custom extensions that traverse
>> and return only a part of the graph in such scenario? Or should I insert
>> additional "control" nodes to the graph which can be used as reference
>> points for querying? The main problem is that I have many same typed
>> relationships. I don't know how to manage traversing the graph partially
>> if it is only accessible through the REST protocol.
>>
>> Any help would be appreciated!
>>
>> Thanks in advance,
>> Miklós Kiss
>> ___
>> Neo4j mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
>

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


Re: [Neo4j] Neo4J Rest server API

2011-02-23 Thread Michael Hunger
What was the actual index name you used for indexing?

So the part of your sample app which does:

graphdb.index().forNodes(indexName).add(node,field,value)

Just creating the index-service for the graph-db (which is imho the
old index API anyway) won't index anything.

Michael

On Wed, Feb 23, 2011 at 1:49 PM, francoisk6  wrote:
>
> Dear All,
>
> I a using neo4J 1.2, i filled a sample data and indexed each inserted new
> node using java with:
>
> IndexService index = LuceneIndexService(graphDb)
> IndexService fulltextindex = LuceneFulltextIndexService(graphDb)
>
> but in rest api when using:
> curl -H Accept:application/json http://localhost:7474/db/data/index/node
> I don't get any result.
> Why?
>
> Thx in advance.
> Francois Kassis.
>
>
> -
> Regards,
> Francois Kassis.
> --
> View this message in context: 
> http://neo4j-user-list.438527.n3.nabble.com/Neo4J-Rest-server-API-tp2559737p2559737.html
> Sent from the Neo4J User List mailing list archive at Nabble.com.
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] server with big (huge?) graph

2011-02-23 Thread Michael Hunger
First - you should perhaps write a Server-Plugin that does your heavy
lifting on the server and provides a REST endpoint to get the results.
Not sure if non-GET verbs are supported yet (otherwise you can always
go for an unmanaged extension defining your own resources).

You can do indexing for certain start nodes and then use the traversal
facilities to update your graph (if this is fitting). E.g. you can use
the javascript evaluators not only to evaluate/query but also to
update the graph.

Hope that helps

Michael

We're also thinking about a more terse or binary API that would server
interaction more efficient but I think that is the wrong direction for
your usecase. Rather move into the server what belongs there and
expose appropriate resources for your clients to interact with.

2011/2/23 Kiss Miklós :
> Hi all,
>
> I'd like to get ideas on how to handle a (relatively) big graph. My
> graph is stored in a neo4j server. The structure is simple but highly
> interconnected:
> - I have nodes containing longer texts
> - and I have many nodes containing tokens of those texts.
> Relationships connect tokens to texts so I have many relationships. The
> actual graph does have many other nodes too but this is irrelevant now.
> The graph contains 300k nodes, 2.5 million properties and 1 million
> relationships (and is still growing).
>
> My question is how to execute querys from the graph. I have to execute
> operations that usually require querying huge parts of the graph. I
> mean: get all the tokens for some of the texts; or even get all the
> tokens. (I'm creating a text processing system that is learning and the
> teaching process involves manipulation of all tokens - I think it's much
> faster executed in memory rather then querying each token separately).
>
> The naive solution (traverse the graph from root node with 1 depth to
> get all the nodes of a certain type) is now unsusabe since my graph is
> too big. The server simply runs out of memory (I gave it 1024 MB - this
> is around the maximum until the server gets a separate hardvare).
>
> So my question is how to implement correctly and efficiently the
> querying of the graph? Should I create custom extensions that traverse
> and return only a part of the graph in such scenario? Or should I insert
> additional "control" nodes to the graph which can be used as reference
> points for querying? The main problem is that I have many same typed
> relationships. I don't know how to manage traversing the graph partially
> if it is only accessible through the REST protocol.
>
> Any help would be appreciated!
>
> Thanks in advance,
> Miklós Kiss
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Noob question about performance

2011-02-23 Thread John Nonak
Hi,

Thanks for the details. I did increase the test data and it does slow down a 
lot. At the moment I have 3 nodes and it computes("touches") between 4 and 
8 
millions of nodes for each request :) But still does it in an honorable 5 
seconds average.

I understand what you mean for the node type, but I don't think my code is 
currently loading any node properties as my test assumes the correct sequence 
of 
node types. All I am testing are relationship types.

I am now considering a different algorithm which would only return a limited 
amount of paths, enough to generate an accurate percentage of final 
relationships.

I think that even if I manage to increase the performance I will end up with 
the 
same problem when we will scale the graph. Returning all the paths between two 
nodes might just not be a clever way to handle this :) The number of 
relationships are just growing too fast.

John







From: Craig Taverner 
To: Neo4j user discussions 
Sent: Wed, February 23, 2011 2:14:28 PM
Subject: Re: [Neo4j] Noob question about performance

Another thing to consider is that your traversal is loading node properties,
which can slow it down when compared to a traversal based only on
relationship types. However, having said that, your graph is quite small,
and so the entire graph should fit in memory with the right cache settings,
and then hitting the node properties should not make much difference.

If you are likely to scale this to much, much larger graphs, you might want
to consider restructuring so your traversals do not need to test for the
node type. This is can be possible by implying the node type from the
relationship types. You might need to use more relationship types to do
that.

On Wed, Feb 23, 2011 at 10:08 AM, John Nonak  wrote:

> Hi again,
>
> Well well well, yep the cache did help, even if the queries were different
> ones
> :) It's obviously not just caching the final list of paths, as I naively
> assumed.
>
> I got the requests down to about 150ms which looks much better. I suppose
> with
> proper optimization I could even get better results.
>
>
> Thanks again
> Regards
>
> John
>
>
>
> 
> From: Peter Neubauer 
> To: Neo4j user discussions 
> Sent: Wed, February 23, 2011 10:25:43 AM
> Subject: Re: [Neo4j] Noob question about performance
>
> John,
> how many nodes and relationships do you have in your graph? Are you
> running only once without warming up the caches (you might want to run
> the calculations say 10 times and take the mean)?
>
> Also, it depends on how many nodes you are "touching" during your
> traversals. The number of hops needed to complete a traversal is the
> defining measure for the total time in Neo4j. Maybe you could keep a
> counter in your graph algo and print it out?
>
> Cheers,
>
> /peter neubauer
>
> GTalk:  neubauer.peter
> Skype   peter.neubauer
> Phone   +46 704 106975
> LinkedIn  http://www.linkedin.com/in/neubauer
> Twitter  http://twitter.com/peterneubauer
>
> http://www.neo4j.org   - Your high performance graph database.
> http://startupbootcamp.org/- Öresund - Innovation happens HERE.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
>
> On Wed, Feb 23, 2011 at 9:21 AM, John Nonak  wrote:
> > Hello,
> >
> > I am starting to evaluate neo4j and I wrote some basic test application.
> The
> > results I get are not as fast as I would have wished :) but of course it
> is
> > probably because it is not optimized or simply because my case do not fit
> that
> > well with graph DB.
> >
> > If somebody would have few minutes just to tell me if neo4j is a good
> choice
> >for
> > our application, here the story (sorry for the terminology I use, I m new
> to
> > graph DB in general)
> >
> > - Two types of nodes, A and B
> > - The graph always alternate A and B nodes, path example :  A -> B <- A
> -> B
> > (never A -> A -> B)
> > - Maximum depth of a path is 4, like in the previous example
> > - There are two different types of relationships
> >
> > - The application needs to find all the paths between a given A node and
> a
> >given
> > B node, where the distance between the two nodes is at maximum, and where
> the
> > two first relationships are identical. So for instance I want to find all
> the
> > paths between A1 and B5 with the following graph:
> >
> > A1 --Ra--> B1 <--Ra-- A2 --Ra--> B2
> > A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5
> > A1 --Ra--> B2 <--Rb-- A3 --Ra--> B5
> > A1 --Rb--> B3 <--Rb-- A4 --Rb--> B4
> > A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5
> > A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5
> >
> > So the end result would be
> > A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5 (Same Ra relationships linking A1 and
> A2
> to
> > B1)
> > A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5 (Same Rb relationships linking A1 an
> A4 to
> > B3)
> > A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5 (Same Rb relationships linking A1 an
> A5 to
> > B3)
> >
> > The point is to compute the

[Neo4j] Neo4J Rest server API

2011-02-23 Thread francoisk6

Dear All,

I a using neo4J 1.2, i filled a sample data and indexed each inserted new
node using java with:

IndexService index = LuceneIndexService(graphDb)
IndexService fulltextindex = LuceneFulltextIndexService(graphDb)

but in rest api when using:
curl -H Accept:application/json http://localhost:7474/db/data/index/node
I don't get any result.
Why?

Thx in advance.
Francois Kassis.


-
Regards,
Francois Kassis.
-- 
View this message in context: 
http://neo4j-user-list.438527.n3.nabble.com/Neo4J-Rest-server-API-tp2559737p2559737.html
Sent from the Neo4J User List mailing list archive at Nabble.com.
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] server with big (huge?) graph

2011-02-23 Thread Kiss Miklós
Hi all,

I'd like to get ideas on how to handle a (relatively) big graph. My 
graph is stored in a neo4j server. The structure is simple but highly 
interconnected:
- I have nodes containing longer texts
- and I have many nodes containing tokens of those texts.
Relationships connect tokens to texts so I have many relationships. The 
actual graph does have many other nodes too but this is irrelevant now. 
The graph contains 300k nodes, 2.5 million properties and 1 million 
relationships (and is still growing).

My question is how to execute querys from the graph. I have to execute 
operations that usually require querying huge parts of the graph. I 
mean: get all the tokens for some of the texts; or even get all the 
tokens. (I'm creating a text processing system that is learning and the 
teaching process involves manipulation of all tokens - I think it's much 
faster executed in memory rather then querying each token separately).

The naive solution (traverse the graph from root node with 1 depth to 
get all the nodes of a certain type) is now unsusabe since my graph is 
too big. The server simply runs out of memory (I gave it 1024 MB - this 
is around the maximum until the server gets a separate hardvare).

So my question is how to implement correctly and efficiently the 
querying of the graph? Should I create custom extensions that traverse 
and return only a part of the graph in such scenario? Or should I insert 
additional "control" nodes to the graph which can be used as reference 
points for querying? The main problem is that I have many same typed 
relationships. I don't know how to manage traversing the graph partially 
if it is only accessible through the REST protocol.

Any help would be appreciated!

Thanks in advance,
Miklós Kiss
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Noob question about performance

2011-02-23 Thread Craig Taverner
Another thing to consider is that your traversal is loading node properties,
which can slow it down when compared to a traversal based only on
relationship types. However, having said that, your graph is quite small,
and so the entire graph should fit in memory with the right cache settings,
and then hitting the node properties should not make much difference.

If you are likely to scale this to much, much larger graphs, you might want
to consider restructuring so your traversals do not need to test for the
node type. This is can be possible by implying the node type from the
relationship types. You might need to use more relationship types to do
that.

On Wed, Feb 23, 2011 at 10:08 AM, John Nonak  wrote:

> Hi again,
>
> Well well well, yep the cache did help, even if the queries were different
> ones
> :) It's obviously not just caching the final list of paths, as I naively
> assumed.
>
> I got the requests down to about 150ms which looks much better. I suppose
> with
> proper optimization I could even get better results.
>
>
> Thanks again
> Regards
>
> John
>
>
>
> 
> From: Peter Neubauer 
> To: Neo4j user discussions 
> Sent: Wed, February 23, 2011 10:25:43 AM
> Subject: Re: [Neo4j] Noob question about performance
>
> John,
> how many nodes and relationships do you have in your graph? Are you
> running only once without warming up the caches (you might want to run
> the calculations say 10 times and take the mean)?
>
> Also, it depends on how many nodes you are "touching" during your
> traversals. The number of hops needed to complete a traversal is the
> defining measure for the total time in Neo4j. Maybe you could keep a
> counter in your graph algo and print it out?
>
> Cheers,
>
> /peter neubauer
>
> GTalk:  neubauer.peter
> Skype   peter.neubauer
> Phone   +46 704 106975
> LinkedIn   http://www.linkedin.com/in/neubauer
> Twitter  http://twitter.com/peterneubauer
>
> http://www.neo4j.org   - Your high performance graph database.
> http://startupbootcamp.org/- Öresund - Innovation happens HERE.
> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.
>
>
>
> On Wed, Feb 23, 2011 at 9:21 AM, John Nonak  wrote:
> > Hello,
> >
> > I am starting to evaluate neo4j and I wrote some basic test application.
> The
> > results I get are not as fast as I would have wished :) but of course it
> is
> > probably because it is not optimized or simply because my case do not fit
> that
> > well with graph DB.
> >
> > If somebody would have few minutes just to tell me if neo4j is a good
> choice
> >for
> > our application, here the story (sorry for the terminology I use, I m new
> to
> > graph DB in general)
> >
> > - Two types of nodes, A and B
> > - The graph always alternate A and B nodes, path example :  A -> B <- A
> -> B
> > (never A -> A -> B)
> > - Maximum depth of a path is 4, like in the previous example
> > - There are two different types of relationships
> >
> > - The application needs to find all the paths between a given A node and
> a
> >given
> > B node, where the distance between the two nodes is at maximum, and where
> the
> > two first relationships are identical. So for instance I want to find all
> the
> > paths between A1 and B5 with the following graph:
> >
> > A1 --Ra--> B1 <--Ra-- A2 --Ra--> B2
> > A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5
> > A1 --Ra--> B2 <--Rb-- A3 --Ra--> B5
> > A1 --Rb--> B3 <--Rb-- A4 --Rb--> B4
> > A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5
> > A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5
> >
> > So the end result would be
> > A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5 (Same Ra relationships linking A1 and
> A2
> to
> > B1)
> > A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5 (Same Rb relationships linking A1 an
> A4 to
> > B3)
> > A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5 (Same Rb relationships linking A1 an
> A5 to
> > B3)
> >
> > The point is to compute the amount of final relationship types between a
> node
> A
> > and B. So in this case we have 2 Ra types and 1 Rb type between  A1 and
> B5.
> >
> > Hope this is clear enough :)
> >
> >
> > I run my test with the following data:
> > - 1000 A nodes
> > - 100 B nodes
> > - Random linking between A and B nodes. Between 20 and 50 relations ships
> for
> > each single A node to B nodes.
> >
> > I made two different implementations:
> >
> > 1) Extend the AllPaths class from the graphalgo lib and modify the filter
> to
> > analyze the two first relationships
> > 2) Similar to AllPaths implementation but with the use of an Evaluator to
> > analyze the two first relationships but also exclude wrong path faster
> >
> > Once I get the paths I iterate them to compute the total of final Ra and
> Rb
> > relationships.
> >
> > The result for all paths between two specifics nodes A and B returns 2573
> > different paths
> >
> > Implementation (1) processes it in about 1150-1250ms
> > Implementation (2) processes it in about 950~1050ms
> >
> > I tried to tweak the mapped memory config, but so far th

Re: [Neo4j] Gremlin from Java Error

2011-02-23 Thread Alfredas Chmieliauskas
On Tue, Feb 22, 2011 at 4:26 PM, Marko Rodriguez  wrote:
> Hey,
>
>> Thanks a lot. Updated to 0.8-SNAPSHOT. Strangely maven did not resolve
>> groovy dependence automatically. Had to add it by hand.
>
> Huh? Gremlin 0.8-SNAPSHOT uses Groovy 1.7.8 (which was released maybe 1 week 
> ago). Gremlin 0.7 was using Groovy 1.7.5. Perhaps something about that was 
> making it burp? What do you mean "add it by hand?"

I had to add a dependency to groovy in my pom file, i did not need
that with 0.7 (it was inherited?).

>
>> ScriptEngine approach works fine, Gremlin.compile(expr) does not?
>
> Were you compiling a Pipe or a Gremlin statement? Compile can only be used to 
> create a Pipe:
>        public static Pipe compile(final String gremlin);
> See the first section of: 
> https://github.com/tinkerpop/gremlin/wiki/Using-Gremlin-through-Java
>
> If you want to do an arbitrary Gremlin statement, then you use 
> GremlinScriptEngine.eval();
>
> ?? Or, is it because you haven't linked Groovy into your project. Realize 
> that Gremlin class is Gremlin.groovy, not Gremlin.java. Thus, you need to 
> make sure you have gmaven-pluggin support in your pom.xml. See the second 
> section of:
>        https://github.com/tinkerpop/gremlin/wiki/Using-Gremlin-through-Groovy
>
I have that. Read the docs.

>> I understand that it could be faster&cleaner to use groovy, but I need
>> to be able to pass string queries and get results back.
>> In my use-case this is the definite use of gremlin - arbitrary string
>> queries.
>
> Gotcha.
>
>> For "static" business logic I can use Pipes - I'm not
>> bothered by the wordy expressions.
>
>
> Cool. You can get around that by using Gremlin.compile() :P. In that way, you 
> can compile a Gremlin statement to get the raw Pipes.

I like that idea. But still could not get it to work. Will try to
reproduce and send the trace.


Thanks,

A
>
> Enjoy,
> Marko.
>
> http://markorodriguez.com
>
>
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Noob question about performance

2011-02-23 Thread John Nonak
Hi again,

Well well well, yep the cache did help, even if the queries were different ones 
:) It's obviously not just caching the final list of paths, as I naively 
assumed.

I got the requests down to about 150ms which looks much better. I suppose with 
proper optimization I could even get better results.


Thanks again
Regards

John




From: Peter Neubauer 
To: Neo4j user discussions 
Sent: Wed, February 23, 2011 10:25:43 AM
Subject: Re: [Neo4j] Noob question about performance

John,
how many nodes and relationships do you have in your graph? Are you
running only once without warming up the caches (you might want to run
the calculations say 10 times and take the mean)?

Also, it depends on how many nodes you are "touching" during your
traversals. The number of hops needed to complete a traversal is the
defining measure for the total time in Neo4j. Maybe you could keep a
counter in your graph algo and print it out?

Cheers,

/peter neubauer

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

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



On Wed, Feb 23, 2011 at 9:21 AM, John Nonak  wrote:
> Hello,
>
> I am starting to evaluate neo4j and I wrote some basic test application. The
> results I get are not as fast as I would have wished :) but of course it is
> probably because it is not optimized or simply because my case do not fit that
> well with graph DB.
>
> If somebody would have few minutes just to tell me if neo4j is a good choice 
>for
> our application, here the story (sorry for the terminology I use, I m new to
> graph DB in general)
>
> - Two types of nodes, A and B
> - The graph always alternate A and B nodes, path example :  A -> B <- A -> B
> (never A -> A -> B)
> - Maximum depth of a path is 4, like in the previous example
> - There are two different types of relationships
>
> - The application needs to find all the paths between a given A node and a 
>given
> B node, where the distance between the two nodes is at maximum, and where the
> two first relationships are identical. So for instance I want to find all the
> paths between A1 and B5 with the following graph:
>
> A1 --Ra--> B1 <--Ra-- A2 --Ra--> B2
> A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5
> A1 --Ra--> B2 <--Rb-- A3 --Ra--> B5
> A1 --Rb--> B3 <--Rb-- A4 --Rb--> B4
> A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5
> A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5
>
> So the end result would be
> A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5 (Same Ra relationships linking A1 and A2 
to
> B1)
> A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5 (Same Rb relationships linking A1 an A4 to
> B3)
> A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5 (Same Rb relationships linking A1 an A5 to
> B3)
>
> The point is to compute the amount of final relationship types between a node 
A
> and B. So in this case we have 2 Ra types and 1 Rb type between  A1 and B5.
>
> Hope this is clear enough :)
>
>
> I run my test with the following data:
> - 1000 A nodes
> - 100 B nodes
> - Random linking between A and B nodes. Between 20 and 50 relations ships for
> each single A node to B nodes.
>
> I made two different implementations:
>
> 1) Extend the AllPaths class from the graphalgo lib and modify the filter to
> analyze the two first relationships
> 2) Similar to AllPaths implementation but with the use of an Evaluator to
> analyze the two first relationships but also exclude wrong path faster
>
> Once I get the paths I iterate them to compute the total of final Ra and Rb
> relationships.
>
> The result for all paths between two specifics nodes A and B returns 2573
> different paths
>
> Implementation (1) processes it in about 1150-1250ms
> Implementation (2) processes it in about 950~1050ms
>
> I tried to tweak the mapped memory config, but so far this is as good as I
> manage to get it. I am using the embedded java version of neo4j.
>
> I believe that the more nodes and relationships I will add the more time it 
>will
> take to compute. So the big questions are:
>
> - Does this scenario makes any sense under neo4j/GraphDB?
> - Are the performances that I am getting normal considering the case or is 
>there
> something I am missing or doing wrong?
>
>
> Thank you for your time.
> Regards
>
> Nonak
>
>
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user



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


Re: [Neo4j] Noob question about performance

2011-02-23 Thread John Nonak
Hi Peter,

and thank you for your time.

So I have 1100 nodes and 34616 relationships.

The test runs once and then shutdown, so yes I could try to ran it multiple 
times before shutting down. However a particular request between nodes A and B 
will probably not ran multiple times, so I am not sure if cache would help in 
our scenario. But anyway, I will check what are the results.

About the amount of "touches", I m not sure exactly what you mean but if you 
mean how many times the "evaluate" method of the Evaluator is called (which I 
guess is how many nodes are being processed), the result is 276585 (can that be 
right?)

I realize that my scenario is a bit special and there might not be much we can 
do, but I just wanted to make sure if this "issue" is coming from my scenario 
or 
from a misuse of neo4j from my side.

I should also consider a different algorithm. I m so new to graphDB that I 
actually don't know what type of request is more efficient than another. Lot to 
study I suppose :)

Thanks again for your help.
Regards.

John





From: Peter Neubauer 
To: Neo4j user discussions 
Sent: Wed, February 23, 2011 10:25:43 AM
Subject: Re: [Neo4j] Noob question about performance

John,
how many nodes and relationships do you have in your graph? Are you
running only once without warming up the caches (you might want to run
the calculations say 10 times and take the mean)?

Also, it depends on how many nodes you are "touching" during your
traversals. The number of hops needed to complete a traversal is the
defining measure for the total time in Neo4j. Maybe you could keep a
counter in your graph algo and print it out?

Cheers,

/peter neubauer

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

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



On Wed, Feb 23, 2011 at 9:21 AM, John Nonak  wrote:
> Hello,
>
> I am starting to evaluate neo4j and I wrote some basic test application. The
> results I get are not as fast as I would have wished :) but of course it is
> probably because it is not optimized or simply because my case do not fit that
> well with graph DB.
>
> If somebody would have few minutes just to tell me if neo4j is a good choice 
>for
> our application, here the story (sorry for the terminology I use, I m new to
> graph DB in general)
>
> - Two types of nodes, A and B
> - The graph always alternate A and B nodes, path example :  A -> B <- A -> B
> (never A -> A -> B)
> - Maximum depth of a path is 4, like in the previous example
> - There are two different types of relationships
>
> - The application needs to find all the paths between a given A node and a 
>given
> B node, where the distance between the two nodes is at maximum, and where the
> two first relationships are identical. So for instance I want to find all the
> paths between A1 and B5 with the following graph:
>
> A1 --Ra--> B1 <--Ra-- A2 --Ra--> B2
> A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5
> A1 --Ra--> B2 <--Rb-- A3 --Ra--> B5
> A1 --Rb--> B3 <--Rb-- A4 --Rb--> B4
> A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5
> A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5
>
> So the end result would be
> A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5 (Same Ra relationships linking A1 and A2 
to
> B1)
> A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5 (Same Rb relationships linking A1 an A4 to
> B3)
> A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5 (Same Rb relationships linking A1 an A5 to
> B3)
>
> The point is to compute the amount of final relationship types between a node 
A
> and B. So in this case we have 2 Ra types and 1 Rb type between  A1 and B5.
>
> Hope this is clear enough :)
>
>
> I run my test with the following data:
> - 1000 A nodes
> - 100 B nodes
> - Random linking between A and B nodes. Between 20 and 50 relations ships for
> each single A node to B nodes.
>
> I made two different implementations:
>
> 1) Extend the AllPaths class from the graphalgo lib and modify the filter to
> analyze the two first relationships
> 2) Similar to AllPaths implementation but with the use of an Evaluator to
> analyze the two first relationships but also exclude wrong path faster
>
> Once I get the paths I iterate them to compute the total of final Ra and Rb
> relationships.
>
> The result for all paths between two specifics nodes A and B returns 2573
> different paths
>
> Implementation (1) processes it in about 1150-1250ms
> Implementation (2) processes it in about 950~1050ms
>
> I tried to tweak the mapped memory config, but so far this is as good as I
> manage to get it. I am using the embedded java version of neo4j.
>
> I believe that the more nodes and relationships I will add the more time it 
>will
> take to compute. So the big questions are:
>
> - Does this scenario makes any 

Re: [Neo4j] Noob question about performance

2011-02-23 Thread Peter Neubauer
John,
how many nodes and relationships do you have in your graph? Are you
running only once without warming up the caches (you might want to run
the calculations say 10 times and take the mean)?

Also, it depends on how many nodes you are "touching" during your
traversals. The number of hops needed to complete a traversal is the
defining measure for the total time in Neo4j. Maybe you could keep a
counter in your graph algo and print it out?

Cheers,

/peter neubauer

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

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



On Wed, Feb 23, 2011 at 9:21 AM, John Nonak  wrote:
> Hello,
>
> I am starting to evaluate neo4j and I wrote some basic test application. The
> results I get are not as fast as I would have wished :) but of course it is
> probably because it is not optimized or simply because my case do not fit that
> well with graph DB.
>
> If somebody would have few minutes just to tell me if neo4j is a good choice 
> for
> our application, here the story (sorry for the terminology I use, I m new to
> graph DB in general)
>
> - Two types of nodes, A and B
> - The graph always alternate A and B nodes, path example :  A -> B <- A -> B
> (never A -> A -> B)
> - Maximum depth of a path is 4, like in the previous example
> - There are two different types of relationships
>
> - The application needs to find all the paths between a given A node and a 
> given
> B node, where the distance between the two nodes is at maximum, and where the
> two first relationships are identical. So for instance I want to find all the
> paths between A1 and B5 with the following graph:
>
> A1 --Ra--> B1 <--Ra-- A2 --Ra--> B2
> A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5
> A1 --Ra--> B2 <--Rb-- A3 --Ra--> B5
> A1 --Rb--> B3 <--Rb-- A4 --Rb--> B4
> A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5
> A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5
>
> So the end result would be
> A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5 (Same Ra relationships linking A1 and A2 
> to
> B1)
> A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5 (Same Rb relationships linking A1 an A4 to
> B3)
> A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5 (Same Rb relationships linking A1 an A5 to
> B3)
>
> The point is to compute the amount of final relationship types between a node 
> A
> and B. So in this case we have 2 Ra types and 1 Rb type between  A1 and B5.
>
> Hope this is clear enough :)
>
>
> I run my test with the following data:
> - 1000 A nodes
> - 100 B nodes
> - Random linking between A and B nodes. Between 20 and 50 relations ships for
> each single A node to B nodes.
>
> I made two different implementations:
>
> 1) Extend the AllPaths class from the graphalgo lib and modify the filter to
> analyze the two first relationships
> 2) Similar to AllPaths implementation but with the use of an Evaluator to
> analyze the two first relationships but also exclude wrong path faster
>
> Once I get the paths I iterate them to compute the total of final Ra and Rb
> relationships.
>
> The result for all paths between two specifics nodes A and B returns 2573
> different paths
>
> Implementation (1) processes it in about 1150-1250ms
> Implementation (2) processes it in about 950~1050ms
>
> I tried to tweak the mapped memory config, but so far this is as good as I
> manage to get it. I am using the embedded java version of neo4j.
>
> I believe that the more nodes and relationships I will add the more time it 
> will
> take to compute. So the big questions are:
>
> - Does this scenario makes any sense under neo4j/GraphDB?
> - Are the performances that I am getting normal considering the case or is 
> there
> something I am missing or doing wrong?
>
>
> Thank you for your time.
> Regards
>
> Nonak
>
>
>
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo4j] Noob question about performance

2011-02-23 Thread John Nonak
Hello,

I am starting to evaluate neo4j and I wrote some basic test application. The 
results I get are not as fast as I would have wished :) but of course it is 
probably because it is not optimized or simply because my case do not fit that 
well with graph DB.

If somebody would have few minutes just to tell me if neo4j is a good choice 
for 
our application, here the story (sorry for the terminology I use, I m new to 
graph DB in general)

- Two types of nodes, A and B
- The graph always alternate A and B nodes, path example :  A -> B <- A -> B  
(never A -> A -> B)
- Maximum depth of a path is 4, like in the previous example
- There are two different types of relationships

- The application needs to find all the paths between a given A node and a 
given 
B node, where the distance between the two nodes is at maximum, and where the 
two first relationships are identical. So for instance I want to find all the 
paths between A1 and B5 with the following graph:

A1 --Ra--> B1 <--Ra-- A2 --Ra--> B2
A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5
A1 --Ra--> B2 <--Rb-- A3 --Ra--> B5
A1 --Rb--> B3 <--Rb-- A4 --Rb--> B4
A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5
A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5

So the end result would be 
A1 --Ra--> B1 <--Ra-- A2 --Ra--> B5 (Same Ra relationships linking A1 and A2 to 
B1)
A1 --Rb--> B3 <--Rb-- A4 --Ra--> B5 (Same Rb relationships linking A1 an A4 to 
B3)
A1 --Rb--> B3 <--Rb-- A5 --Rb--> B5 (Same Rb relationships linking A1 an A5 to 
B3)

The point is to compute the amount of final relationship types between a node A 
and B. So in this case we have 2 Ra types and 1 Rb type between  A1 and B5.

Hope this is clear enough :)


I run my test with the following data:
- 1000 A nodes
- 100 B nodes
- Random linking between A and B nodes. Between 20 and 50 relations ships for 
each single A node to B nodes.

I made two different implementations:

1) Extend the AllPaths class from the graphalgo lib and modify the filter to 
analyze the two first relationships
2) Similar to AllPaths implementation but with the use of an Evaluator to 
analyze the two first relationships but also exclude wrong path faster

Once I get the paths I iterate them to compute the total of final Ra and Rb 
relationships.

The result for all paths between two specifics nodes A and B returns 2573 
different paths

Implementation (1) processes it in about 1150-1250ms
Implementation (2) processes it in about 950~1050ms

I tried to tweak the mapped memory config, but so far this is as good as I 
manage to get it. I am using the embedded java version of neo4j.

I believe that the more nodes and relationships I will add the more time it 
will 
take to compute. So the big questions are: 

- Does this scenario makes any sense under neo4j/GraphDB?
- Are the performances that I am getting normal considering the case or is 
there 
something I am missing or doing wrong?


Thank you for your time.
Regards

Nonak


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