集成知识图谱到项目中

dev_2.1.0
liu 1 year ago
parent f568a6acfc
commit a053f31c92

@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling
@SpringBootApplication
@MapperScan(basePackages = {"com.supervision.**.mapper"})
@EnableNeo4jRepositories("com.**.repo")

@ -6,6 +6,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
@ -19,7 +20,6 @@ import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Descriptin:
@ -161,9 +161,9 @@ public class AttributeService {
if (StrUtil.isNotBlank(substring)) {
String replaceAll = substring.replace("=", ":");
String result = "{" + replaceAll + "}";
Map map = JSONUtil.toBean(JSONUtil.toJsonStr(result), Map.class);
if (map.containsKey("comment")) {
Object comment = map.get("comment");
JSONObject entries = JSONUtil.parseObj(JSONUtil.toJsonStr(result));
if (entries.containsKey("comment")) {
Object comment = entries.get("comment");
datum.getRow().add(comment.toString());
} else {
datum.getRow().add("");

@ -9,7 +9,7 @@ import com.supervision.nebula.util.NebulaUtil;
import com.supervision.nebula.vo.AttributeVo;
import com.supervision.nebula.vo.CommonVo;
import com.supervision.nebula.vo.DetailSpace;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
@ -19,14 +19,13 @@ import java.util.List;
* @ClassName: SpaceService
*/
@Service
@RequiredArgsConstructor
public class SpaceService {
@Autowired
GraphCommonService graphCommonService;
private final GraphCommonService graphCommonService;
public List<CommonVo> createSpace(GraphCreateSpace graphCreateSpace) {
List list = graphCommonService.executeJson(NebulaUtil.createSpace(graphCreateSpace), CommonVo.class);
return list;
return graphCommonService.executeJson(NebulaUtil.createSpace(graphCreateSpace), CommonVo.class);
}
public List<DetailSpace> detailSpace(GraphShowAttribute graphShowAttribute) {
@ -41,9 +40,8 @@ public class SpaceService {
for (AttributeVo.DataBean datum : attributeVo1.getData()) {
int tagsNum = 0;
int edgesNum = 0;
int tag = 0;
detailSpace = new DetailSpace();
// 查询tgas/edges
// 查询tags/edges
String spaceName = datum.getRow().get(0);
graphShowAttribute.setSpace(spaceName);
graphShowAttribute.setAttribute(AttributeEnum.TAGS.name());

@ -2,9 +2,8 @@ package com.supervision.nebula.service;
import cn.hutool.core.date.DateUtil;
import com.supervision.nebula.vo.AttributeVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@ -13,12 +12,11 @@ import org.springframework.stereotype.Component;
* @since 2023/1/29 16:14
*/
@Component
@EnableScheduling
@Slf4j
@RequiredArgsConstructor
public class TaskService {
@Autowired
GraphCommonService graphCommonService;
private final GraphCommonService graphCommonService;
/**
* ,session

@ -11,8 +11,8 @@ import com.supervision.nebula.dto.graph.GraphSpace;
import com.supervision.nebula.dto.graph.GraphVertexTatAttributeQuery;
import com.supervision.nebula.dto.graph.GraphVertexTatsQuery;
import com.supervision.nebula.util.NebulaUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@ -24,10 +24,10 @@ import java.util.Map;
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class VertexService {
@Autowired
GraphCommonService graphCommonService;
private final GraphCommonService graphCommonService;
public List<NebulaVertexJsonResult> vertexList(String space) {
return graphCommonService.executeJson(NebulaUtil.queryMatch(space), NebulaVertexJsonResult.class);
@ -40,9 +40,6 @@ public class VertexService {
/**
* tag
*
* @param graphVertexTatsQuery
* @return
*/
public List<NebulaVertexJsonResult> vertexTagsQuery(GraphVertexTatsQuery graphVertexTatsQuery) {
String vidType = graphCommonService.getVidType(graphVertexTatsQuery.getSpace());
@ -51,9 +48,6 @@ public class VertexService {
/**
* tag
*
* @param graphVertexTatAttributeQuery
* @return
*/
public List<NebulaVertexJsonResult> vertexTagAttributeQuery(GraphVertexTatAttributeQuery graphVertexTatAttributeQuery) {
return graphCommonService.executeJson(NebulaUtil.vertexTagAttributeQuery(graphVertexTatAttributeQuery), NebulaVertexJsonResult.class);
@ -61,9 +55,6 @@ public class VertexService {
/**
*
*
* @param graphVertexTatsQuery
* @return
*/
public Map<String, Object> vertexPage(GraphVertexTatsQuery graphVertexTatsQuery) {
List<NebulaVertexJsonResult> list;
@ -88,9 +79,6 @@ public class VertexService {
/**
*
*
* @param graphSpace
* @return
*/
public List<NebulaVertexJsonResult> randomList(GraphSpace graphSpace) {

Loading…
Cancel
Save