Re: [Neo] Representing graph using raphaelJS

2009-12-11 Thread Laurent Laborde
On Fri, Dec 11, 2009 at 2:55 AM, Matt Johnston m...@lattaoutdoors.com wrote:
 I haven't tried raphael, but I am working on creating a way to display the
 graph in SVG, which raphael uses. SVG could easily be used online (through
 raphael or svgweb) and also converted to PDF for offline usage.

 My approach is to write a simplified SVG library instead of using Batik and
 display the graph in a radial plot like http://thejit.org/ and
 http://people.ischool.berkeley.edu/~ping/gtv/

Haaa awesome ! Thx for the links !

 I have the plotting of a basic graph working correctly. Now I am focusing on
 more complex graphs, ones where nodes have more than one relationship.

do you have a github repository ?

-- 
Laurent ker2x Laborde
Sysadmin  DBA at http://www.over-blog.com/
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] SingleValueIndex org.neo4j.api.core.NotFoundException: More than one relationship

2009-12-11 Thread Mattias Persson
Hi Arin,

Maye we should document this more, but you shouldn't use that class.
Instead, take a look at the LuceneIndexService and see how that works
out for you.

2009/12/10 Arin Sarkissian a...@rspot.net:
 Hey guys,

 I'm pretty new to Neo4j, especially the indexing stuff.

 Here's my situation. I want to be able to get nodes via one of their
 properties; in this case let's say the Nodes represent a user  I want
 to be able to grab a User's node via their username.

 So, my initial attempt may be naive (no batching etc) but I've been
 reading thru a a large text file (CSV format: username, userid),
 creating a node for each of these lines  indexing the username
 component.

 Now this needs to be unique (given that usernames are unique) so I've
 been using the SingleValueIndex and have run into a problem: It looks
 like the SingleValueIndex actually does allow multiple values for a
 given lookup (ex: username = phatduckk) however when trying to fetch a
 Node from the index that has multiples (ie: username=phatduckk was
 indexed twice) I get a NotFoundException with More than one
 relationship  as the message.

 I have posted a skeleton piece of code that surfaces this problem over
 at: http://gist.github.com/253553
 This code does not make sure that the Node being indexed for a key is
 always the same - it actually does the opposite: it tries to index
 username=phatduckk w/ a different node each time.

 The bit of code at http://gist.github.com/253569 does the opposite: i
 tries to index the same node for the index username=phatduckk each
 time.

 I also have a few random questions sprinkled in the code as comments
 which illustrate my noobiness =)

 Honestly, I'm not claiming this is a bug - I may be completely
 misusing and misunderstanding the indexing functionality but with my
 limited experience it doesn't seem that SingleValueIndex is single
 at all (hopefully - i'm just wrong and made a dumb mistake).

 Thanks for the help guys,
 Arin
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


[Neo] [neo4j.py] Pickle to save indexes?

2009-12-11 Thread Jan Erik Solem
I have a question on the best way to save an index in Python. I use a
dictionary to index nodes representing images that can contain
objects. Like this: {'image1.jpg': neo4j._primitives.Node object
at 0x92166ac, ...}

To save this index, I tried using Pickle:

def save(self,filename):
# save indexes etc
f = open(filename, 'wb')
pickle.dump(self.image_index,f)
f.close()

This does not work and my interpretation of the errors is that the
problem being the Node object not being Pickleable. Anyone have ideas
or a better suggestion?

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


Re: [Neo] Counting nodes

2009-12-11 Thread Mattias Persson
I saw this old thread and could just fill in with more information.

So, the IndexService.getNodes() now returns an IndexHits result, which
is an Iterable with a size() method on it. The size is given back from
lucene so there's no overhead in calling size() at all.

The LuceneIndexService will create a new document for each call to
LuceneIndexService.index() method. This is because it'd be quite slow
to try to merge with potential existing matches a.s.o.

2009/9/18 Andreas Kollegger akolleg...@tembopublic.org:
 For my use cases at least, total node counts are needed so often that
 I'd love the optimized version. What's the relationship between
 number of documents and nodes? Would that be all indexed nodes
 regardless of the key?

 On Sep 18, 2009, at 3:46 AM, Mattias Persson wrote:

 Looking at the Lucene javadocs I can see that you can ask an index
 (IndexReader) the number of documents there are in it and it'd be
 simple to expose a size() method in the IndexService interface or
 perhaps on the LuceneIndexService class...

 Would that be something worth/good to implement?

 2009/9/18 Andreas Guenther andreas.guent...@web.de:
 actually, disregard my suggestion as I didn't read the word index
 in your question before.

 -AndreasAndreas Guenther wrote:

 The service API has a getAllNodes() call. Iterate and count through
 it.



 -AndreasAndreas Kollegger wrote:



 Hi all,







 For nodes that are kept in the indexed service, is there a more
 clever



 (and hopefully efficient) way to get the node count than manually



 iterating over all the nodes in the index and actually counting. I



 don't see anything obvious in the IndexService() interface, and am
 not



 sure if I've overlooked something useful somewhere else.







 I suppose I could always keep a running tally somewhere, but then I'd



 have to be careful to keep it in sync with reality. Ideally the count



 would be closer to the metal.







 Thanks,



 Andreas



 ___



 Neo mailing list



 User@lists.neo4j.org



 https://lists.neo4j.org/mailman/listinfo/user





 ___

 Neo mailing list

 User@lists.neo4j.org

 https://lists.neo4j.org/mailman/listinfo/user


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




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

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




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


Re: [Neo] SingleValueIndex org.neo4j.api.core.NotFoundException: More than one relationship

2009-12-11 Thread Johan Svensson
Hi Arin,

As Mattias mentioned you should use the IndexService together with
LuceneIndexService for this.

However could you please send the stacktrace for the NotFoundException?

Regarding your comments in the code here are some quick answers:

Use the reference node to connect the index or any other sub-graph
that you need to access. Then you can start traverse from the
reference node and create the index on demand. See
http://wiki.neo4j.org/content/Design_Guide#Organizing_your_Nodespace
for more information.

You do not have to wrap the creation of the index in a transaction
since it has access to the NeoService and can create a transaction if
needed.

Regards,
-Johan

On Thu, Dec 10, 2009 at 8:19 PM, Arin Sarkissian a...@rspot.net wrote:
 Hey guys,

 I'm pretty new to Neo4j, especially the indexing stuff.

 Here's my situation. I want to be able to get nodes via one of their
 properties; in this case let's say the Nodes represent a user  I want
 to be able to grab a User's node via their username.

 So, my initial attempt may be naive (no batching etc) but I've been
 reading thru a a large text file (CSV format: username, userid),
 creating a node for each of these lines  indexing the username
 component.

 Now this needs to be unique (given that usernames are unique) so I've
 been using the SingleValueIndex and have run into a problem: It looks
 like the SingleValueIndex actually does allow multiple values for a
 given lookup (ex: username = phatduckk) however when trying to fetch a
 Node from the index that has multiples (ie: username=phatduckk was
 indexed twice) I get a NotFoundException with More than one
 relationship  as the message.

 I have posted a skeleton piece of code that surfaces this problem over
 at: http://gist.github.com/253553
 This code does not make sure that the Node being indexed for a key is
 always the same - it actually does the opposite: it tries to index
 username=phatduckk w/ a different node each time.

 The bit of code at http://gist.github.com/253569 does the opposite: i
 tries to index the same node for the index username=phatduckk each
 time.

 I also have a few random questions sprinkled in the code as comments
 which illustrate my noobiness =)

 Honestly, I'm not claiming this is a bug - I may be completely
 misusing and misunderstanding the indexing functionality but with my
 limited experience it doesn't seem that SingleValueIndex is single
 at all (hopefully - i'm just wrong and made a dumb mistake).

 Thanks for the help guys,
 Arin
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Ordering of getRelationships

2009-12-11 Thread Johan Svensson
Correct, there are no guarantees on ordering. I thought this was
documented in the core API but it seems to have been left out. Thanks
for asking and pointing this out, we will add that piece of
information before the 1.0 release.

-Johan

On Thu, Dec 10, 2009 at 11:31 PM, Rick Bullotta
rick.bullo...@burningskysoftware.com wrote:
 AFAIK, no guarantees on ordering, thus the reason for the indexing
 utilities.

 -Original Message-
 From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On
 Behalf Of Adam Rabung
 Sent: Thursday, December 10, 2009 5:15 PM
 To: Neo user discussions
 Subject: [Neo] Ordering of getRelationships

 Hi,
 I was wondering if there are any guarantees about the order of relationships
 that come out of Node.getRelationships?  In my test case (attached) it seems
 they come out in creation date, ascending order, until you close and
 re-open the database.  After the database is reopened, it seems like the
 order is reversed. For example:
 1. Create a parent
 2. Add child c1
 3. Add child c2
 4. getRelationships on parent returns c1, c2 5. commit and finish 6.
 getRelationships on parent returns c1, c2 7. Shutdown and reopen 8.
 getRelationships on parent returns c2, c1

 It's been a long week, and I'm convinced I'm messing something up here.

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


Re: [Neo] SingleValueIndex org.neo4j.api.core.NotFoundException: More than one relationship

2009-12-11 Thread Todd Stavish
Hi Arin,

I just ran into this same problem. I am not sure about the scalability
of my solution, but I only had 20,000 users. It may scale, but I just
wanted you to know that I didn't test for it. My goal was to step
into the graph using a string based query, that is supplying a user's
name. An index seemed like overkill to me.

I created my users with all of the relationships that I needed for
modeling, however I created one extra relationship that attached to a
sub-reference node that attached to the reference node.  So when I
needed to needed a user, I could open the reference node, got to the
people sub-reference node, and traverse to all of my people nodes
adding them to a hashmapstring:name,long:nodeId. This hashmap can be
used to resolve users to their nodeId for other queries along the
graph.

Code is below.

-Todd

private static HashMapString,Long getMap(String type, NeoService neo)
{
long referenceNodeId = 0;
HashMapString,Long map = new HashMapString,Long();
Node referenceNode = neo.getNodeById(referenceNodeId);
if (type.equals(topic))
{
Node topicNodes =
referenceNode.getSingleRelationship(RelationshipTypes.TOPICS,
Direction.OUTGOING).getEndNode();
for (Relationship topic :
topicNodes.getRelationships(RelationshipTypes.TOPIC,
Direction.OUTGOING))
{
Node topicNode = topic.getEndNode();

map.put(topicNode.getProperty(topic).toString(), topicNode.getId());
}
}
else if (type.equals(person))
{
Node personNodes =
referenceNode.getSingleRelationship(RelationshipTypes.PEOPLE,
Direction.OUTGOING).getEndNode();
for (Relationship person :
personNodes.getRelationships(RelationshipTypes.PERSON,
Direction.OUTGOING))
{
Node personNode = person.getEndNode();

map.put(personNode.getProperty(name).toString(), personNode.getId());
}
}
return map;
}





On Thu, Dec 10, 2009 at 2:19 PM, Arin Sarkissian a...@rspot.net wrote:
 Hey guys,

 I'm pretty new to Neo4j, especially the indexing stuff.

 Here's my situation. I want to be able to get nodes via one of their
 properties; in this case let's say the Nodes represent a user  I want
 to be able to grab a User's node via their username.

 So, my initial attempt may be naive (no batching etc) but I've been
 reading thru a a large text file (CSV format: username, userid),
 creating a node for each of these lines  indexing the username
 component.

 Now this needs to be unique (given that usernames are unique) so I've
 been using the SingleValueIndex and have run into a problem: It looks
 like the SingleValueIndex actually does allow multiple values for a
 given lookup (ex: username = phatduckk) however when trying to fetch a
 Node from the index that has multiples (ie: username=phatduckk was
 indexed twice) I get a NotFoundException with More than one
 relationship  as the message.

 I have posted a skeleton piece of code that surfaces this problem over
 at: http://gist.github.com/253553
 This code does not make sure that the Node being indexed for a key is
 always the same - it actually does the opposite: it tries to index
 username=phatduckk w/ a different node each time.

 The bit of code at http://gist.github.com/253569 does the opposite: i
 tries to index the same node for the index username=phatduckk each
 time.

 I also have a few random questions sprinkled in the code as comments
 which illustrate my noobiness =)

 Honestly, I'm not claiming this is a bug - I may be completely
 misusing and misunderstanding the indexing functionality but with my
 limited experience it doesn't seem that SingleValueIndex is single
 at all (hopefully - i'm just wrong and made a dumb mistake).

 Thanks for the help guys,
 Arin
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

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


Re: [Neo] Lucene Index Corruption?

2009-12-11 Thread Johan Svensson
Hi,

I do think the best solution is to make NeoService.shutdown() (either
by default or parameter/config) do the following:

1) block or throw exception for threads trying to start a new transaction
2) rollback all transactions that are not yet in committing state
3) wait for transactions that are in committing state to commit

