Open atomos opened 10 years ago
I'm also trying to upgrade to Neo4j 2. Now that the Gremlin plugin is installed, I get the same error that you end up with (from the API):
{
error_message: "('The type node for class Word could not be created in the database.', StatusException())",
traceback: "Traceback (most recent call last): File "/opt/phaidra/env/src/django-tastypie/tastypie/resources.py", line 195, in wrapper response = callback(request, *args, **kwargs) File "/opt/phaidra/env/src/django-tastypie/tastypie/resources.py", line 426, in dispatch_list return self.dispatch('list', request, **kwargs) File "/opt/phaidra/env/src/django-tastypie/tastypie/resources.py", line 458, in dispatch response = method(request, **kwargs) File "/opt/phaidra/api/api.py", line 421, in get_list if len(words) < 1: File "/opt/phaidra/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 106, in __len__ self._result_cache = list(self.iterator()) File "/opt/phaidra/env/src/neo4django/neo4django/db/models/query.py", line 1283, in iterator piece = list(clone.execute(using)) File "/opt/phaidra/env/src/neo4django/neo4django/db/models/query.py", line 1162, in execute groovy, params = self.as_groovy(using) File "/opt/phaidra/env/src/neo4django/neo4django/db/models/query.py", line 926, in as_groovy cypher_params['typeNodeId'] = self.model._type_node(using).id File "/opt/phaidra/env/src/neo4django/neo4django/db/models/base.py", line 411, in _type_node return cls.__type_node_classmethod(using) File "/opt/phaidra/env/src/neo4django/neo4django/db/models/base.py", line 394, in __type_node raise RuntimeError(error_message, e) RuntimeError: ('The type node for class Word could not be created in the database.', StatusException()) "
}
Namely: RuntimeError: ('The type node for class Word could not be created in the database.', StatusException()
Have you made any progress on this?
Sorry, I gave up on neo4django. I don't remember seeing that error.
I'll be working on getting some progress here, ill post any notes as i go. I think it wont be too difficult since the library were using to talk to neo4j has been working on 2.0 for 6 months now. We may just need to use the ParserVersion feature to inform neo4j that were going to query it with 1.8 or 1.9 query semantics. (at least i hope its that easy lol)
Ive got some progress on 2.0 and 2.1 in my fork here: https://github.com/techdragon/neo4django/commit/fac398b34477d781fe52d690e9208050f583fb8a
Ive been chipping away at the errors that caused the issues. After updating the neo4jrestclient library, adding detection code to catch when the version of neo4j is 2.0 or higher, and then creating a secondary groovy script to be called when we we are on 2.0 or higher in order to be able to try and develop something compatible with the old way as well as 2.0... I have been able to steadily comment my way through the groovy script and pinpoint a few of the problems with gettingneo4django working on Neo4j 2.x with versions of the Gremlin Plugin for 2.x ... All of which are in the groovy script code.
@mhluongo You're the only person thats ever touched the groovy code from the look of it, so while I'm sure ill eventually work it out, this may be much more efficient if you look at the issue. It appears that in order to be compatible with neo4j 2.x we need to remove all the transaction handling code and make some changes to how it queries and creates nodes. Like the changes and comments in the following links: https://github.com/dbunskoek/bulbs/commit/02c861b03543ca3ea253b0b2d5710bdc6f795ba0 https://groups.google.com/forum/#!topic/gremlin-users/OUkpukj8YYY https://github.com/tinkerpop/blueprints/blob/master/doc/The-Major-Differences-Between-Blueprints-1.x-and-2.x.textile
I've tried to work out some of this groovy code stuff myself but it seems from your blog post you may be doing some advanced groovy code magic ( http://mattluongo.com/post/client-side-gremlin-libraries-in-neo4j ) so while I'll keep working on this, I'm pretty sure you may be able to either point me in the right direction so i can finish fixing my fork for a PR, or post some code i can use that will help.
edit: It also seems to be related to the "type node" behaviour neo4django appears to either implicitly depend on or rely on as part of its use of gremlin
edit2: I think you may have already logged an issue for this... hard to tell without a description ;-) https://github.com/scholrly/neo4django/issues/170
edit3: I've tracked it back down to the assumption of neo4j having a node(0) "reference node" and the lack of the reference node is causing all kinds of trouble. Since the reference node assumption is a major roadblock on my ability to further tinker with the gremlin pathway, incase this 1.x reference node assumption proves to be a major hurdle to overcome, I'm going to take a shot at building a pure cypher implementation on top of the new GSOC 2014 django meta API in trunk (as mentioned here https://github.com/scholrly/neo4django/issues/252) and try to keep its schema as close to the one provided by neo4django as i can.
@techdragon thanks for your work so far! I've done some client work where I used a similar approach (Groovy + Gremlin + Cypher) against Neo4j 2.0+. I'll check if that's applicable.
Heh, yeah, that's the issue. It's actually pretty easy to just create a "reference node", and always use that by pulling from an index, instead of relying on the old node(0) business. I think that'd be the quickest fix. That said, actually using Neo4j 2.0 types instead of the neo4django-constructed type tree would be sweet.
I'd caution you on going all-Cypher- Cypher is great, but there are some very basic things it doesn't yet support that neo4django has had to work around with Gremlin / client-side index craziness. It'd be a shame to no longer have the complex filtering done against the indices first.
@mhluongo I'm keeping an eye on this quite closely as my current app progresses so hopefully some of that client work code proves fruitful.
From what I've been building so far, the type/label system is quite powerful and does make creating node types a lot more strait forward.
I'm holding back on starting work on the all cypher neo4django option at the moment for a couple of reasons, one of which is the still evolving state for the new django meta api improvements, the other of which is a general uncertainty as to wether to drop down to direct communication to/from neo4j or not, so my current project is being built using neo4j 2.1 format raw cypher constructed using the helpful https://github.com/bruth/cypher tool and (at the moment) py2neo. I'm taking full advantage of the ability to just "remodel the schema as i go" and letting things evolve for a while before trying to build any kind of tool with it as a primary use case.
Hi,
I'm just starting out using Neo4j and I'd like to use 2.0 (I have 2.0.1 community installed). I see that neo4django was only tested against neo4j 1.8.2-1.9.4, but have people gotten it working with 2.x? I installed the gremlin plugin but can't create or query through neo4django.
create:
query:
My model is incredibly complex: