国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步

這篇具有很好參考價(jià)值的文章主要介紹了圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot

前言


圖形數(shù)據(jù)庫是專門用于存儲(chǔ)圖形數(shù)據(jù)的數(shù)據(jù)庫,它使用圖形模型來存儲(chǔ)數(shù)據(jù),并且支持復(fù)雜的圖形查詢。常見的圖形數(shù)據(jù)庫有Neo4j、OrientDB等。

Neo4j是用Java實(shí)現(xiàn)的開源NoSQL圖數(shù)據(jù)庫,本篇博客介紹如何在SpringBoot中使用Neo4j圖數(shù)據(jù)庫,如何進(jìn)行簡(jiǎn)單的增刪改查,以及如何進(jìn)行復(fù)雜的查詢。

本篇博客相關(guān)代碼的git網(wǎng)址如下:

https://gitee.com/pet365/spring-boot-neo4j

關(guān)于Neo4j的博客文章如下:

  • 圖數(shù)據(jù)庫Neo4j——Neo4j簡(jiǎn)介、數(shù)據(jù)結(jié)構(gòu) & Docker版本的部署安裝 & Cypher語句的入門

引出


1.Neo4j是用Java實(shí)現(xiàn)的開源NoSQL圖數(shù)據(jù)庫;
2.SpringBoot使用Neo4j,繼承Neo4jRepository進(jìn)行簡(jiǎn)單增刪改查;
3.使用Neo4jClient進(jìn)行復(fù)雜的查詢;文章來源地址http://www.zghlxwxcb.cn/news/detail-740129.html

springBoot整合

1、引入依賴

<!--        neo4j的包-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-neo4j</artifactId>
        </dependency>

2、配置文件

server:
  port: 9902
logging:
  level:
    org.springframework.data.neo4j: debug
spring:
  application:
    name: spring-neo4j
  data:
    neo4j:
      database: neo4j
  neo4j:
    authentication:
      username: neo4j
      password: neo4j123
    uri: neo4j://192.168.150.101:7687

3、實(shí)體類定義

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot

提取抽象類

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot

不同的節(jié)點(diǎn)類,網(wǎng)點(diǎn)、一級(jí)轉(zhuǎn)運(yùn)中心、二級(jí)轉(zhuǎn)運(yùn)中心

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot

4、dao繼承Neo4jRepository

進(jìn)行自定義查詢:

Keyword Sample Cypher snippet
After findByLaunchDateAfter(Date date) n.launchDate > date
Before findByLaunchDateBefore(Date date) n.launchDate < date
Containing (String) findByNameContaining(String namePart) n.name CONTAINS namePart
Containing (Collection) findByEmailAddressesContains(Collection addresses) findByEmailAddressesContains(String address) ANY(collectionFields IN [addresses] WHERE collectionFields in n.emailAddresses) ANY(collectionFields IN address WHERE collectionFields in n.emailAddresses)
In findByNameIn(Iterable names) n.name IN names
Between findByScoreBetween(double min, double max) findByScoreBetween(Range range) n.score >= min AND n.score <= max Depending on the Range definition n.score >= min AND n.score <= max or n.score > min AND n.score < max
StartingWith findByNameStartingWith(String nameStart) n.name STARTS WITH nameStart
EndingWith findByNameEndingWith(String nameEnd) n.name ENDS WITH nameEnd
Exists findByNameExists() EXISTS(n.name)
True findByActivatedIsTrue() n.activated = true
False findByActivatedIsFalse() NOT(n.activated = true)
Is findByNameIs(String name) n.name = name
NotNull findByNameNotNull() NOT(n.name IS NULL)
Null findByNameNull() n.name IS NULL
GreaterThan findByScoreGreaterThan(double score) n.score > score
GreaterThanEqual findByScoreGreaterThanEqual(double score) n.score >= score
LessThan findByScoreLessThan(double score) n.score < score
LessThanEqual findByScoreLessThanEqual(double score) n.score <= score
Like findByNameLike(String name) n.name =~ name
NotLike findByNameNotLike(String name) NOT(n.name =~ name)
Near findByLocationNear(Distance distance, Point point) distance( point(n),point({latitude:lat, longitude:lon}) ) < distance
Regex findByNameRegex(String regex) n.name =~ regex
And findByNameAndDescription(String name, String description) n.name = name AND n.description = description
Or findByNameOrDescription(String name, String description) n.name = name OR n.description = description (Cannot be used to OR nested properties)

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot

