label matching not working

69 views
Skip to first unread message

Kyle Williams

unread,
Dec 6, 2013, 7:35:34 PM12/6/13
to ne...@googlegroups.com
Hi

I have some nodes that have labels where matching on the label does not work. I imported the data using batch-import.

Example:

neo4j-sh (?)$ match (cluster {cvenue: "NULL"}) return cluster.cvenue, cluster.ctitle, labels(cluster) limit 1;
+---------------------------------------------------------------------------------------------------------------------+
| cluster.cvenue | cluster.ctitle                                                                   | labels(cluster) |
+---------------------------------------------------------------------------------------------------------------------+
| "NULL"         | "FL, Wang SH. Role of heredity in the genesis of myopia. Ophthalmic Physiol Opt" | ["Cluster"]     |
+---------------------------------------------------------------------------------------------------------------------+

As can be seen, this node has the Cluster label. But then trying the same query but specifying the label returns nothing:


neo4j
-sh (?)$ match (cluster:Cluster {cvenue: "NULL"}) return cluster.cvenue, cluster.ctitle, labels(cluster) limit 1;
+---------------------------------------------------+
| cluster.cvenue | cluster.ctitle | labels(cluster) |
+---------------------------------------------------+
+---------------------------------------------------+


Any ideas?

Thanks

Kyle Williams

unread,
Dec 6, 2013, 7:36:24 PM12/6/13
to ne...@googlegroups.com
Oh, and I'm using neo4j-community-2.0.0-RC1

Peter Neubauer

unread,
Dec 9, 2013, 10:11:51 AM12/9/13
to Neo4j User
Kyle,
are you sure the label is correct. It seems to be a String at your
example, when it should be just a label, see
http://console.neo4j.org/r/k1ds0

Maybe the batchimporter did pick the wrong type here?

/peter

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

Neo4j 2.0.0-RC1 -
http://blog.neo4j.org/2013/11/neo4j-200-rc1-final-preparations.html
Kidscraft "Ice" - http://www.kidscraft.se/
> --
> 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.

Kyle Williams

unread,
Dec 9, 2013, 12:24:19 PM12/9/13
to ne...@googlegroups.com
Hi Peter

I think the fact that mine is a quoted string may just be because of the way the Neo4J shell displays labels. For instance, if I use the example of creating an actor from the Neo4J manual then the label is also quoted, whereas using a GraphGist it is not.

neo4j-sh (?)$ CREATE (n:Actor { name:"Tom Hanks" });
+-------------------+
| No data returned. |
+-------------------+
Nodes created: 1
Properties set: 1
Labels added: 1
1317 ms
neo4j
-sh (?)$ MATCH (actor:Actor { name: "Tom Hanks" }) return labels(actor);
+---------------+
| labels(actor) |
+---------------+
| ["Actor"]     |
+---------------+
1 row
849 ms


I think this may be a batch-imported thing. When I imported a few hundred records from the same file it got the label right, but when I imported my full dataset (23 million nodes) it didn't.

Peter Neubauer

unread,
Dec 10, 2013, 9:28:37 AM12/10/13
to Neo4j User
Maybe there are some anomalies in your label column in the import file
further down then?

/peter

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

Neo4j 2.0.0-RC1 -
http://blog.neo4j.org/2013/11/neo4j-200-rc1-final-preparations.html
Kidscraft "Ice" - http://www.kidscraft.se/


Michael Hunger

unread,
Dec 15, 2013, 7:39:46 PM12/15/13
to ne...@googlegroups.com
Kyle

could you re-test with the 2.0 release?

And how do the first few lines of your nodes file look like ? (including header?)

Michael

Kyle Williams

unread,
Jan 6, 2014, 8:53:18 AM1/6/14
to ne...@googlegroups.com
Hi Michael

My apologies for the late reply, I have been on vacation. I did use the 2.0 release of batch-import. I've attached some sample data. Also, as I said in a previous post: labels worked on a small file (hundred of nodes) but not on a large file 20 million+ nodes.
sample-data.txt

Michael Hunger

unread,
Jan 6, 2014, 8:58:37 AM1/6/14
to ne...@googlegroups.com
What exactly "didn't work" ? did you see any error messages?
Any chance that you had some quirks in the input data? Like newlines in fields?

Could you re-try it? I think when you posted your question initially neither Neo4j 2.0.0 final was released nor the batch-importer updated to that version.

Thanks so much

Michael

<sample-data.txt>

Kyle Williams

unread,
Jan 6, 2014, 9:04:35 AM1/6/14
to ne...@googlegroups.com
Hi Michael

Thanks for the response. See the first post in this thread for what I mean by "it doesn't work." Basically, it comes down to label matching not working at run time. There were no errors at import time and everything completed successfully. I also don't believe that I had any quirks in my input data but it is possible.

I was using Neo4j 2.0.0 RC1 so I'll definitely try with the final version and the latest version of the batch-import code on github and get back to you when I have some results. Unfortunately, the machine I was using is currently running some other experiments so it may take up to a week before I can test this. I will get back to you when I have more information though.

Thanks a lot!
Kyle


--
You received this message because you are subscribed to a topic in the Google Groups "Neo4j" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/neo4j/0mlsx6_3x_Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages