diff --git a/ruoyi-modules/management-platform/pom.xml b/ruoyi-modules/management-platform/pom.xml
index cee6c681..5d8bbd33 100644
--- a/ruoyi-modules/management-platform/pom.xml
+++ b/ruoyi-modules/management-platform/pom.xml
@@ -248,6 +248,21 @@
hutool-all
5.8.5
+
+
+ org.springframework.boot
+ spring-boot-starter-data-neo4j
+
+
+ com.alibaba
+ easyexcel
+ 4.0.3
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/config/Neo4jConfig.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/config/Neo4jConfig.java
new file mode 100644
index 00000000..5f90cbca
--- /dev/null
+++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/config/Neo4jConfig.java
@@ -0,0 +1,15 @@
+package com.ruoyi.platform.config;
+
+import org.neo4j.cypherdsl.core.renderer.Dialect;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+
+@Configuration
+public class Neo4jConfig {
+ @Bean
+ org.neo4j.cypherdsl.core.renderer.Configuration cypherDslConfiguration() {
+ return org.neo4j.cypherdsl.core.renderer.Configuration.newConfig()
+ .withDialect(Dialect.NEO4J_5).build();
+ }
+}
\ No newline at end of file
diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/kg/MatKGController.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/kg/MatKGController.java
new file mode 100644
index 00000000..5a381afd
--- /dev/null
+++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/kg/MatKGController.java
@@ -0,0 +1,124 @@
+package com.ruoyi.platform.controller.kg;
+
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.platform.utils.ExcelReaderInputStream;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.File;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/kg")
+public class MatKGController {
+
+ @PostMapping("/uploadOntology")
+ public R uploadOntology(@RequestParam("file") MultipartFile file,
+ @RequestParam("param") String param) {
+ if (file.isEmpty()) {
+ return R.fail("文件为空");
+ }
+
+ try {
+ // 直接读取文件内容为字符串
+ String jsonContent = new String(file.getBytes(), StandardCharsets.UTF_8);
+
+ return R.ok();
+ } catch (Exception e) {
+ return R.fail("文件处理失败: " + e.getMessage());
+ }
+ }
+
+ @PostMapping("/uploadKGData")
+ public R uploadKGData(@RequestParam("file") MultipartFile file,
+ @RequestParam("id") String id) {
+ if (file.isEmpty()) {
+ return R.fail("文件为空");
+ }
+ // 检查文件类型
+ String contentType = file.getContentType();
+ String fileName = file.getOriginalFilename();
+ if (!isValidFileType(contentType, fileName)) {
+ return R.fail("不支持的文件格式。请上传CSV、XLSX或JSON文件。");
+ }
+
+ try {
+ // 创建目标文件
+ InputStream inputStream = file.getInputStream();
+
+ // 处理文件和参数
+ processJsonFile(inputStream, id);
+
+ return R.ok();
+ } catch (Exception e) {
+ return R.fail("文件处理失败: " + e.getMessage());
+ }
+ }
+
+ private void processJsonFile(InputStream inputStream, String id) {
+ ExcelReaderInputStream