adding labels with python-embedded (2.0)

111 views
Skip to first unread message

tcb

unread,
May 6, 2013, 8:17:54 AM5/6/13
to ne...@googlegroups.com
Hi,

I'm using 2.0.0-M02 and I'm trying to add a label to a node which I create from python

node = db.node(name='testname')
node.addLabel('User')

It seems there are various functions for labels available from the python site- filtering on dir(node) I see it knows about these:

addLabel
getLabels
hasLabel
removeLabel

But when I try to call addLabel I get this error:

 
----> 1 node.addLabel('User')

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neo4j/_backend.py in decorator(*args, **kwargs)
    181                 if not jpype.isThreadAttachedToJVM():
    182                     jpype.attachThreadToJVM()
--> 183                 return fn(*args, **kwargs)
    184             return decorator
    185 

RuntimeError: No matching overloads found. at src/native/common/jp_method.cpp:121

I can do what I need with cypher, but I find its a bit slower. If the fix is something simple and you can point me to it, I'll happily look into it.

thanks,

 

Peter Neubauer

unread,
May 13, 2013, 3:45:39 PM5/13/13
to Neo4j User
Hi there,
are you sure the library is even working with 2.0? Are there tests etc
for it? I am not sure. it might be that it needs to be upgraded, which
I strongly encourage you to do!

/peter

Cheers,

/peter neubauer

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

The authoritative book on graph databases - http://graphdatabases.com
Neo4j questions? Please use SO - http://stackoverflow.com/search?q=neo4j
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to neo4j+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

David Knapp

unread,
May 15, 2013, 2:58:28 PM5/15/13
to ne...@googlegroups.com
I have an updated python embedded library for 2.0-M2

Peter Neubauer

unread,
May 15, 2013, 5:06:51 PM5/15/13
to Neo4j User
That is supernice David!

Mind providing a pull request back, so we can look at it? Did you
provide any testcases or docs around labels and indexes with Cypher?

/peter

Cheers,

/peter neubauer

G: neubauer.peter
S: peter.neubauer
P: +46 704 106975
L: http://www.linkedin.com/in/neubauer
T: @peterneubauer

The authoritative book on graph databases - http://graphdatabases.com
Neo4j questions? Please use SO - http://stackoverflow.com/search?q=neo4j


David Knapp

unread,
May 16, 2013, 2:16:06 PM5/16/13
to ne...@googlegroups.com
I already issued a pull request. I think it's a couple of commits behind though, so I can issue another one.

I didn't really write any test cases for the new work, mainly because my JVM would segfault when maven would try to run the tests. So I would always build with skiptests. I've been using it pretty heavily though.

The only issue I've come accross is that with the new indexes, you MUST call db.shutdown() and wait for ALL INDEXES to come online. Otherwise they get into a really bad state and can't recover. This isn't anything to do with the python though, it seems to be an issue with neo4j itself as it was brought up in a couple other posts here.
Reply all
Reply to author
Forward
0 new messages