Commit b6e81866 by qiuchaofei

1.获取关系类型

parent 09618782
...@@ -81,14 +81,12 @@ public class BaseRelationshipServiceImpl implements IBaseRelationshipService { ...@@ -81,14 +81,12 @@ public class BaseRelationshipServiceImpl implements IBaseRelationshipService {
List<String> relationTypes = new ArrayList<>(); List<String> relationTypes = new ArrayList<>();
String cypher = " MATCH (n)-[r]->() RETURN id(STARTNODE(r)) as startId,id(endNode(r)) as endId, type(r) as name"; String cypher = " MATCH ()-[r]->() RETURN distinct type(r) as name ";
logger.info("cypher:" + cypher); logger.info("cypher:" + cypher);
StatementResult result = session.run(cypher); StatementResult result = session.run(cypher);
while (result.hasNext()) { while (result.hasNext()) {
Record record = (Record) result.next(); Record record = (Record) result.next();
Long startId = record.get("startId").asLong();
Long endId = record.get("endId").asLong();
String name = record.get("name").asString(); String name = record.get("name").asString();
if (name.equals("Input")) { if (name.equals("Input")) {
...@@ -101,11 +99,6 @@ public class BaseRelationshipServiceImpl implements IBaseRelationshipService { ...@@ -101,11 +99,6 @@ public class BaseRelationshipServiceImpl implements IBaseRelationshipService {
name = "执行"; name = "执行";
} }
// if (name == null || name.equals("null")) {
// name = startId + "-" + "relation" + "-" + endId;
// } else {
// name = startId + "-" + name + "-" + endId;
// }
if (!relationTypes.contains(name)) { if (!relationTypes.contains(name)) {
relationTypes.add(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