The problem is this is hard to do in a safe way without introducing
blocking code in the TM. I may have a look at this sometime soon and
see if it is possible to do without killing concurrency.

Regarding suspend/resume of transactions you can have a look at this class:

 
https://svn.neo4j.org/components/neo-rdf-sail/trunk/src/main/java/org/neo4j/rdf/sail/NeoSailConnection.java

Methods in that class that needs transactional context will suspend
any other running transaction and resume the internal transaction
(that is connected with the connection), then on exit, suspend the
internal transaction and resume the transaction that was running on
method invocation (if any) . You would have to make sure that threads
do not try to resume the same transaction concurrently (will result in
an exception from TM).

Regards,
-Johan

On Thu, Dec 10, 2009 at 11:30 PM, Adam Rabung adamrab...@gmail.com wrote:
 Hi,
 Thanks for all of the information.

 Of course the #1 solution to this problem is to ensure all transactions are
 closed before shutdown is called.  I am trying to implement some kind of
 failsafe in the case that some unforeseen problem/bug causes transactions to
 remain open.  What do you think of an optional parameter to shutdown() to
 signify Do your best to rollback+finish any open transactions?  Or, could
 you provide a code example of how to close an Iterable of TransactionImpls
 using TransactionManager suspend and resume?

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


Re: [Neo] [neo4j.py] Pickle to save indexes?

