图数据库 — > Tinkerpop (一)
图数据库 — >Janusgraph 基础 (二)
图数据库 — > hugegraph (三)
图数据库 — > spark 和janusgraph组合(四)
图数据库 — > JanusGraph可视化之Gephi (五)
TinkerPop是一个面向实时事务处理(OLAP)以及批量、分析型(OLTP)的开源的图计算框架。TinkerPop是一个可以应用于不同图形数据库的抽象层,避免应用程序与特定数据库高度依赖。
提供通用的API和工具,使开发人员可以基于不同图数据库轻松创建图形应用程序,使图形数据库与图计算解耦,方便切换不同图形数据库,简化其工作。
是TinkerPop图形遍历语言,使用户能够以简但的代码进行复杂的图形遍历,Gremlin具有“写一次,随处运行” 的特点。意味着,所有支持TinkerPop的图形系统都可以使用Gremlin语言进行图形遍历。
vertices:
label
type
properties
id
如
{
"label": "person",
"type": "vertex",
-"properties": {
"name": "marko",
"age": 29,
"city": "Beijing"
},
"id": "1:marko"
}
{
"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("name", "age", "city").primaryKeys("name").ifNotExist().create()
software = graph.schema().vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create()
//边类型
knows = graph.schema().edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date").ifNotExist().create()
created = graph.schema().edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "city").ifNotExist().create()
//增加顶点数据
marko = graph.addVertex(T.label, "person", "name", "marko", "age", 29, "city", "Beijing")
vadas = graph.addVertex(T.label, "person", "name", "vadas", "age", 27, "city", "Hongkong")
//增加边数据
marko.addEdge("knows", vadas, "date", "20160110")
追加schema
vertexLabel
VertexLabel 是可以追加约束的,不过仅限 properties 和 nullableKeys,而且追加的属性也必须添加到 nullableKeys 集合中。
schema.vertexLabel("person").properties("price").nullableKeys("price").append();
edgeLabel
schema.edgeLabel("knows").properties("price").nullableKeys("price").append();
一个节点的属性用key/value来表示,一个节点可以有0到多个属性,并且这些属性可以有相同的key值。
# 增加节点,并且为该节点增加两属性
v = g.addV().property('name','marko').property('name','marko a. rodriguez').next() # next()代表提交更改到服务器
# 查看该节点属性值
g.V(v).properties('name')
# 由节点id遍历
g.V(1)
g.V(3,4,5)
Amazon Neptune - Fully-managed graph database service.
Bitsy - A small, fast, embeddable, durable in-memory graph database.
Blazegraph - RDF graph database with OLTP support.
CosmosDB - Microsoft’s distributed OLTP graph database.
ChronoGraph - A versioned graph database.
DSEGraph - DataStax graph database with OLTP and OLAP support.
GRAKN.AI - Distributed OLTP/OLAP knowledge graph system.
Hadoop (Spark) - OLAP graph processor using Spark.
HGraphDB - OLTP graph database running on Apache HBase.
IBM Graph - OLTP graph database as a service.
JanusGraph - Distributed OLTP and OLAP graph database with BerkeleyDB, Apache Cassandra and Apache HBase support.
JanusGraph (Amazon) - The Amazon DynamoDB Storage Backend for JanusGraph.
Neo4j- OLTP graph database (embedded and high availability).
neo4j-gremlin-bolt - OLTP graph database (using Bolt Protocol).
OrientDB - OLTP graph database
Apache S2Graph - OLTP graph database running on Apache HBase.
Sqlg - OLTP implementation on SQL databases.
Stardog - RDF graph database with OLTP and OLAP support.
TinkerGraph - In-memory OLTP and OLAP reference implementation.
Titan - Distributed OLTP and OLAP graph database with BerkeleyDB, Apache Cassandra and Apache HBase support.
Titan (Amazon) - The Amazon DynamoDB storage backend for Titan.
Titan (Tupl) - The Tupl storage backend for Titan.
Unipop - OLTP Elasticsearch and JDBC backed graph.
「JanusGraph与HugeGraph」图形数据库 - 技术选型-功能对比
主流图库对比以及JanusGraph入门