package com.tianju.mapper;

import com.tianju.entity.AgencyEntity;
import org.mapstruct.Mapper;
import org.springframework.data.neo4j.repository.Neo4jRepository;

/**
 * 網(wǎng)點(diǎn)的mapper,比如菜鳥驛站
 */
@Mapper
public interface AgencyMapper extends Neo4jRepository<AgencyEntity,Long> {
    /**
     * 根據(jù)bid 查詢
     * @param bid 業(yè)務(wù)id
     * @return 網(wǎng)點(diǎn)數(shù)據(jù)
     */
    AgencyEntity findByBid(Long bid);


    /**
     * 根據(jù)bid刪除
     *
     * @param bid 業(yè)務(wù)id
     * @return 刪除的數(shù)據(jù)條數(shù)
     */
    Long deleteByBid(Long bid);
}

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot

復(fù)雜查詢

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot

最短路徑查詢

//查詢兩個(gè)網(wǎng)點(diǎn)之間最短路徑,查詢深度最大為10
MATCH path = shortestPath((n:AGENCY) -[*..10]->(m:AGENCY))WHERE n.name = "北京市昌平區(qū)定泗路" AND m.name = "上海市浦東新區(qū)南匯"RETURN path

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot

package com.tianju.mapper.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.db.meta.Column;
import com.tianju.dto.OrganDTO;
import com.tianju.dto.TransportLineNodeDTO;
import com.tianju.entity.AgencyEntity;
import com.tianju.enums.OrganTypeEnum;
import com.tianju.mapper.TransportLineRepository;
import org.neo4j.driver.internal.InternalPoint2D;
import org.neo4j.driver.types.Path;
import org.neo4j.driver.types.Relationship;
import org.springframework.data.neo4j.core.schema.Node;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.neo4j.core.Neo4jClient;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.Optional;

@Component
public class TransportLineRepositoryImpl implements TransportLineRepository {

    @Autowired
    private Neo4jClient neo4jClient;

