1. 添加图谱查询调试接口
parent
deb5e4f091
commit
15d90ec6e0
@ -0,0 +1,30 @@
|
||||
package com.supervision.police.dto.neo4j;
|
||||
|
||||
import lombok.Data;
|
||||
import org.neo4j.driver.internal.InternalNode;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class NodeDTO {
|
||||
|
||||
private long id;
|
||||
|
||||
private String elementId;
|
||||
|
||||
private Map<String, Object> properties;
|
||||
|
||||
private Collection<String> labels;
|
||||
|
||||
|
||||
public NodeDTO() {
|
||||
}
|
||||
|
||||
public NodeDTO(InternalNode internalNode) {
|
||||
this.id = internalNode.id();
|
||||
this.elementId = internalNode.elementId();
|
||||
this.properties = internalNode.asMap();
|
||||
this.labels = internalNode.labels();
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.supervision.police.dto.neo4j;
|
||||
|
||||
import lombok.Data;
|
||||
import org.neo4j.driver.internal.InternalNode;
|
||||
import org.neo4j.driver.internal.InternalRelationship;
|
||||
import org.neo4j.driver.types.Node;
|
||||
import org.neo4j.driver.types.Path;
|
||||
import org.neo4j.driver.types.Relationship;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PathDTO {
|
||||
|
||||
private List<NodeDTO> nodes;
|
||||
|
||||
private List<RelationshipValueDTO> relationships;
|
||||
|
||||
public PathDTO() {
|
||||
}
|
||||
|
||||
public PathDTO(Path path) {
|
||||
Iterator<Node> nodeIterator = path.nodes().iterator();
|
||||
List<NodeDTO> nodes = new ArrayList<>();
|
||||
while (nodeIterator.hasNext()){
|
||||
Node next = nodeIterator.next();
|
||||
nodes.add(new NodeDTO((InternalNode) next));
|
||||
}
|
||||
this.nodes = nodes;
|
||||
|
||||
|
||||
Iterator<Relationship> iterator = path.relationships().iterator();
|
||||
List<RelationshipValueDTO> relationships = new ArrayList<>();
|
||||
while (iterator.hasNext()){
|
||||
relationships.add(new RelationshipValueDTO((InternalRelationship) iterator.next()));
|
||||
}
|
||||
this.relationships = relationships;
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package com.supervision.police.dto.neo4j;
|
||||
|
||||
import lombok.Data;
|
||||
import org.neo4j.driver.internal.InternalRelationship;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class RelationshipValueDTO {
|
||||
|
||||
|
||||
private long start;
|
||||
|
||||
private String startElementId;
|
||||
|
||||
private long end;
|
||||
|
||||
private String endElementId;
|
||||
|
||||
private String type;
|
||||
|
||||
private long id;
|
||||
|
||||
private String elementId;
|
||||
|
||||
private Map<String,Object> properties;
|
||||
|
||||
|
||||
public RelationshipValueDTO() {
|
||||
}
|
||||
|
||||
public RelationshipValueDTO(InternalRelationship relationship) {
|
||||
this.start = (int) relationship.startNodeId();
|
||||
this.startElementId = relationship.startNodeElementId();
|
||||
this.end = relationship.endNodeId();
|
||||
this.endElementId = relationship.endNodeElementId();
|
||||
this.type = relationship.type();
|
||||
this.id = relationship.id();
|
||||
this.elementId = relationship.elementId();
|
||||
this.properties = relationship.asMap();
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.supervision.police.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 图谱推理调试参数
|
||||
*/
|
||||
@Data
|
||||
public class GraphDebugReqVO {
|
||||
|
||||
/**
|
||||
* 案件id
|
||||
*/
|
||||
private String caseId;
|
||||
|
||||
/**
|
||||
* 原子指标id
|
||||
*/
|
||||
private String atomicIndexId;
|
||||
|
||||
/**
|
||||
* 查询语言
|
||||
*/
|
||||
private String queryLang;
|
||||
|
||||
/**
|
||||
* 行为人id
|
||||
*/
|
||||
private List<String> lawActorIdList;
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue