1,查询label为‘document‘的点
g.V().hasLabel(‘document‘)
2,查询对应属性的点是否存在
g.V().hasLabel("document").has("doc_id","2019-09-23 17:45:26.0_00845569-a566-4270-afa7-aacc00140451")
3,删除点
g.V(‘600‘).drop() //id
4,从顶点开始单步遍历到某层(不返回单步步数超过途径的点和边)
g.V().hasLabel("document").has("doc_id","0007e43b-b3ac-4e6c-9f87-a85100a712cd_2019-10-08 09:46:04.0")
.inE()
.outV()
.inE()
.outV()
.path()
5,查看单个图的整体结构
g.V().outE().as("e").inV().has("doc_id","0007e43b-b3ac-4e6c-9f87-a85100a712cd_2019-10-08 09:46:04.0").select("e")
6,增加点和边,指定属性和label
//非叶子节点 Vertex thisVertex = g.addV(key).property("doc_id", doc_id).next(); g.addE(key).from(thisVertex).to(lastVertex).next(); //叶子节点 vertex = g.addV(key).property("text", text).next(); g.addE(key).from(vertex).to(lastVertex).property("index", index).next();
原文:https://www.cnblogs.com/huxinga/p/12171515.html