2009-12-11 Thread Tobias Ivarsson
Hi Jan Erik,

Nice to see you here on the list! Welcome!

Short answer: Serialize to the id of node, then use neo.node[id] to
unserialize.

I haven't thought about support for pickle before, but that could be a nice
addition. The above is (roughly) what it would do. The main difference being
that the pickled state would have to keep track of the neo4j instance as
well since there potentially could be multiple neo4j instances, but that is
doable, since the neo4j instances are uniquely identified by their
resource-uri (the path where the data is stored).

Cheers,
Tobias

On Fri, Dec 11, 2009 at 11:36 AM, Jan Erik Solem jeso...@gmail.com wrote:

 I have a question on the best way to save an index in Python. I use a
 dictionary to index nodes representing images that can contain
 objects. Like this: {'image1.jpg': neo4j._primitives.Node object
 at 0x92166ac, ...}

 To save this index, I tried using Pickle:

 def save(self,filename):
# save indexes etc
f = open(filename, 'wb')
pickle.dump(self.image_index,f)
f.close()

 This does not work and my interpretation of the errors is that the
 problem being the Node object not being Pickleable. Anyone have ideas
 or a better suggestion?

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




-- 
Tobias Ivarsson tobias.ivars...@neotechnology.com
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] LuceneIndexBatchInserter doubt

