Hello,
TinkerPop3 supports a single label for an Element: Vertex, Edge, or VertexProperty. In Neo4j, a Node can have an arbitrary number of labels, while a Relationship can only have one. In order deal with this mismatch, we introduced three Neo4jVertex specific methods:
public Set<String> labels()
public void removeLabel(final String label)
public void addLabel(final String label)
You can see how this works in practice by studying the following example:
Note that this is Gremlin I/O safe as there is no data loss when reading or writing to/from GraphML, GraphSON, Kryo, etc. If you export a Neo4jGraph with multi-labels on vertices to import it into, lets say, TinkerGraph, then the vertex label would be "person::organism" (simply a concatenation of the labels).
An open question is: "what is the best delimiter?" Right now its "::". I was thinking of that we could make this user defined based on a configuration option --- but perhaps its adding too many degrees of freedom that may not be worth the testing/verification logic. Is "::" good for others? Note that Neo4j recommends that labels be camel cased (e.g. "SuperHuman"). Likewise, TinkerPop recommends the same. Perhaps the delimiter is a \s (space) or , (comma) with whitespace trim?
*** The code is currently in SNAPSHOT and will be released in TinkerPop 3.0.0.M7.
Enjoy,
Marko.