Data Types·JanusGraph如何表示、写入和查询数组类型?
JanusGraph·How to represent, write or query an array in JanusGraph?
JanusGraph如何表示一个定点具有多个同名属性
JanusGraph定点的属性值不支持数组数据类型
collection的使用
If you are using Elasticsearch then you can index properties with SET and LIST cardinality. For instance:
JanusGraph·写入或导入数据·Load/Import/Write Data
以下Java函数中的codes在gremlin-server中当做
Collections(官方文档21.7)
If you are using Elasticsearch then you can index properties with SET and LIST cardinality(基数,不明白什意思). For instance:
mgmt = graph.openManagement()
nameProperty = mgmt.makePropertyKey("names").dataType(String.class).cardinality(Cardinality.SET).make() #加上.cardinality(Cardinality.SET)表示names的类型有String变为Set<String>吗?
mgmt.buildIndex("search", Vertex.class).addKey(nameProperty, Mapping.STRING.asParameter()).buildMixedIndex("search")
mgmt.commit()
//Insert a vertex
person = graph.addVertex()
person.property("names", "Robert")
person.property("names", "Bob")
graph.tx().commit()
//Now query it
g.V().has("names", "Bob").count().next() //1
g.V().has("names", "Robert").count().next() //1