Re: [Neo4j] Node Id generation deadlock

2011-11-03 Thread Yaniv Ben Yosef
Hi,

I've also been wondering about this subject.
According to the Neo4J design guide (
http://wiki.neo4j.org/content/Design_Guide) the factory node and id
generator patterns are the way to implement sequential ID generation.
However, according to this thread, it sounds like in a multi-threaded
environment I have one of two choices:
1. lock the factory node. However this will force transaction
serialization. That's not practical in my app.
2. reducing the granularity of the transactions - in the sense that each
transaction should only contain one node creation (of the same type, i.e.
uses the same factory node). That's not practical for me either, because in
several cases I would like to create more than one node in the same
transaction.
Since the design guide recommends the factory node pattern, I'm wondering
if there's anything I'm missing here, or that I should just avoid this
pattern and use some other ID generation mechanism.

Thanks,
Yaniv


On Thu, Nov 3, 2011 at 11:13 AM, Mattias Persson
wrote:

> 2011/11/3 Cres 
>
> > This solution would have been ok if I had only one node created from that
> > factory in each transaction.
> >
> > It doesn't matter... after factory.setProperty is run that transaction
> has
> got a write lock on that factory node which is held until the transaction
> committs. The benefit you get from my proposal would be that you make sure
> you read the correct value.
>
>
> > however, as shown in the sample code I posted in the original message, I
> > have multiple nodes created in one transaction, and multiple such
> > transactions in multiple threads.
> > So while the creation of the actual nodes will of course be serialized,
> one
> > thread's transaction will have to wait for the other thread's transaction
> > to
> > finish completely, and so if the first thread has some processing to do
> > between the creation of the first and second nodes, the other third won't
> > be
> > able to create its two nodes in the meanwhile, because the first thread
> > will
> > have the lock on the factory node until the entire transaction completes.
> >
> > I'm looking for a way to do this having the nodes creation serialized but
> > without having the entire transactions serialized, possibly by somehow
> > releasing the lock on the factory node in mid-transaction, or by any
> other
> > method.
> >
> > Thanks again,
> > Ran.
> >
> > --
> > View this message in context:
> >
> http://neo4j-community-discussions.438527.n3.nabble.com/Node-Id-generation-deadlock-tp3473118p3476498.html
> > Sent from the Neo4j Community Discussions mailing list archive at
> > Nabble.com.
> > ___
> > Neo4j mailing list
> > User@lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
>
>
>
> --
> Mattias Persson, [matt...@neotechnology.com]
> Hacker, Neo Technology
> www.neotechnology.com
> ___
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Querying a full text index

2011-09-07 Thread Yaniv Ben Yosef
Hi Axel,

I've read the syntax, which is why I was surprised. There are wildcard
options in the syntax, e.g.: test* and test? and even te*st.
So I would expect that [director*] should return director and directory.
[director], if I understand the syntax correctly, should return just
director.
But actually, it also returns director and directory in my code.
This means that [director] is equivalent to [director*], which I find a bit
strange.

In your example - the query ["director"] also returns both director and
directory.
The only thing that works is [+director].

Thing is, I don't want to force my users to remember advanced syntax and
append a + to each word. And I also don't want to start parsing queries.
I imagine that the syntax in the Lucene documentation should work (i.e.,
[director] *should not* be equivalent to [director*]. It's either a bug
somewhere, or I'm not configuring/using something correctly.
Anyone has an idea?

Thanks again,

--- Yaniv



On Wed, Sep 7, 2011 at 8:31 PM, Axel Morgner  wrote:

> Hi Yaniv,
>
> didn't try your case, just read the code. If I remember correctly, it may
> help to expand your search term "director john" into a Lucene query, e.g.
> something like "\"director\" OR \"john\"".
>
> The complete Lucene query syntax see [1].
>
> Greetings
>
> Axel
>
> [1] http://lucene.apache.org/java/3_1_0/queryparsersyntax.html
>
> Am 07.09.2011 um 12:16 schrieb Yaniv Ben Yosef:
>
> > Hi,
> >
> > This question may be Lucene related, but since I'm using it via Neo4J I'm
> > asking here first. I'm using Neo4J 1.4 M06.
> > I have a graph representing people, with a few properties about each
> person
> > (e.g., their name and job title).
> > Now I'd like to create a search form that will allow the user to enter
> > either the person's first name, last name, title, or any combination. For
> > example, the query [john director] should result with all the people
> whose
> > name or title contain both john and director.
> > To play with that, I created this little psvm:
> >
> > public class FullTextIndexTest
> > {
> >public static void main(String[] args)
> >{
> >GraphDatabaseService graphDb =
> > GraphDatabaseServiceFactory.createGraphDatabase("target/var/db");
> >
> >Transaction t = graphDb.beginTx();
> >Node n1 = graphDb.createNode();
> >n1.setProperty("name", "John Smith");
> >n1.setProperty("title", "Directory Manager");
> >
> >Node n2 = graphDb.createNode();
> >n2.setProperty("name", "Johnny Malkovich");
> >n2.setProperty("title", "Director of R&D");
> >
> >Node n3 = graphDb.createNode();
> >n3.setProperty("name", "John Horovich");
> >n3.setProperty("title", "Sr. Director");
> >
> >IndexManager index = graphDb.index();
> >Index fulltextPerson = index.forNodes("person-fulltext",
> >MapUtil.stringMap(IndexManager.PROVIDER, "lucene", "type",
> > "fulltext"));
> >fulltextPerson.add(n1, "combined", n1.getProperty("name") + " " +
> > n1.getProperty("title"));
> >fulltextPerson.add(n2, "combined", n2.getProperty("name") + " " +
> > n2.getProperty("title"));
> >fulltextPerson.add(n3, "combined", n3.getProperty("name") + " " +
> > n3.getProperty("title"));
> >t.success();
> >t.finish();
> >
> >// search in the fulltext index
> >IndexHits hits = fulltextPerson.query("combined", "director
> > john");
> >System.out.printf("Found %d results:\n", hits.size());
> >for (Node node : hits)
> >{
> >System.out.println(node.getProperty("name") + ", " +
> > node.getProperty("title"));
> >}
> >}
> > }
> >
> >
> > I expected this program to return 1 result: John Horovich, Sr. Director
> > Instead, I'm getting 3:
> >
> > John Horovich, Sr. Director
> > John Smith, Directory Manager
> > Johnny Malkovich, Director of R&D
> >
> > It seems that Lucene will "accept" terms that contain a query term (e.g,
> > Directory and Johnny) even if I'm not using any wildcards in my query.
> How
> > do I turn this behavior off? I'd like the results to contain only people
> > whose name or title *contain* the word john, but not johnny.
> >
> > Thanks!
> > --- Yaniv
> > ___
> > 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] Querying a full text index

2011-09-07 Thread Yaniv Ben Yosef
Hi Rick,

Thanks, I will try upgrading and see if it fixes the issue. I have a feeling
that I'm missing something here though..

--- Yaniv



On Wed, Sep 7, 2011 at 2:16 PM, Rick Bullotta
wrote:

> While I don't know that it will change anything, any reason that you're
> using M06 and not 1.4.1?  There have been quite a few important fixes.
>  Also, the analyzer that is used to tokenize both the indexed content and
> the query have an effect on the query processing.  In any case, I would
> update to 1.4.1 so that diagnosing the issues would be significantly easier.
>
> 
> From: user-boun...@lists.neo4j.org [user-boun...@lists.neo4j.org] On
> Behalf Of Yaniv Ben Yosef [yani...@gmail.com]
> Sent: Wednesday, September 07, 2011 6:16 AM
> To: Neo4j user discussions
> Subject: [Neo4j] Querying a full text index
>
> Hi,
>
> This question may be Lucene related, but since I'm using it via Neo4J I'm
> asking here first. I'm using Neo4J 1.4 M06.
> I have a graph representing people, with a few properties about each person
> (e.g., their name and job title).
> Now I'd like to create a search form that will allow the user to enter
> either the person's first name, last name, title, or any combination. For
> example, the query [john director] should result with all the people whose
> name or title contain both john and director.
> To play with that, I created this little psvm:
>
> public class FullTextIndexTest
> {
>public static void main(String[] args)
>{
>GraphDatabaseService graphDb =
> GraphDatabaseServiceFactory.createGraphDatabase("target/var/db");
>
>Transaction t = graphDb.beginTx();
>Node n1 = graphDb.createNode();
>n1.setProperty("name", "John Smith");
>n1.setProperty("title", "Directory Manager");
>
>Node n2 = graphDb.createNode();
>n2.setProperty("name", "Johnny Malkovich");
>n2.setProperty("title", "Director of R&D");
>
>Node n3 = graphDb.createNode();
>n3.setProperty("name", "John Horovich");
>n3.setProperty("title", "Sr. Director");
>
>IndexManager index = graphDb.index();
>Index fulltextPerson = index.forNodes("person-fulltext",
>MapUtil.stringMap(IndexManager.PROVIDER, "lucene", "type",
> "fulltext"));
>fulltextPerson.add(n1, "combined", n1.getProperty("name") + " " +
> n1.getProperty("title"));
>fulltextPerson.add(n2, "combined", n2.getProperty("name") + " " +
> n2.getProperty("title"));
>fulltextPerson.add(n3, "combined", n3.getProperty("name") + " " +
> n3.getProperty("title"));
>t.success();
>t.finish();
>
>// search in the fulltext index
>IndexHits hits = fulltextPerson.query("combined", "director
> john");
>System.out.printf("Found %d results:\n", hits.size());
>for (Node node : hits)
>{
>System.out.println(node.getProperty("name") + ", " +
> node.getProperty("title"));
>}
>}
> }
>
>
> I expected this program to return 1 result: John Horovich, Sr. Director
> Instead, I'm getting 3:
>
> John Horovich, Sr. Director
> John Smith, Directory Manager
> Johnny Malkovich, Director of R&D
>
> It seems that Lucene will "accept" terms that contain a query term (e.g,
> Directory and Johnny) even if I'm not using any wildcards in my query. How
> do I turn this behavior off? I'd like the results to contain only people
> whose name or title *contain* the word john, but not johnny.
>
> Thanks!
> --- Yaniv
> ___
> 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] Querying a full text index

2011-09-07 Thread Yaniv Ben Yosef
Hi,

This question may be Lucene related, but since I'm using it via Neo4J I'm
asking here first. I'm using Neo4J 1.4 M06.
I have a graph representing people, with a few properties about each person
(e.g., their name and job title).
Now I'd like to create a search form that will allow the user to enter
either the person's first name, last name, title, or any combination. For
example, the query [john director] should result with all the people whose
name or title contain both john and director.
To play with that, I created this little psvm:

public class FullTextIndexTest
{
public static void main(String[] args)
{
GraphDatabaseService graphDb =
GraphDatabaseServiceFactory.createGraphDatabase("target/var/db");

Transaction t = graphDb.beginTx();
Node n1 = graphDb.createNode();
n1.setProperty("name", "John Smith");
n1.setProperty("title", "Directory Manager");

Node n2 = graphDb.createNode();
n2.setProperty("name", "Johnny Malkovich");
n2.setProperty("title", "Director of R&D");

Node n3 = graphDb.createNode();
n3.setProperty("name", "John Horovich");
n3.setProperty("title", "Sr. Director");

IndexManager index = graphDb.index();
Index fulltextPerson = index.forNodes("person-fulltext",
MapUtil.stringMap(IndexManager.PROVIDER, "lucene", "type",
"fulltext"));
fulltextPerson.add(n1, "combined", n1.getProperty("name") + " " +
n1.getProperty("title"));
fulltextPerson.add(n2, "combined", n2.getProperty("name") + " " +
n2.getProperty("title"));
fulltextPerson.add(n3, "combined", n3.getProperty("name") + " " +
n3.getProperty("title"));
t.success();
t.finish();

// search in the fulltext index
IndexHits hits = fulltextPerson.query("combined", "director
john");
System.out.printf("Found %d results:\n", hits.size());
for (Node node : hits)
{
System.out.println(node.getProperty("name") + ", " +
node.getProperty("title"));
}
}
}


I expected this program to return 1 result: John Horovich, Sr. Director
Instead, I'm getting 3:

John Horovich, Sr. Director
John Smith, Directory Manager
Johnny Malkovich, Director of R&D

It seems that Lucene will "accept" terms that contain a query term (e.g,
Directory and Johnny) even if I'm not using any wildcards in my query. How
do I turn this behavior off? I'd like the results to contain only people
whose name or title *contain* the word john, but not johnny.

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


Re: [Neo4j] Modeling inheritance in Neo4J

2010-11-25 Thread Yaniv Ben Yosef
Craig,

I like the tag tree idea. Quite flexible indeed.

Thanks!

--- Yaniv



On Thu, Nov 25, 2010 at 1:59 PM, Craig Taverner  wrote:

> Another factor to consider is multiple inheritance, where you are grouping
> the people into overlapping groups. For example, you can have the
> users/non.users split, but also perhaps a man/woman split, and this results
> in four types. If you are concerned about having to restructure the graph
> when adding new types, then I would suggest using a tag approach. This
> means
> you forget about inheritance, keep all person nodes directly under people,
> and add tags to the person as and when you need to.
>
> There are two ways to add a tag:
>
>   - Have a ref->tags->tag tree along side your ref->people->person tree,
>   and then you can cross link individual tag nodes to person nodes as an
> when
>   you want. This is very dynamic and easy to maintain. If your GUI allows
>   users to add tags, you can support that also, by adding missing tags if
>   needed.
>   - Use lucene, by adding a tags string property to the person and indexing
>   that. This allows for free-form tagging, but does make the whole thing
> less
>   definitive.
>
> My preference, as usual with such things, is to build a graph for it :-)
> (ie. the tag tree).
>
> On Thu, Nov 25, 2010 at 12:49 PM, Yaniv Ben Yosef 
> wrote:
>
> > Hi,
> >
> > I'm looking for best practices in modeling inheritance in Neo4J.
> > Suppose I have a Person class. In the DB I naturally have a node for each
> > person. I'm following the design guide, and created a PEOPLE subreference
> > node, connected to all "Person" nodes (A and B in the diagram below)
> >
> > +---> A
> > |
> > REF --> PEOPLE --+
> > |
> > +---> B
> >
> > Now suppose I introduce a User class, that extends Person. I thought
> about
> > a
> > couple of options:
> > 1. I could just connect the user nodes to the PEOPLE node, but then it
> > would
> > be more difficult to traverse only users.
> >
> > 2. Adding another "layer" of sub-referencing"
> >
> >
> > +---> USERS +--> C
> > |   |
> > REF --> PEOPLE --+   +--> D
> > |
> > +---> NONUSERS -+--> A
> > |
> > +--> B
> >
> > So there's the "USERS" node that is connected to all user nodes, and a
> > "NONUSERS" node that is connected to all of the concrete Person nodes.
> > This way the Person and User factories handle the connections to each
> > subreference node.
> > The downside of this is that as I introduce more types in the class
> > hierarchy I need to start rewiring everything, which can be quite tedious
> > at
> > present and very costly in the long run.
> >
> > 3. Perhaps a better way is to avoid the NONUSERS node, keep the concrete
> > People (A and B in this example) connected to the PEOPLE node [Option2]:
> >
> > +---> USERS +--> C
> > |   |
> > REF --> PEOPLE --+   +--> D
> > |
> > +---+--> A
> > |
> > +--> B
> >
> >
> > Of course, I'd use different relationship types so I can tell between
> > people
> > and and subreferences connected to PEOPLE.
> >
> > I'm sure these aren't the only ways, and there may be different ways to
> > handle different cases.
> > In any event, I'd appreciate your feedback, as well as any additional
> tips
> > related to inheritance. Also, if there's any Neo4J guide for managing
> > inheritance that I missed, it would be great if someone would point me
> out
> > to it.
> >
> > Thanks,
> > --- Yaniv
> > ___
> > 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] Modeling inheritance in Neo4J

2010-11-25 Thread Yaniv Ben Yosef
Hi,

I'm looking for best practices in modeling inheritance in Neo4J.
Suppose I have a Person class. In the DB I naturally have a node for each
person. I'm following the design guide, and created a PEOPLE subreference
node, connected to all "Person" nodes (A and B in the diagram below)

 +---> A
 |
REF --> PEOPLE --+
 |
 +---> B

Now suppose I introduce a User class, that extends Person. I thought about a
couple of options:
1. I could just connect the user nodes to the PEOPLE node, but then it would
be more difficult to traverse only users.

2. Adding another "layer" of sub-referencing"


 +---> USERS +--> C
 |   |
REF --> PEOPLE --+   +--> D
 |
 +---> NONUSERS -+--> A
 |
 +--> B

So there's the "USERS" node that is connected to all user nodes, and a
"NONUSERS" node that is connected to all of the concrete Person nodes.
This way the Person and User factories handle the connections to each
subreference node.
The downside of this is that as I introduce more types in the class
hierarchy I need to start rewiring everything, which can be quite tedious at
present and very costly in the long run.

3. Perhaps a better way is to avoid the NONUSERS node, keep the concrete
People (A and B in this example) connected to the PEOPLE node [Option2]:

 +---> USERS +--> C
 |   |
REF --> PEOPLE --+   +--> D
 |
 +---+--> A
 |
 +--> B


Of course, I'd use different relationship types so I can tell between people
and and subreferences connected to PEOPLE.

I'm sure these aren't the only ways, and there may be different ways to
handle different cases.
In any event, I'd appreciate your feedback, as well as any additional tips
related to inheritance. Also, if there's any Neo4J guide for managing
inheritance that I missed, it would be great if someone would point me out
to it.

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


Re: [Neo4j] Traversal framework suggested change

2010-11-07 Thread Yaniv Ben Yosef
It's a personal taste, but I'm not sure I like all those permutations in
combined values.
Perhaps you'll consider that the evaluator would return an object with two
enums:

1. STOP / CONTINUE
2. INCLUDE / EXCLUDE

This will also make it easier to extend the evaluator, so if additional
state is needed to be returned, you just add another enum and don't have to
change all the existing values..

Hope this makes sense.
--- Yaniv

On Fri, Nov 5, 2010 at 8:56 PM, David Montag  wrote:

> Hi all,
>
> Hopefully most of you are familiar with the traversal framework that was
> introduced in 1.1. It's powerful and provides for reusable traversal
> descriptions. It has some flaws though, and I would like to discuss one of
> them here.
>
> The traversal framework has this concept of pruning, which basically is an
> evaluation for each position, deciding whether or not to continue the
> traversal down this branch. The caveat here is that when you evaluate a
> position, you can't opt to prune before it. If you want to exclude a node
> based on information from that node, filtering has to be done on top of the
> pruning, with the same algorithm - once to stop the traversal, and once to
> exclude the node.
>
> So there are actually two orthogonal concepts at work here: whether to stop
> or not, and whether to include or not. What I'm proposing is to merge these
> two into one evaluator. That evaluator would return one of four values:
>
> CONTINUE_AND_INCLUDE_NODE,
> STOP_AND_INCLUDE_NODE,
> STOP_AND_EXCLUDE_NODE, or
> CONTINUE_AND_EXCLUDE_NODE.
>
> This would replace both the filtering and the pruning. I'm just throwing
> this out there to see if anyone else has had the same idea. Like / dislike?
>
> --
> 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] GraphAlgoFactory.pathsWithLength returns paths with loops

