Gremlin Tinkerpop 中的一个顶点可以有多个标签,就像我们在 Neo4J 图中所做的那样吗?

Can you have multiple labels for a vertex in Gremlin Tinkerpop like we do in Neo4J graph?

Neo4J 允许同一节点有多个标签。这很方便。我们在 Gremlin Tinkerpop 中有相同的能力吗?

TinkerPop 模型不允许像 Neo4j 那样使用多个标签。但是,它确实提供了一些特定的支持,特别是对 Neo4j (documentation):

gremlin> vertex = (Neo4jVertex) g.addV('human::animal').next() 
==>v[0]
gremlin> vertex.label() 
==>animal::human
gremlin> vertex.labels() 
==>animal
==>human
gremlin> vertex.addLabel('organism')
==>null
gremlin> g.V().has(label,of('organism'))
==>v[0]