连接图数据库+最短路径分析功能
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.neo4j.driver.v1.*;
import org.neo4j.driver.v1.types.Node;
import org.neo4j.driver.v1.types.Path;
import org.neo4j.driver.v1.types.Relationship;
import java.util.*;
public class Neo4jBatchTest {
static Driver driver = GraphDatabase.driver("bolt://127.0.0.1:7687", AuthTokens.basic("neo4j", "123456"));
private static Session session = driver.session();
public static void main(String[] args) throws Exception {
shortEstPath();
}
/**
* 批量创建
*
* @throws Exception
*/
public static void shortEstPath() throws Exception {
try {
String cmdSql = "MATCH n=shortestPath((a)-[*]-(b))