2010-10-18 Thread Yaniv Ben Yosef
Hi Mattias,

While taking a closer look at the code, I realized there's an AllSimplePaths
class, which can be easily modified to filter paths whose length isn't
maxDepth (with an extra argument or subclass). I think that's the simplest
solution, but I'm not clear on why pathsWithLength() uses ShortestPath
rather than AllPaths.. Is there an efficiency gain here that I don't see?

And a newbie question: I checked out the algo component (via the 0.7-1.2.M01
tag). I have no trouble building it, but Maven doesn't create a JAR package
of it (the target directory only has classes). Is there a different pom.xml
I should use (I used the one in the root of the component directory)? I
gather it has to be automated somewhere.

Thanks!

--- Yaniv



On Mon, Oct 18, 2010 at 11:27 AM, Mattias Persson  wrote:

> 2010/10/18 Yaniv Ben Yosef 
>
> > Thanks, I figured that..
> > Would you be so kind reviewing the code once I finish it?
> >
> Sure!
>
> >
> > --- Yaniv
> >
> >
> >
> > On Mon, Oct 18, 2010 at 8:20 AM, Mattias Persson
> > wrote:
> >
> > > 2010/10/18, Yaniv Ben Yosef :
> > > > Thanks Mattias!
> > > > Do you have an expected time-frame for that? Alternatively, do you
> have
> > > any
> > > > quick tips on how I would go and implement this myself? I  very
> briefly
> > > > scanned the code in org.neo4j.graphalgo.impl.path.ShortestPath and I
> > > suspect
> > > > I should test whether a node has already been visited (in goOneStep()
> > > > perhaps?).
> > > > Would you say that's the right approach?
> > > >
> > > > Thanks again,
> > >
> > > Unfortunately it's hard to estimate when there's time to do it.
> > >
> > > Your suggestion sounds reasonable, but keep in mind that the algo is
> > > used for the shortest path calculation as well. So an extra argument
> > > in the constructor for ignoring loopy paths when finding paths of a
> > > certain length would be the way to go IMO.
> > >
> > > >
> > > > --- Yaniv
> > > >
> > > >
> > > >
> > > > On Sun, Oct 17, 2010 at 10:18 PM, Mattias Persson <
> > > matt...@neotechnology.com
> > > >> wrote:
> > > >
> > > >> I just realized (it was me who put it there) that the documentation
> is
> > > >> wrong. That one allows cyclic paths, as you obviously noticed :).
> I'll
> > > try
> > > >> to add a simplePathsWithLength method also to take care of that...
> > > >>
> > > >> 2010/10/17 Yaniv Ben Yosef 
> > > >>
> > > >> > Sure :) Will be happy to get your feedback.
> > > >> >
> > > >> > --- Yaniv
> > > >> >
> > > >> > On Sun, Oct 17, 2010 at 6:24 PM, Peter Neubauer <
> > > >> > peter.neuba...@neotechnology.com> wrote:
> > > >> >
> > > >> > > Hi Yaniv,
> > > >> > > thanks for the report, I will take a look at it tomorrow if that
> > is
> > > >> > > ok?
> > > >> > >
> > > >> > > Cheers,
> > > >> > >
> > > >> > > /peter neubauer
> > > >> > >
> > > >> > > VP Product Management, Neo Technology
> > > >> > >
> > > >> > > 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 Sun, Oct 17, 2010 at 1:28 PM, Yaniv Ben Yosef <
> > yani...@gmail.com
> > > >
> > > >> > > wrote:
> > > >> > > > Hi,
> > > >> > > >
> > > >> > > > I am playing with Neo4J version 1.2 M1, specifically
> > > >> > > > with GraphAlgoFactory.pathsWithLength(). According to the
&g

