Hmm interesting. Can you return two of the different nodes side by side?
Do you only have movies in your db? Michael Am 14.05.2014 um 13:25 schrieb Manuel Moraga <manuel.moraga.dro...@gmail.com>: > I have already posted this on StackOverflow, but haven't gotten any answers. > I suspect there may be a bug involved, or it's just a gotcha that I must have > missed somewhere. I have tried everything I could think of, and checked the > documentation but still can't find the reason why my nodes can't be mapped > even after adding the correct primary SDN label. > > I'm running SDN 3.0.2.RELEASE and neo4j 2.0.3 on arch linux x64 with Oracle > Java 1.8.0_05 > > Trying to retrieve nodes in SDN, imported using the Neo4j CSV Batch Importer, > gives the java.lang.IllegalStateException: > > java.lang.IllegalStateException: No primary SDN label exists .. (i.e one with > starting with _) > This is after having added a new label through a cypher query: > > match (n:Movie) set n:_Movie; > Inspecting nodes created through SDN shows they have the same labels. The > result when running > > match (n) where id(n)={nodeId} return labels(n) as labels; > as found in LabelBasedStrategyCypher.java is the same for both: > > ["Movie","_Movie"] > Saving and retrieving nodes thorugh SDN works without any issues. I must be > missing something as I got the impression that setting the appropiate labels > should be enough. > > My CSV file looks like this. The appId is only used to assure the node is the > same that we have stored earlier, as the internal nodeId is Garbage collected > and new nodes could get old nodeIds after the old ones are deleted. The > nodeId is used for actual lookups and for connecting relationships and so on. > > appId:int l:label title:string:movies year:int > 1 Movie Dinosaur Planet 2003 > 2 Movie Isle of Man TT 2004 Review 2004 > I have made more tests, checking the source of > LabelBasedNodeTypeRepresentationStrategy to see what is going wrong. Running > the readAliasFrom() method that the Exception is thrown from does not return > any errors: > > String query = "start n=node({id}) return n"; > Node node = null; > for(Node n : neo4jTemplate.query(query,params).to(Node.class)){ > node = n; > } > > // when running the readAliasFrom method manually the label is returned > correctly > LabelBasedNodeTypeRepresentationStrategy strategy = new > > LabelBasedNodeTypeRepresentationStrategy(neo4jTemplate.getGraphDatabase()); > System.out.println("strategy returns: " > +(String)strategy.readAliasFrom(node)); > > // trying to convert the node to a movie object, however throws the Illegal > State Exception > Movie movie = null; > movie = neo4jTemplate.convert(node,Movie.class); > So, the _Movie label exists, running the readAliasFrom() method manually > doesn't throw Exceptions but trying to convert the node into a Movie does. > Nodes created from SDN do not have these issues, even if they look identical > to me. > > /Manuel > > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.