Commit 4cbc5913 by qiuchaofei

1.修改获取全部关系类型的方法2

parent b023e792
......@@ -81,12 +81,14 @@ public class BaseRelationshipServiceImpl implements IBaseRelationshipService {
List<String> relationTypes = new ArrayList<>();
String cypher = "MATCH ()-[r]->() RETURN distinct type(r) as name ";
String cypher = " MATCH (n)-[r]->() RETURN id(STARTNODE(r)) as startId,id(endNode(r)) as endId, type(r) as name";
logger.info("cypher:" + cypher);
StatementResult result = session.run(cypher);
while (result.hasNext()) {
Record record = (Record) result.next();
Long startId = record.get("startId").asLong();
Long endId = record.get("endId").asLong();
String name = record.get("name").asString();
if (name.equals("Input")) {
......@@ -99,6 +101,11 @@ public class BaseRelationshipServiceImpl implements IBaseRelationshipService {
name = "执行";
}
// if (name == null || name.equals("null")) {
// name = startId + "-" + "relation" + "-" + endId;
// } else {
// name = startId + "-" + name + "-" + endId;
// }
if (!relationTypes.contains(name)) {
relationTypes.add(name);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment