unipop-graph / unipop

Data Integration Graph
Apache License 2.0
203 stars 35 forks source link

Failed in adding vertex to elastic graph #110

Open zxnblake opened 6 years ago

zxnblake commented 6 years ago

It can load the vertex and edge data to graph from my ES store, but I cannot add vertex to it. My code is as follows: BaseConfiguration conf = new BaseConfiguration(); conf.addProperty("providers", "D:/work/gdb/docs/conf"); UniGraph graph = UniGraph.open(conf); GraphTraversalSource g = graph.traversal(); graph.addVertex(T.id, "3", T.label, "software", "name", "gremlin"); After reading the code, I found in the StaticPropertySchema, there is the following method: public Map<String, Object> toFields(Map<String, Object> prop) { Object o = prop.get(this.key); if(o == null || o.equals(this.value)) return Collections.emptyMap(); return null; } In the method, the key and value is always the V(1) vertext, and my prop of new vertext is not equal to V(1) props, so this method always return null. And so my vertex will never be added to ES store. Anyone can help give an explanation on it? @seanbarzilay

seanbarzilay commented 6 years ago

@zxnblake can you provide you mapping file?