当前位置:网站首页>Py2neo basic syntax
Py2neo basic syntax
2022-06-27 05:06:00 【Thought is tightening】
1. Import library
import py2neo
from py2neo import Graph,Node,Relationship,NodeMatcher
2. Connect neo4j
graph_ = Graph("http://localhost:7474", auth=("username", "password"))
# g = Graph('http://username:[email protected]:7474') Sure
# Here's how to write it ,py2neo-2021.2.3 I won't support it .
# graph = Graph('http://127.0.0.1:7474', username="your_username", password="your_password")
3. Create nodes 、 Relationship
Method 1 : Import txt or csv Document to neo4j
Reference resources : Knowledge map actual battle : Build a knowledge map of a dream of Red Mansions _ Ren Caixue programming blog -CSDN Blog
stay jupyter Created in the txt Files can be imported directly
If it is csv file , It is recommended to open it with Notepad , Save as
bom-utf-8Format csv file
Method 2 : Use py2neo Chinese grammar
Reference resources :py2neo——Neo4j&python In combination with - Simple books (jianshu.com)
4. perform cypher command
It is recommended to delete all existing nodes before creating them , Avoid query confusion
# Delete all nodes and relationships in the database
graph_.run('MATCH (n) detach delete n')
# View all nodes and relationships in the database
MATCH (n) RETURN n
边栏推荐
- 020 basics of C language: C language forced type conversion and error handling
- stm32单片机引脚_如何将单片机的引脚配置为上拉输入
- jq怎么获取元素的id名
- Microservice system design - service fusing and degradation design
- 021 C语言基础:递归,可变参数
- 面试:Selenium 中有哪几种定位方式?你最常用的是哪一种?
- Cultural tourism light show breaks the time and space constraints and shows the charm of night tour in the scenic spot
- 第2章 关键技术介绍
- Halon common affine transformation operators
- Microservice system design -- distributed transaction service design
猜你喜欢

Niuke practice 101-c reasoning clown - bit operation + thinking

Microservice system design -- microservice monitoring and system resource monitoring design

【Unity】UI交互组件之按钮Button&可选基类总结

差点因为 JSON.stringify 丢了奖金...

Terminal in pychar cannot enter the venv environment

跟着BUU学习Crypto(周更)

微服务系统设计——微服务调用设计

渗透测试-目录遍历漏洞

深潜Kotlin协程(十五):测试 Kotlin 协程

日志收集系統
随机推荐
015 C语言基础:C结构体、共用体
Penetration test - file upload / download / include
stm32读取IO高低电平状态
jq怎么获取倒数的元素
Advanced Mathematics (Seventh Edition) Tongji University exercises 1-10 personal solutions
微服务系统设计——微服务监控与系统资源监控设计
跟着BUU学习Crypto(周更)
什么是BFC?有什么用?
Deep dive kotlin synergy (XV): Test kotlin synergy
neo4j图数据库基本概念
【B站UP DR_CAN学习笔记】Kalman滤波1
The most detailed download tutorial of MySQL
微服务系统设计——API 网关服务设计
006 C language foundation: C storage class
第2章 关键技术介绍
微服务系统设计——分布式锁服务设计
微服务系统设计——服务注册与发现和配置设计
022 basics of C language: C memory management and C command line parameters
STM32 reads IO high and low level status
Microservice system design -- message caching service design