Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,25 @@ public IVertex<IVertexId, IProperty> extractVertex(KgGraph<IVertexId> kgGraph) {
vertexProps.put(propertyName, value);
}
IVertexId vertexId;
String bizId;
if (vertexProps.containsKey("id")) {
vertexId = IVertexId.from(String.valueOf(vertexProps.get("id")), this.type);
bizId = String.valueOf(vertexProps.get("id"));
} else {
StringBuilder vertexIdSb = new StringBuilder();
List<String> aliasList = Lists.newArrayList(kgGraph.getVertexAlias());
aliasList.sort(String::compareTo);
for (String vertexAlias : aliasList) {
vertexIdSb.append(kgGraph.getVertex(vertexAlias).get(0).getId());
}
vertexId = IVertexId.from(vertexIdSb.toString(), this.type);
bizId = vertexIdSb.toString();
}
vertexId = IVertexId.from(bizId, this.type);
IVertex<IVertexId, IProperty> willAddedVertex =
new Vertex<>(vertexId, getVertexProperty(vertexId, this.version, context));
// DDL-created vertices must carry their business id as the "id" property; a
// follow-up rule run that uses this vertex as a start id would otherwise die
// with an NPE in LocalRDG.generateStartNodeDebugInfo (get("id").toString())
willAddedVertex.getValue().put("id", bizId);

Map<String, Set<IVertex<IVertexId, IProperty>>> alias2VertexMap = new HashMap<>();
alias2VertexMap.put(this.alias, Sets.newHashSet(willAddedVertex));
Expand Down
Loading