Re: [Neo4j] GraphAlgoFactory.pathsWithLength returns paths with loops

2010-10-17 Thread Yaniv Ben Yosef
Thanks, I figured that..
Would you be so kind reviewing the code once I finish it?

--- Yaniv



On Mon, Oct 18, 2010 at 8:20 AM, Mattias Persson
wrote:

> 2010/10/18, Yaniv Ben Yosef :
> > Thanks Mattias!
> > Do you have an expected time-frame for that? Alternatively, do you have
> any
> > quick tips on how I would go and implement this myself? I  very briefly
> > scanned the code in org.neo4j.graphalgo.impl.path.ShortestPath and I
> suspect
> > I should test whether a node has already been visited (in goOneStep()
> > perhaps?).
> > Would you say that's the right approach?
> >
> > Thanks again,
>
> Unfortunately it's hard to estimate when there's time to do it.
>
> Your suggestion sounds reasonable, but keep in mind that the algo is
> used for the shortest path calculation as well. So an extra argument
> in the constructor for ignoring loopy paths when finding paths of a
> certain length would be the way to go IMO.
>
> >
> > --- Yaniv
> >
> >
> >
> > On Sun, Oct 17, 2010 at 10:18 PM, Mattias Persson <
> matt...@neotechnology.com
> >> wrote:
> >
> >> I just realized (it was me who put it there) that the documentation is
> >> wrong. That one allows cyclic paths, as you obviously noticed :). I'll
> try
> >> to add a simplePathsWithLength method also to take care of that...
> >>
> >> 2010/10/17 Yaniv Ben Yosef 
> >>
> >> > Sure :) Will be happy to get your feedback.
> >> >
> >> > --- Yaniv
> >> >
> >> > On Sun, Oct 17, 2010 at 6:24 PM, Peter Neubauer <
> >> > peter.neuba...@neotechnology.com> wrote:
> >> >
> >> > > Hi Yaniv,
> >> > > thanks for the report, I will take a look at it tomorrow if that is
> >> > > ok?
> >> > >
> >> > > Cheers,
> >> > >
> >> > > /peter neubauer
> >> > >
> >> > > VP Product Management, Neo Technology
> >> > >
> >> > > 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 Sun, Oct 17, 2010 at 1:28 PM, Yaniv Ben Yosef  >
> >> > > wrote:
> >> > > > Hi,
> >> > > >
> >> > > > I am playing with Neo4J version 1.2 M1, specifically
> >> > > > with GraphAlgoFactory.pathsWithLength(). According to the javadoc,
> >> > > > it
> >> > > should
> >> > > > never return paths with loops.
> >> > > > However, it seems like it does. I created a simple test case to
> >> > > demonstrate
> >> > > > that: http://snipt.org/kpwn/
> >> > > >
> >> > > > I expect the code not to show any path, but instead it prints the
> >> > > following
> >> > > > path:
> >> > > >
> >> > > > Path: A -> B -> C -> B
> >> > > >
> >> > > > Please let me know if there's any fault on my side, or if that's a
> >> bug.
> >> > > >
> >> > > > Thanks,
> >> > > > Yaniv
> >> > > > ___
> >> > > > 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
> >> >
> >>
> >>
> >>
> >> --
> >> 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
> >>
> > ___
> > 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
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] GraphAlgoFactory.pathsWithLength returns paths with loops