2009-12-11 Thread Mattias Persson
I've tried this a couple of times now and first of all I see some
problems in your code:

1) In the method createRelationsTitleImage you have an inverted head
!= -1 check where it should be head == -1

2) You index relationships in createRelationsBetweenTitles method,
this isn't ok since the index can only manage nodes.

And I recently committed a fix which removed the caching layer in
the LuceneIndexBatchInserterImpl (and therefore also
LuceneFulltextIndexBatchInserter). This probably fixes your problems.
I'm also working on a performance fix which makes consecutive getNodes
calls faster.

So I think that with these fixes (1) and (2) and the latest index-util
0.9-SNAPSHOT your sample will run fine. Also you could try without
calling optimize. See more information at
http://wiki.neo4j.org/content/Indexing_with_BatchInserter

2009/12/10 Mattias Persson matt...@neotechnology.com:
 To continue this thread in the user list:

 Thanks Núria, I've gotten your samples code/files and I'm running it
 now to try to reproduce you problem.

 2009/12/9 Núria Trench nuriatre...@gmail.com:
 I have finished uploading the 4 csv files. You'll see an e-mail with the
 other 3 csv files packed in a rar file.
 Thanks,

 Núria.

 2009/12/9 Núria Trench nuriatre...@gmail.com

 Yes, you are right. But there is one csv file that is too big to be packed
 with other files and I am reducing it.
 I am sending the other files now.

 2009/12/9 Mattias Persson matt...@neotechnology.com

 By the way, you might consider packing those files (with zip or tar.gz
 or something) cause they will shrink quite well

 2009/12/9 Mattias Persson matt...@neotechnology.com:
  Great, but I only got the images.csv file... I'm starting to test with
  that at least
 
  2009/12/9 Núria Trench nuriatre...@gmail.com:
  Hi again,
 
  The errors show up after being parsed 2 csv files to create all the
  nodes,
  just in the moment of calling the method getSingleNode for looking
  up the
  tail and head node for creating all the edges by reading the other two
  csv
  files.
 
  I am sending with Sprend the four csv files that will help you to
  trigger
  index behaviour.
 
  Thank you,
 
  Núria.
 
  2009/12/9 Mattias Persson matt...@neotechnology.com
 
  Hmm, I've no idea... but does the errors show up early in the process
  or do you have to insert a LOT of data to trigger it? In such case
  you
  could send me a part of them... maybe using http://www.sprend.se ,
  WDYT?
 
  2009/12/9 Núria Trench nuriatre...@gmail.com:
   Hi Mattias,
  
   The data isn't confident but the files are very big (5,5 GB).
   How can I send you this data?
  
   2009/12/9 Mattias Persson matt...@neotechnology.com
  
   Yep I got the java code, thanks. Yeah if the data is confident or
   sensitive you can just send me the formatting, else consider
   sending
   the files as well (or a subset if they are big).
  
   2009/12/9 Núria Trench nuriatre...@gmail.com:



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


