neo4j是一个图形数据库,有一个做关系图谱的需求里面需要使用到图形数据库。
w3c教程:https://www.w3cschool.cn/neo4j/
中文版的数据库可以通过image属性显示图片,官网的动画效果是通过3D.js实现的;
pom导入配置
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-neo4j</artifactId>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-ogm-http-driver</artifactId>
<version>3.1.4</version>
</dependency>
配置数据库:
#neo4j
spring.data.neo4j.username=neo4j
spring.data.neo4j.password=123
spring.data.neo4j.uri=http://192.168.100.106:7474
package com.koala.console.configuration;
import org.neo4j.ogm.session.SessionFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
import org.springframework.data.neo4j.transaction.Neo4jTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@Configuration
@EnableNeo4jRepositories(basePackages = "com.koala.console.repository.neo4j")
@EnableTransactionManagement
public class Neo4jConfig {
@Value("${blotUri}")
private String uri;
@Value("${spring.data.neo4j.uri}")
private String databaseUrl;
@Value(