2010-10-17 Thread Yaniv Ben Yosef
Thanks Mattias!
Do you have an expected time-frame for that? Alternatively, do you have any
quick tips on how I would go and implement this myself? I  very briefly
scanned the code in org.neo4j.graphalgo.impl.path.ShortestPath and I suspect
I should test whether a node has already been visited (in goOneStep()
perhaps?).
Would you say that's the right approach?

Thanks again,

--- Yaniv



On Sun, Oct 17, 2010 at 10:18 PM, Mattias Persson  wrote:

> I just realized (it was me who put it there) that the documentation is
> wrong. That one allows cyclic paths, as you obviously noticed :). I'll try
> to add a simplePathsWithLength method also to take care of that...
>
> 2010/10/17 Yaniv Ben Yosef 
>
> > Sure :) Will be happy to get your feedback.
> >
> > --- Yaniv
> >
> > On Sun, Oct 17, 2010 at 6:24 PM, Peter Neubauer <
> > peter.neuba...@neotechnology.com> wrote:
> >
> > > Hi Yaniv,
> > > thanks for the report, I will take a look at it tomorrow if that is ok?
> > >
> > > Cheers,
> > >
> > > /peter neubauer
> > >
> > > VP Product Management, Neo Technology
> > >
> > > 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 Sun, Oct 17, 2010 at 1:28 PM, Yaniv Ben Yosef 
> > > wrote:
> > > > Hi,
> > > >
> > > > I am playing with Neo4J version 1.2 M1, specifically
> > > > with GraphAlgoFactory.pathsWithLength(). According to the javadoc, it
> > > should
> > > > never return paths with loops.
> > > > However, it seems like it does. I created a simple test case to
> > > demonstrate
> > > > that: http://snipt.org/kpwn/
> > > >
> > > > I expect the code not to show any path, but instead it prints the
> > > following
> > > > path:
> > > >
> > > > Path: A -> B -> C -> B
> > > >
> > > > Please let me know if there's any fault on my side, or if that's a
> bug.
> > > >
> > > > Thanks,
> > > > Yaniv
> > > > ___
> > > > 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
> >
>
>
>
> --
> 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
>
___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] GraphAlgoFactory.pathsWithLength returns paths with loops

