You must first create a shortcut by creating an Enum that implements Label , or use DynamicLabel to create it on the fly.
Once you have created, you will need to add it to Node .
The following shows how to do this with DynamicLabel :
import org.neo4j.graphdb.DynamicLabel; Label myLabel = DynamicLabel.label("Label_Name"); myNode.addLabel(myLabel);
You must also do this in a transaction.
source share