Gremlin公司服务器等相关资料
郝伟 2021/05/18
目前公司有两个测试服务器:
合肥公司测试服务器
H G地址:http://192.168.3.117:8088/
SSH登陆:ssh root@192.168.103.116, 1amgine0
北京公司测试服务器
http://192.168.103.116:8088/
SSH登陆:ssh root@192.168.103.116, 1
现在HG的服务器有4台,所有SSH登陆信息均为 root,1。
相关信息如下:
| 名称 | 服务器名 | IP地址 |
|---|---|---|
| HugeGraphTest | Master.Hdoop | 192.168.3.111 |
| HugeGraphData0 | Slave2.Hadoop | 192.168.3.117 |
| HugeGraphData1 | Slave0.Hadoop | 192.168.3.110 |
| HugeGraphData2 | Slave1.Hadoop | 192.168.3.115 |
其中117还建立了内存模拟(与上面的集群独立),可以通过网址 http://192.168.3.117:8088/ 访问。
参考Gremlin入门。
// 创建基本属性
graph.schema().propertyKey("name").asText().ifNotExist().create()
graph.schema().propertyKey("age").asInt().ifNotExist().create()
graph.schema().propertyKey("city").asText().ifNotExist().create()
graph.schema().propertyKey("lang").asText().ifNotExist().create()
graph.schema().propertyKey("date").asText().ifNotExist().create()
graph.schema().propertyKey("price").asInt().ifNotExist().create()
// 创建person顶点
person = graph.schema().vertexLabel("person").properties("name", "age", "city").primaryKeys("name").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")
josh = graph.addVertex(T.label, "person", "name", "josh", "age", 32, "city", "Beijing")
peter = graph.addVertex(T.label, "person","name", "peter", "age", 29, "city", "Shanghai")
// 创建software顶点
software = graph.schema().vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create()
lop = graph.addVertex(T.label, "software", "name", "lop", "lang", "java", "price", 328)
ripple = graph.addVertex(T.label, "software", "name", "ripple", "lang", "java", "price", 199)
// 创建knows边
knows = graph.schema().edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date").ifNotExist().create()
marko.addEdge("knows", vadas, "date", "20160110")
marko.addEdge("knows", josh, "date", "20130220")
marko.addEdge("created", lop, "date", "20171210", "city", "Shanghai")
// 创建created边
created = graph.schema().edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "city").ifNotExist().create()
josh.addEdge("created", ripple, "date", "20151010", "city", "Beijing")
josh.addEdge("created", lop, "date", "20171210", "city", "Beijing")
peter.addEdge("created", lop, "date", "20171210", "city", "Beijing")
URL:http://tang.love/2018/11/15/gremlin_traversal_language/
发表于 2018-11-15 | 更新于 2021-01-12 | 分类于 知识图谱 | 评论数: | 阅读次数:
Gremlin是 Apache TinkerPop 框架下的图遍历语言。Gremlin是一种函数式数据流语言,可以使得用户使用简洁的方式表述复杂的属性图(property graph)的遍历或查询。每个Gremlin遍历由一系列步骤(可能存在嵌套)组成,每一步都在数据流(data stream)上执行一个原子操作。
Gremlin 语言包括三个基本的操作:map-step:对数据流中的对象进行转换;filter-step:对数据流中的对象就行过滤;和 sideEffect-step:对数据流进行计算统计;
Tinkerpop3 模型核心概念:
URL:https://www.cnblogs.com/myitroad/p/7727570.html
Gremlin包括三个基本的操作:
包括了Gremlin在一些场景中的很多具体应用。
https://blog.csdn.net/weixin_42076409/article/details/80856911
讲解了 一、Lambda Step,包括map ,flatMap ,filter,sideEffect,branch,值得学习。
URL: https://blog.csdn.net/javeme/article/details/82631834)
内容很丰富,推荐阅读。主要有25个章构成,包括以下内容:
图基本概念与操作、边的遍历操作、has条件过滤、图查询返回结果数限制、查询路径path、循环操作、查询结果排序、数据分组与去重、条件和过滤、逻辑运算、统计运算、数学运算、路径选取与过滤、分支、合并、结果聚集与展开、模式匹配、随机过滤与注入、结果存取口袋sack、遍历栅栏barrier、局部操作local、遍历终止terminal、转换操作map/flatMap、附加操作sideEffect、执行统计和分析等。
http://tinkerpop.apache.org/
推荐阅读,网站内有大量系统、查询语言、驱动和应用示例。
http://tinkerpop-gremlin.cn/
注意:此文档是官方gremlin文档的中文翻译。对于操作阿里云GDB图数据库而言,是在gremlin语言框架下的实现, 这就意味着很多单步具有特殊的实现和约定。使用特定的语义和方式能够让图遍历更有效率。
阿里云GDB团队翻译,如有疑问,订正,和转载需求,请发信至 nosql@list.alibaba-inc.com
https://hugegraph.github.io/hugegraph-doc/
HugeGraph是一款易用、高效、通用的开源图数据库系统(Graph Database,GitHub项目地址), 实现了Apache TinkerPop3框架及完全兼容Gremlin查询语言, 具备完善的工具链组件,助力用户轻松构建基于图数据库之上的应用和产品。HugeGraph支持百亿以上的顶点和边快速导入,并提供毫秒级的关联关系查询能力(OLTP), 并可与Hadoop、Spark等大数据平台集成以进行离线分析(OLAP)。
https://www.it610.com/article/1281653249346125824.htm
包括:Schema、顶点和边、索引、检索等内容的语法。