2010-10-17 Thread Yaniv Ben Yosef
Sure :) Will be happy to get your feedback.

--- Yaniv

On Sun, Oct 17, 2010 at 6:24 PM, Peter Neubauer <
peter.neuba...@neotechnology.com> wrote:

> Hi Yaniv,
> thanks for the report, I will take a look at it tomorrow if that is ok?
>
> Cheers,
>
> /peter neubauer
>
> VP Product Management, Neo Technology
>
> 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 Sun, Oct 17, 2010 at 1:28 PM, Yaniv Ben Yosef 
> wrote:
> > Hi,
> >
> > I am playing with Neo4J version 1.2 M1, specifically
> > with GraphAlgoFactory.pathsWithLength(). According to the javadoc, it
> should
> > never return paths with loops.
> > However, it seems like it does. I created a simple test case to
> demonstrate
> > that: http://snipt.org/kpwn/
> >
> > I expect the code not to show any path, but instead it prints the
> following
> > path:
> >
> > Path: A -> B -> C -> B
> >
> > Please let me know if there's any fault on my side, or if that's a bug.
> >
> > Thanks,
> > Yaniv
> > ___
> > 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] GraphAlgoFactory.pathsWithLength returns paths with loops

2010-10-17 Thread Yaniv Ben Yosef
Hi,

I am playing with Neo4J version 1.2 M1, specifically
with GraphAlgoFactory.pathsWithLength(). According to the javadoc, it should
never return paths with loops.
However, it seems like it does. I created a simple test case to demonstrate
that: http://snipt.org/kpwn/

I expect the code not to show any path, but instead it prints the following
path:

Path: A -> B -> C -> B

Please let me know if there's any fault on my side, or if that's a bug.

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


[Neo4j] Integrating Neo4J with Google Guice

2010-09-26 Thread Yaniv Ben Yosef
Hi,

Has anyone successfully integrated Neo4J with Google Guice? Particularly,
I'd like to be able to annotate methods with @Transactional, to have Guice
inject the transaction internals (start, success, failure). I'd like it to
work in a similar way it works with Spring and described here:
http://wiki.neo4j.org/content/IMDB_Transaction_handling
I'm using Google Guice 2, but willing the unreleased Guice 3 if that the
only option..

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