Re: [Neo] [neo4j.py] Pickle to save indexes?

2009-12-11 Thread Jan Erik Solem
Thanks Tobias, this works just great!

/Jan Erik

On Fri, Dec 11, 2009 at 5:49 AM, Tobias Ivarsson
tobias.ivars...@neotechnology.com wrote:
 Hi Jan Erik,

 Nice to see you here on the list! Welcome!

 Short answer: Serialize to the id of node, then use neo.node[id] to
 unserialize.

 I haven't thought about support for pickle before, but that could be a nice
 addition. The above is (roughly) what it would do. The main difference being
 that the pickled state would have to keep track of the neo4j instance as
 well since there potentially could be multiple neo4j instances, but that is
 doable, since the neo4j instances are uniquely identified by their
 resource-uri (the path where the data is stored).

 Cheers,
 Tobias

 On Fri, Dec 11, 2009 at 11:36 AM, Jan Erik Solem jeso...@gmail.com wrote:

 I have a question on the best way to save an index in Python. I use a
 dictionary to index nodes representing images that can contain
 objects. Like this: {'image1.jpg': neo4j._primitives.Node object
 at 0x92166ac, ...}

 To save this index, I tried using Pickle:

 def save(self,filename):
    # save indexes etc
    f = open(filename, 'wb')
    pickle.dump(self.image_index,f)
    f.close()

 This does not work and my interpretation of the errors is that the
 problem being the Node object not being Pickleable. Anyone have ideas
 or a better suggestion?

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




 --
 Tobias Ivarsson tobias.ivars...@neotechnology.com
 Hacker, Neo Technology
 www.neotechnology.com
 Cellphone: +46 706 534857
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

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


Re: [Neo] SingleValueIndex org.neo4j.api.core.NotFoundException: More than one relationship

2009-12-11 Thread Arin Sarkissian
Hey Johan,

Here's the stacktrace I get when I run the code at:
http://gist.github.com/253569

Exception in thread pool-1-thread-16
org.neo4j.api.core.NotFoundException: More than one
relationship[KEY_ENTRY, OUTGOING] found for NodeImpl#3
at org.neo4j.impl.core.NodeImpl.getSingleRelationship(NodeImpl.java:189)
at 
org.neo4j.impl.core.NodeProxy.getSingleRelationship(NodeProxy.java:98)
at org.neo4j.util.btree.TreeNode.getFirstEntry(TreeNode.java:181)
at org.neo4j.util.btree.TreeNode.getEntry(TreeNode.java:398)
at org.neo4j.util.btree.BTree.getAsKeyEntry(BTree.java:341)
at 
org.neo4j.util.index.AbstractIndex.getNodesFor(AbstractIndex.java:334)
at 
org.neo4j.util.index.SingleValueIndex.getNodesFor(SingleValueIndex.java:33)
at com.digg.tmp.SVINotFound2$IndexRunner.run(SVINotFound2.java:69)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)

