图数据库 — > Tinkerpop (一)
图数据库 — >Janusgraph 基础 (二)
图数据库 — > hugegraph (三)
图数据库 — > spark 和janusgraph组合(四)
图数据库 — > JanusGraph可视化之Gephi (五)
简介
TinkerPop是一个面向实时事务处理(OLAP)以及批量、分析型(OLTP)的开源的图计算框架。TinkerPop是一个可以应用于不同图形数据库的抽象层,避免应用程序与特定数据库高度依赖。
目标
提供通用的API和工具,使开发人员可以基于不同图数据库轻松创建图形应用程序,使图形数据库与图计算解耦,方便切换不同图形数据库,简化其工作。
体系结构
![](https://img-blog.csdnimg.cn/20200114093752633.png)
Gremlin
是TinkerPop图形遍历语言,使用户能够以简但的代码进行复杂的图形遍历,Gremlin具有“写一次,随处运行” 的特点。意味着,所有支持TinkerPop的图形系统都可以使用Gremlin语言进行图形遍历。
![](https://img-blog.csdnimg.cn/20200114093851756.png)
基本数据
vertices 节点
vertices:
label
type
properties
id
如
{
"label": "person",
"type": "vertex",
-"properties": {
"name": "marko",
"age": 29,
"city": "Beijing"
},
"id": "1:marko"
}
edge 边
{
"label": "created",
"type": "edge",
-"properties": {
"weight": 0.2,
"date": "2017-03-24"
},
"id": "S1:peter>2>>L1",
"outV": "1:peter",
"inV": 1,
"outVLabel": "person",
"inVLabel": "software"
}
在创建顶点或边时,一定事先创建顶点和边的类型(schema)
如
// 顶点类型
person = graph.schema().vertexLabel("person").properties(&