Replacing Node Labels with Existing property values

22 views
Skip to first unread message

John O'Gorman

unread,
Feb 4, 2016, 4:22:12 PM2/4/16
to Neo4j
Hi all

In the past I loaded different node classes via individual csv files (class1.csv, class2.csv etc.)

Now, since all of initial properties are the same, I want to bulk  load (via cvs) about 50K nodes with n:GenericNode label and properties n.string, n.class etc.

Then would then like to replace the n:GenericNode label with the value of n.class for that node. 

Is there a way to do this? 

Thanks.

Michael Hunger

unread,
Feb 5, 2016, 5:55:55 AM2/5/16
to ne...@googlegroups.com
How did you load them?

Match (n:GenericLabel)
Where exist(n.foo)
Set n:Foo
Remove n:GenericLabel

Von meinem iPhone gesendet
--
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/d/optout.

John O'Gorman

unread,
Feb 5, 2016, 11:35:24 AM2/5/16
to ne...@googlegroups.com
Many thanks, Michael.  Can I use the same approach to re-label a relationship?

     Match (r:IsValueHas)
     Set r:IsPartHas
     Remove r:IsValueHas

Regards.

John O'

--
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/xOEjNdLGYN8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to neo4j+un...@googlegroups.com.

Michael Hunger

unread,
Feb 5, 2016, 1:27:19 PM2/5/16
to ne...@googlegroups.com
Unfortunately not :(

You have to delete and recreate the relationship 

Von meinem iPhone gesendet
Reply all
Reply to author
Forward
0 new messages