However - If I set N_THREADS = 1 I don't get the error. So maybe my
threading code sucks but all threads use the same instance of
SingleValueIndex.

You should be able to reproduce using the code in that gist.

Arin

On Fri, Dec 11, 2009 at 3:31 AM, Johan Svensson jo...@neotechnology.com wrote:
 Hi Arin,

 As Mattias mentioned you should use the IndexService together with
 LuceneIndexService for this.

 However could you please send the stacktrace for the NotFoundException?

 Regarding your comments in the code here are some quick answers:

 Use the reference node to connect the index or any other sub-graph
 that you need to access. Then you can start traverse from the
 reference node and create the index on demand. See
 http://wiki.neo4j.org/content/Design_Guide#Organizing_your_Nodespace
 for more information.

 You do not have to wrap the creation of the index in a transaction
 since it has access to the NeoService and can create a transaction if
 needed.

 Regards,
 -Johan

 On Thu, Dec 10, 2009 at 8:19 PM, Arin Sarkissian a...@rspot.net wrote:
 Hey guys,

 I'm pretty new to Neo4j, especially the indexing stuff.

 Here's my situation. I want to be able to get nodes via one of their
 properties; in this case let's say the Nodes represent a user  I want
 to be able to grab a User's node via their username.

 So, my initial attempt may be naive (no batching etc) but I've been
 reading thru a a large text file (CSV format: username, userid),
 creating a node for each of these lines  indexing the username
 component.

 Now this needs to be unique (given that usernames are unique) so I've
 been using the SingleValueIndex and have run into a problem: It looks
 like the SingleValueIndex actually does allow multiple values for a
 given lookup (ex: username = phatduckk) however when trying to fetch a
 Node from the index that has multiples (ie: username=phatduckk was
 indexed twice) I get a NotFoundException with More than one
 relationship  as the message.

 I have posted a skeleton piece of code that surfaces this problem over
 at: http://gist.github.com/253553
 This code does not make sure that the Node being indexed for a key is
 always the same - it actually does the opposite: it tries to index
 username=phatduckk w/ a different node each time.

 The bit of code at http://gist.github.com/253569 does the opposite: i
 tries to index the same node for the index username=phatduckk each
 time.

 I also have a few random questions sprinkled in the code as comments
 which illustrate my noobiness =)

 Honestly, I'm not claiming this is a bug - I may be completely
 misusing and misunderstanding the indexing functionality but with my
 limited experience it doesn't seem that SingleValueIndex is single
 at all (hopefully - i'm just wrong and made a dumb mistake).

 Thanks for the help guys,
 Arin
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

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


[Neo] Neo Shell listing a relationship's property

2009-12-11 Thread Todd Stavish
Is there a way to list a property of a relationship in Neo Shell? If
not, is there another way to do this without using Neoclipse? I am
SSHing into an EC2 instance.

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


Re: [Neo] Neo Shell listing a relationship's property

2009-12-11 Thread Peter Neubauer
Hi Todd,
yeah, that is certainly a feature to add to the Neo Shell.

Otherwise, Marko has just been finishing neo-integration for Gremlin,
http://gremlin.tinkerpop.com which is treating realtionships as first
class citizens and will show you properties,
http://wiki.github.com/tinkerpop/gremlin/basic-graph-traversals. But
it is a bit rough and will require compilation etc. and might not run
right now.

Mattias? Marko?

Cheers,

/peter neubauer

COO and Sales, 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- Relationships count.
http://gremlin.tinkerpop.com- PageRank in 2 lines of code.
http://www.linkedprocess.org   - Computing at LinkedData scale.



On Fri, Dec 11, 2009 at 10:12 PM, Todd Stavish toddstav...@gmail.com wrote:
 Is there a way to list a property of a relationship in Neo Shell? If
 not, is there another way to do this without using Neoclipse? I am
 SSHing into an EC2 instance.

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

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