    /**
     * 查詢最短路線
     * @param start 開始網(wǎng)點(diǎn)
     * @param end   結(jié)束網(wǎng)點(diǎn)
     * @return
     */
    @Override
    public TransportLineNodeDTO findShortestPath(AgencyEntity start, AgencyEntity end) {
        // 獲取網(wǎng)點(diǎn)數(shù)據(jù)在Neo4j中的類型 @Node("AGENCY") @Node("OLT")
        String type = AgencyEntity.class.getAnnotation(Node.class).value()[0];
        // 構(gòu)造Sql語句 $startId
//        String cql = "MATCH path = shortestPath((n:AGENCY) -[*..10]->(m:AGENCY))\n" +
//                "WHERE n.bid = $startId AND m.bid = $endId\n" +
//                "RETURN path";
        String cql = StrUtil.format("MATCH path = shortestPath((n:{}) -[*..10]->(m:{})) " +
                "WHERE n.bid = $startId AND m.bid = $endId " +
                "RETURN path",type,type);
        // 執(zhí)行自定義查詢
        Neo4jClient.RecordFetchSpec<TransportLineNodeDTO> recordFetchSpec = neo4jClient.query(cql)
                .bind(start.getBid()).to("startId") // 替換 $startId
                .bind(end.getBid()).to("endId")  // 替換 $endId
                .fetchAs(TransportLineNodeDTO.class)   // 設(shè)置響應(yīng)類型,指定為 TransportLineNodeDTO 類型
                .mappedBy((typeSystem, record) -> {    // 設(shè)置結(jié)果集映射
                    Path path = record.get(0).asPath();// 得到第一條路線
                    TransportLineNodeDTO transportLineNodeDTO = new TransportLineNodeDTO();

                    path.nodes().forEach(node -> { // 將每個(gè)節(jié)點(diǎn)信息封裝成一個(gè) OrganDto
                        // 獲得節(jié)點(diǎn)的 鍵值對(duì) address: 上海市轉(zhuǎn)運(yùn)中心;bid:8002
                        Map<String, Object> map = node.asMap();
                        // {name=北京市昌平區(qū)定泗路,
                        // location=Point{srid=4326, x=116.37212849638287, y=40.11765281246394},
                        // address=北七家鎮(zhèn)定泗路蒼龍街交叉口, bid=100280, phone=010-86392987}
                        System.out.println("map: "+map);

                        // 把鍵值對(duì)轉(zhuǎn)換成對(duì)象 OrganDTO
                        OrganDTO organDTO = BeanUtil.toBeanIgnoreError(map, OrganDTO.class);
                        // organDTO:
                        // OrganDTO(id=100280, name=北京市昌平區(qū)定泗路, type=null, phone=010-86392987,
                        // address=北七家鎮(zhèn)定泗路蒼龍街交叉口, latitude=null, longitude=null)
                        // type,latitude,longitude 沒有映射成功
                        System.out.println("organDTO: "+organDTO);

                        // 獲得標(biāo)簽的名稱 OLT,TLT,
                        String first = CollUtil.getFirst(node.labels());
                        // 根據(jù)OLT獲得枚舉類型 OLT(1, "一級(jí)轉(zhuǎn)運(yùn)中心"),
                        OrganTypeEnum organTypeEnum = OrganTypeEnum.valueOf(first);
                        // 再獲得枚舉類型的 code :1、2、3
                        organDTO.setType(organTypeEnum.getCode()); // 設(shè)置類型的映射

                        // 經(jīng)緯度 "location": point({srid:4326, x:121.59815370294322, y:31.132409729356993})
                        InternalPoint2D location = MapUtil.get(map, "location", InternalPoint2D.class); // 經(jīng)緯度 BeanUtil.getProperty(map.get("location"),"x");
                        organDTO.setLatitude(location.x());  // 設(shè)置經(jīng)緯度映射
                        organDTO.setLongitude(location.y()); // 經(jīng)緯度映射
                        // OrganDTO(id=100280, name=北京市昌平區(qū)定泗路, type=3,
                        // phone=010-86392987, address=北七家鎮(zhèn)定泗路蒼龍街交叉口,
                        // latitude=116.37212849638287, longitude=40.11765281246394)
                        System.out.println("organDTO: "+organDTO);

                        transportLineNodeDTO.getNodeList().add(organDTO);
                    });

                    System.out.println("transportLineNodeDTO: "+transportLineNodeDTO);

                    path.relationships().forEach(relationship -> {
                        // 路徑下面的關(guān)系
                        Map<String, Object> map = relationship.asMap();
                        Double cost = MapUtil.get(map, "cost", Double.class);
                        transportLineNodeDTO.setCost(cost + transportLineNodeDTO.getCost());
                    });

                    System.out.println("transportLineNodeDTO: "+transportLineNodeDTO);
                    return transportLineNodeDTO;
                });
        Optional<TransportLineNodeDTO> one = recordFetchSpec.one(); // Optional,1.8提供的,可以處理null的情況
        return one.orElse(null); // 如果為null,就返回null,如果不是null,就返回結(jié)果
    }
}

最小成本查詢

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot

