赞
踩
反正以后估计不咋会看,一开始就看看留点印象吧。
目录
6、关系属性 Relationship properties
图形数据库可以使用一些简单的概念存储任何类型的数据:
节点——图数据记录 (Nodes——graph data records)
关系——连接节点 (Relationships——connect nodes)
属性——命名数据值 (命名属性值)
最简单的图只有有属性值的一个节点。The simplest graph has just a single node with some named values called Properties.
下面以绘制一个社交圈为例
eg. 绘制一个社交圈
——Associate a set of nodes 关联一组节点
Nodes can be grouped together by applying a Label to each member. 通过标签可以将节点组织在一起
A node can have zero or more labels. 一个节点可以有零个或多个标签
Labels do not have any properties.标签没有任何属性
eg
Apply the label "Person" to the node we created for Emil
Color "Person" nodes red
将标签“ Person”应用于我们为Emil创建的节点
颜色“ Person”节点为红色
——Schema-free, nodes can have a mix of common and unique properties.
schema-free的节点可以混用通用属性和唯一属性
Similar nodes can have different properties
Properties can be strings, numbers, or booleans
Neo4j can store billions of nodes
eg.
We'll add a few more nodes:
Emil has a klout score of 99
Johan, from Sweden, who is learning to surf
Ian, from England, who is an author
Rik, from Belgium, has a cat named Orval
Allison, from California, who surfs
——Connect nodes in the graph
The real power of Neo4j is in connected data. To associate any two nodes, add a Relationship which describes how the records are related.
Relationships always have direction
Relationships always have a type
Relationships form patterns of data
eg.
In our social graph, we simply say who KNOWS whom:
Emil KNOWS Johan and Ian
Johan KNOWS Ian and Rik
Rik and Ian KNOWS Allison
Store information shared by two nodes.
In a property graph, relationships are data records that can also contain properties.
关系也可以是包含属性的数据记录,如
eg
Emil has known Johan since 2001
Emil rates Ian 5 (out of 5)
Everyone else can have similar relationship properties
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。