(三)Neo4j自带northwind案例--Cypher语言应用

0、概述

通过该案例,应用Cypher查询语言,感受Neo4j套路。官方的用此案例的用意:

The Northwind Graph demonstrates how to migrate(迁移) from a relational database to Neo4j(把一个负责的多表关系数据库关系等价转化为图数据中,并且查询表现出巨大的优势). The transformation is iterative and deliberate, emphasizing the conceptual shift from relational tables to the nodes and relationships of a graph.

This guide will show you how to:

  1. Load: create data from external CSV files(加载数据)
  2. Index: index nodes based on label
  3. Relate: transform foreign key references into data relationships
  4. Promote: transform join records into relationships

1、找到位置

:play start

弹出如下界面:

northwind

点击中间的“Jump into code”,进入到如下界面:

Northwind

 

这里有Movie Graph和Northwind Graph两个案例,这里演示第二个案例。

2、 Load: create data from external products CSV files

LOAD CSV WITH HEADERS FROM "http://data.neo4j.com/northwind/products.csv" AS row
CREATE (n:Product)
SET n = row,
n.unitPrice = toFloat(row.unitPrice),
n.unitsInStock = toInteger(row.unitsInStock), n.unitsOnOrder = toInteger(row.unitsOnOrder),
n.reorderLevel = toInteger(row.reorderLevel), n.discontinued = (row.discontinued
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值