package com.tianju.mapper.impl;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.db.meta.Column;
import com.tianju.dto.OrganDTO;
import com.tianju.dto.TransportLineNodeDTO;
import com.tianju.entity.AgencyEntity;
import com.tianju.enums.OrganTypeEnum;
import com.tianju.mapper.TransportLineRepository;
import org.neo4j.driver.internal.InternalPoint2D;
import org.neo4j.driver.types.Path;
import org.neo4j.driver.types.Relationship;
import org.springframework.data.neo4j.core.schema.Node;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.neo4j.core.Neo4jClient;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.Optional;

@Component
public class TransportLineRepositoryImpl implements TransportLineRepository {

    @Autowired
    private Neo4jClient neo4jClient;


    @Override
    public TransportLineNodeDTO findCostLeastPath(AgencyEntity start, AgencyEntity end) {
        String type = AgencyEntity.class.getAnnotation(Node.class).value()[0];

        String cqlB = "MATCH path = (n:{}) -[*..10]->(m:{}) " +
                "WHERE n.bid = $startId AND m.bid = $endId " +
                "UNWIND relationships(path) AS r " +
                "WITH sum(r.cost) AS cost, path " +
                "RETURN path ORDER BY cost ASC, LENGTH(path) ASC LIMIT 1";
        String cql = StrUtil.format(cqlB, type,type);

        Optional<TransportLineNodeDTO> one = neo4jClient.query(cql)
                .bind(start.getBid()).to("startId")
                .bind(end.getBid()).to("endId")
                .fetchAs(TransportLineNodeDTO.class)
                .mappedBy(((typeSystem, record) -> {
                    Path path = record.get(0).asPath();
                    TransportLineNodeDTO transportLineNodeDTO = new TransportLineNodeDTO();

                    path.nodes().forEach(node -> {
                        Map<String, Object> map = node.asMap();
                        OrganDTO organDTO = BeanUtil.toBeanIgnoreError(map, OrganDTO.class);
                        // 獲得標(biāo)簽的名稱 OLT,TLT,
                        String first = CollUtil.getFirst(node.labels());
                        // 根據(jù)OLT獲得枚舉類型 OLT(1, "一級(jí)轉(zhuǎn)運(yùn)中心"),
                        OrganTypeEnum organTypeEnum = OrganTypeEnum.valueOf(first);
                        // 再獲得枚舉類型的 code :1、2、3
                        organDTO.setType(organTypeEnum.getCode()); // 設(shè)置類型的映射

                        // 經(jīng)緯度 "location": point({srid:4326, x:121.59815370294322, y:31.132409729356993})
                        InternalPoint2D location = MapUtil.get(map, "location", InternalPoint2D.class); // 經(jīng)緯度 BeanUtil.getProperty(map.get("location"),"x");
                        organDTO.setLatitude(location.x());  // 設(shè)置經(jīng)緯度映射
                        organDTO.setLongitude(location.y()); // 經(jīng)緯度映射
                        transportLineNodeDTO.getNodeList().add(organDTO);
                    });

                    path.relationships().forEach(relationship -> {
                        // 路徑下面的關(guān)系
                        Map<String, Object> map = relationship.asMap();
                        Double cost = MapUtil.get(map, "cost", Double.class);
                        transportLineNodeDTO.setCost(cost + transportLineNodeDTO.getCost());
                    });
                    return transportLineNodeDTO;
                })).one();
        return one.orElse(null);
    }

    private void findShortestPathMy(){
        String cql = "MATCH path = shortestPath((n:AGENCY) -[*..10]->(m:AGENCY)) " +
                "WHERE n.bid = 210127 AND m.bid = 100260 " +
                "RETURN path";
        // 執(zhí)行自定義查詢
        Neo4jClient.UnboundRunnableSpec query = neo4jClient.query(cql);

        ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();


    }
}

圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步,# Database,數(shù)據(jù)庫,neo4j,spring boot


總結(jié)

1.Neo4j是用Java實(shí)現(xiàn)的開源NoSQL圖數(shù)據(jù)庫;
2.SpringBoot使用Neo4j,繼承Neo4jRepository進(jìn)行簡(jiǎn)單增刪改查;
3.使用Neo4jClient進(jìn)行復(fù)雜的查詢;

到了這里,關(guān)于圖數(shù)據(jù)庫Neo4j——SpringBoot使用Neo4j & 簡(jiǎn)單增刪改查 & 復(fù)雜查詢初步的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Springboot項(xiàng)目連接neo4j數(shù)據(jù)庫

    首先創(chuàng)建一個(gè)springboot項(xiàng)目,這里不再介紹。 連接 neo4j 數(shù)據(jù)庫的依賴包 spring-boot-starter-data-neo4j依賴包 mybatis-plus依賴包

    2024年02月12日
    瀏覽(23)
  • SpringBoot版本和Neo4j圖數(shù)據(jù)庫版本對(duì)應(yīng)關(guān)系

    Neo4j OGM Version Neo4j Version Bolt Version# Spring Data Neo4j Version Spring Boot Version 3.1.0+ 3.1.x, 3.2.x, 3.3.x 1.5.0+ (compatible with 1.4.0+) 5.1.0+ (compatible with 5.0.0+) 2.0.0+ 3.0.0+ 3.1.x, 3.2.x, 3.3.x 1.4.0+ 5.0.0+ 2.0.0+ 2.1.0+ 2.3.x, 3.0.x, 3.1.x 1.1.0+ 4.2.0+ 1.5.0+ 2.0.2+ 2.3.x, 3.0.x 1.0.0+ 4.1.2 - 4.1.6+ 1.4.x 2.0.1* 2.2.x, 2.3.x 1.0.0-

    2024年02月09日
    瀏覽(22)
  • Neo4j數(shù)據(jù)庫使用相關(guān)

    Neo4j數(shù)據(jù)庫使用相關(guān)

    做知識(shí)圖譜相關(guān)項(xiàng)目,初步使用了neo4j數(shù)據(jù)庫,簡(jiǎn)單記錄一下使用過程和踩坑備忘~ 操作系統(tǒng)Win10+Neo4j社區(qū)版(community,版本4.4.30) 目錄 一、安裝 1.1 安裝Java和Neo4j 1.2 環(huán)境變量設(shè)置 二、 Neo4j使用 2.1 安裝服務(wù) 2.2?數(shù)據(jù)庫使用 2.3 數(shù)據(jù)庫備份 ?Java下載鏈接:Java Downloads | Oracle

    2024年04月16日
    瀏覽(26)
  • 【大數(shù)據(jù)】Neo4j 圖數(shù)據(jù)庫使用詳解

    目錄 一、圖數(shù)據(jù)庫介紹 1.1 什么是圖數(shù)據(jù)庫 1.2 為什么需要圖數(shù)據(jù)庫 1.3?圖數(shù)據(jù)庫應(yīng)用領(lǐng)域

    2024年02月08日
    瀏覽(21)
  • Neo4j圖數(shù)據(jù)庫的使用筆記

    Neo4j圖數(shù)據(jù)庫的使用筆記

    安裝準(zhǔn)備: neo4j-3.4.0版本的zip包 找個(gè)目錄解壓安裝zip包 啟動(dòng)neo4j 下載neo4j-3.4.0版本的zip包 可以去neo4j官網(wǎng)下載,也可以去微云數(shù)聚官網(wǎng)下載。 微云數(shù)聚是neo4j在國(guó)內(nèi)的代理商。 解壓到F:neo4jneo4j-chs-community-3.4.0-windows 控制臺(tái)方式啟動(dòng)neo4j 通過7474端口訪問neo4j提供的web管理工具

    2024年02月16日
    瀏覽(22)
  • Neo4j數(shù)據(jù)庫介紹及簡(jiǎn)單使用

    Neo4j數(shù)據(jù)庫介紹及簡(jiǎn)單使用

    圖數(shù)據(jù)庫是一種專門設(shè)計(jì)用于存儲(chǔ)和管理圖形數(shù)據(jù)的數(shù)據(jù)庫類型。在圖數(shù)據(jù)庫中,數(shù)據(jù)以圖的形式表示,其中節(jié)點(diǎn)表示實(shí)體,邊表示實(shí)體之間的關(guān)系。這種表示方式非常適合處理具有復(fù)雜關(guān)系的數(shù)據(jù),如社交網(wǎng)絡(luò)、推薦系統(tǒng)、網(wǎng)絡(luò)拓?fù)?、生物信息學(xué)等領(lǐng)域的數(shù)據(jù)。 圖數(shù)據(jù)庫通

    2024年02月04日
    瀏覽(23)
  • 圖數(shù)據(jù)庫—Neo4j使用指南

    目錄 Q / A Neo4j 安裝 Basic concept Cypher Basic MATCH 查詢 WITH INDEX 索引 最短路徑 Shortest path Movie Graph Create 創(chuàng)建 Find 查找 Query 查詢 Solve 最短路徑 Bacon Path Recommend 推薦 Clean up 刪除電影數(shù)據(jù) LOAD CSV 加載 Persons Movies 數(shù)據(jù) Northwind Graph Northwind 數(shù)據(jù)表結(jié)構(gòu) 加載 Product Catalog CSV 文件 創(chuàng)建 Pr

    2024年02月02日
    瀏覽(47)
  • 圖數(shù)據(jù)庫_Neo4j的使用場(chǎng)景_以及Windows版Neo4j Community Server安裝_欺詐檢測(cè)_推薦_知識(shí)圖譜---Neo4j圖數(shù)據(jù)庫工作筆記0003

    圖數(shù)據(jù)庫_Neo4j的使用場(chǎng)景_以及Windows版Neo4j Community Server安裝_欺詐檢測(cè)_推薦_知識(shí)圖譜---Neo4j圖數(shù)據(jù)庫工作筆記0003

    可以看到使用場(chǎng)景,比如欺詐檢測(cè), 要建立圖譜,才能進(jìn)行,欺詐人員檢測(cè) ? 可以看到圖譜的各種應(yīng)用場(chǎng)景 然后推薦引擎也需要,可以看到 在金融,旅行,求職招聘,保健,服務(wù),媒體娛樂,都可以進(jìn)行推薦 ? 然后還有知識(shí)圖譜 身份訪問管理,這里,可以進(jìn)行安全管理,可以挖掘出潛在關(guān)系

    2024年02月12日
    瀏覽(29)
  • Python操作Neo4j數(shù)據(jù)庫使用案例

    Python操作Neo4j數(shù)據(jù)庫使用案例

    ??Neo4j是一個(gè)世界領(lǐng)先的開源的基于圖的數(shù)據(jù)庫。其語言操作簡(jiǎn)單直觀,本文假設(shè)你已經(jīng)安裝好Neo4j數(shù)據(jù)庫,并對(duì)知識(shí)圖譜有一定的了解。Neo4j數(shù)據(jù)庫的查詢語言為CQL,其代表Cypher查詢語言。 像Oracle數(shù)據(jù)庫具有查詢語言SQL,Neo4j具有CQL作為查詢語言。你可以訪問(https://www.

    2024年02月03日
    瀏覽(20)
  • 使用apoc將數(shù)據(jù)從數(shù)據(jù)庫導(dǎo)入neo4j

    1、創(chuàng)建實(shí)體 這段代碼的目的是從 ClickHouse 數(shù)據(jù)庫中加載數(shù)據(jù)到 Neo4j 圖數(shù)據(jù)庫,并在加載過程中使用 APOC(Awesome Procedures on Cypher)庫提供的 apoc.merge.node 過程來合并數(shù)據(jù),確保在圖數(shù)據(jù)庫中的節(jié)點(diǎn)具有唯一性。 逐行解釋這段代碼: CREATE CONSTRAINT uniq_law_id ON (p:Law) ASSERT p.id IS

    2024年02月21日
    瀏覽(26)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包