为什么男人喜欢吃槟榔| 火象是什么星座| 脑供血不足吃什么药效果好| 黑色碳素笔是什么| 月经期间吃什么补血| 香油是什么| 91网站是什么| 喝温开水有什么好处| 胆怯的什么| lgg是什么意思| 肠胃不好能吃什么水果| 朋友搬家送什么礼物好| 妹汁是什么| 大便出血吃什么药好得快| 幼字五行属什么| 朋友的意义是什么| 云南古代叫什么| 胸闷喘不上气什么原因| 洗耳恭听是什么意思| 香肠炒什么菜好吃| 放屁是什么原因| aww是什么意思| 吃什么降低尿酸| 什么瓜不能吃脑筋急转弯| 癫疯病发作前兆有什么症状| 阴道壁是什么样的| 什么是工作性质| 心脏跳动过快吃什么药| 右边肚子疼是什么原因| 猴子是什么颜色| 泰坦尼克号女主角叫什么| 胰腺上长瘤意味着什么| 知了为什么要叫| 两性关系是什么意思| 八月八号什么星座| 什么原因导致尿酸高| 紫薇什么意思| 办理出院手续都需要什么| 国家电网是什么单位| 为什么会得阴虱| 鱼周念什么| 锁骨中间的窝叫什么| 舌苔白厚腻吃什么药见效快| 家慈是对什么人的称呼| 180是什么尺码| 一加一为什么等于二| 萎缩性胃炎什么意思| 潜意识是什么意思| 酸枣仁配什么治疗失眠| 梦见大蛇是什么意思| 莲蓬吃了有什么好处| 每逢佳节倍思亲的上一句是什么| 精神病的前兆是什么| 什么是m属性| 什么时候冬天| 铁锈色痰见于什么病| 2024什么年属什么年| 为什么老是流鼻血| 垂体泌乳素高是什么原因| 细菌感染发烧吃什么药| 辣椒含有什么维生素| 3月份出生是什么星座| 化疗与放疗有什么区别| 飞机不能带什么| 丹五行属性是什么| 价值是什么| 吃蛋白粉有什么好处和坏处| 什么体质的人戴银变黑| 什么的小花| 樱花的花语是什么| 社保断了有什么影响| 孕妇抽筋是什么原因引起的| 做肌电图挂什么科| 中国梦是什么意思| 右眉上方有痣代表什么| 打呼噜什么原因| 南瓜子不能和什么一起吃| 男人染上霉菌什么症状| 清肺火肺热吃什么药最有效| cnc男装是什么档次| 新疆是什么族| 什么童话| 不小心怀孕了吃什么药可以流掉| 气血两虚吃什么药| 过敏性鼻炎吃什么中药| 免疫固定电泳查什么的| 故事是什么意思| hbr是什么意思| 半硬半软是什么症状| 什么叫信仰| 什么是人乳头瘤病毒| 猫的胡须有什么作用| 什么时候母亲节| 待字闺中什么意思| 着床成功后有什么症状或感觉| 什么宽带网速快又便宜| 丝状疣是什么样子图片| 手掌发黄是什么原因| 鼠标cpi是什么意思| 翡翠的五行属性是什么| 什么的气泡| 跟班是什么意思| 风向是指风什么的方向| 什么是射频| 彷徨是什么意思| 小鹿乱撞是什么意思| 冷喷机喷脸有什么好处| 老师的老公叫什么| 早上手肿胀是什么原因| 肾挂什么科| 老母鸡炖什么好吃又有营养价值| mg是什么单位| 1961年属什么| 蜻蜓为什么点水| 淡奶是什么| 龟头炎用什么药| 名字五行属什么| 高光是什么意思| 二氧化碳是什么东西| 头晕是什么原因引起| 总做噩梦是什么原因| 淋巴细胞是什么| 脸颊两边长斑是什么原因| 多巴胺是什么意思| 清淡饮食吃什么| 网名叫什么好听| 番茄和蕃茄有什么区别| 痔疮是什么病| 配制酒是什么意思| 家里为什么有隐翅虫| 吃什么食物可以降低胆固醇| 农历12月是什么月| 执着什么意思| 马革裹尸什么意思| 一个山一个见读什么| 瑞什么意思| 多愁善感的动物是什么生肖| 回盲部憩室是什么意思| 甲状腺结节吃什么药好| 中午喜鹊叫有什么预兆| 喝红茶有什么好处和坏处| 97年属什么今年多大| 锋字五行属什么| 鸽子红鼻头喂什么药| 爱慕是什么意思| 口腔科主要看什么| 一什么一什么词语| 睡着了放屁是什么原因| 促甲状腺激素高是什么原因| 给老师送花送什么花合适| 孕中期同房要注意什么| 西洋参吃了有什么好处| 移动硬盘什么牌子好| 婴儿坐飞机需要什么证件| 感冒鼻子不通气吃什么药| 辅酶q10的作用是什么| 1970属什么生肖| 后背凉凉的是什么原因| 甘肃天水有什么好玩的地方| 假唱是什么意思| 36岁属什么生肖| 小孩流口水是什么原因| 带状疱疹一般长在什么地方| 梦见磕头下跪什么意思| 重建是什么意思| 6.29是什么星座| ifound是什么牌子| 男性尿黄是什么原因| 今年男宝宝取什么名字好| 脑白质疏松是什么意思| 澳门是什么时候被葡萄牙占领的| 惊魂未定的意思是什么| 大腿前侧是什么经络| 天时地利人和是什么意思| 什么是高嘌呤食物| 法西斯战争是什么意思| 九二共识是什么| 打飞机是什么意思| 开塞露的成分是什么| 来月经能吃什么水果| 耍小聪明是什么意思| 妇科千金片和三金片有什么区别| 天生丽质什么意思| 肩周炎吃什么药好| 小便解不出来是什么原因| 说话快的人什么性格| 电气火灾用什么灭火器| eb病毒抗体阳性是什么意思| 什么情况下要打破伤风| 什么是猝死| 发量少适合什么发型| 朱砂五行属什么| 抵牾是什么意思| 禁忌症是什么意思| 人活着到底有什么意义| 儒艮为什么叫美人鱼| 属牛和什么属相相冲| 女人喝蛇汤有什么好处| 什么是沙眼| 梦见吃饭是什么意思| 睡觉手麻是什么原因| 人参不能和什么一起吃| 电视黑屏是什么原因| 六味地黄丸起什么作用| 靖国神社是什么| 什么是职业年金| 脾脏切除后有什么影响| 缺碘吃什么| 吃什么会变瘦| 湿厕纸是干什么用的| 颈椎退行性变是什么意思| 脑梗三项是检查什么| 芒果对身体有什么好处| 鼻子经常出血是什么原因| 什么叫肾病综合征| 戒心是什么意思| 心率低40多吃什么药| 小孩用脚尖走路是什么原因| 天生丽质什么意思| 经常喝苏打水有什么好处和坏处| 补钙什么季节补最好| 丙子日是什么意思| p是什么意思| 小便清长是什么意思| 领英是什么| 玄女是什么意思| 吃什么都苦是什么原因| 吃茄子有什么好处和坏处| 嘴唇发黑是什么症状| 睡觉出汗多是什么原因| 今年的属相是什么生肖| 为什么会有| 小猫踩奶是什么意思| 红十字会是干什么的| 猫咪能吃什么水果| 什么姿势容易怀孕| 粉饼是干什么用的| 莓茶是什么茶| 晚上睡觉多梦是什么原因| 乌鸡放什么炖补气补血| 什么是热伤风| 手淫有什么危害| 小便清长是什么意思| 物以类聚形容什么动物| 啪啪是什么意思| 尿频尿量少是什么原因| 鲱鱼罐头为什么这么臭| 蚕豆病不能吃什么| 美籍华人是什么意思| 长期熬夜会得什么病| 男生小肚子疼是什么原因| 粽叶是什么植物| 阴茎长什么样| 什么东西补气血| 血压不稳定是什么原因| 孩子发烧手脚冰凉是什么原因| 胃疼挂什么科室| 嫦娥是什么生肖| 下眼皮跳是什么原因| 输卵管造影什么时候检查最好| 嘴唇有黑斑是什么病| 吃什么能让月经量增多| 空心菜又叫什么菜| it是什么牌子的衣服| 百度

联合国世界旅游组织/亚太旅游协会在桂林举办国际论坛

(Redirected from Apache TinkerPop)
百度 机关党委、各部门各单位要发挥基层党组织的作用,倡导党内政治生活的优良传统,使党员干部经常接受思想洗礼,清除政治灰尘,实现党性更加纯粹、信念更加坚定、觉悟更加提高的目标。

Gremlin is a graph traversal language and virtual machine developed by Apache TinkerPop of the Apache Software Foundation. Gremlin works for both OLTP-based graph databases as well as OLAP-based graph processors. Gremlin's automata and functional language foundation enable Gremlin to naturally support: imperative and declarative querying; host language agnosticism; user-defined domain specific languages; an extensible compiler/optimizer, single- and multi-machine execution models; hybrid depth- and breadth-first evaluation with Turing completeness.[2]

Gremlin
Designed byMarko A. Rodriguez
DeveloperApache TinkerPop of the Apache Software Foundation
First appeared2009; 16 years ago (2009)
Stable release
3.7.0 / 31 July 2023; 2 years ago (2025-08-07)[1]
OSCross-platform (multi-platform)
LicenseApache License 2.0
Websitetinkerpop.apache.org
Dialects
Gremlin?Java8, Gremlin?Groovy, Gremlin?Python, Gremlin?Scala, Gremlin?Clojure, Gremlin?PHP, Gremlin?JavaScript, Gremlin?Typeset
Influenced by
Regular expression, XPath, Ripple, SPARQL, SQL, Java/JVM

As an explanatory analogy, Apache TinkerPop and Gremlin are to graph databases what the JDBC and SQL are to relational databases. Likewise, the Gremlin traversal machine is to graph computing as what the Java virtual machine is to general purpose computing.[3]

History

edit
  • 2025-08-07 the project is born, and immediately named "TinkerPop"
  • 2025-08-07 v0.1 is the first release
  • 2025-08-07 v1.0 is released
  • 2025-08-07 v2.0 is released
  • 2025-08-07 TinkerPop becomes an Apache Incubator project
  • 2025-08-07 v3.0.0-incubating is released
  • 2025-08-07 Apache TinkerPop becomes a top-level project
  • 2025-08-07 v3.1.3 and v3.2.1 are first releases as Apache TinkerPop
  • 2025-08-07 v3.3.1 is released
  • 2025-08-07 v3.3.3 is released
  • 2025-08-07 v3.4.3 is released
  • 2025-08-07 v3.4.6 is released

Vendor integration

edit

Gremlin is an Apache2-licensed graph traversal language that can be used by graph system vendors. There are typically two types of graph system vendors: OLTP graph databases and OLAP graph processors. The table below outlines those graph vendors that support Gremlin.

Vendor Graph System
Neo4j graph database
OrientDB graph database
DataStax Enterprise (5.0+) graph database
Hadoop (Giraph) graph processor
Hadoop (Spark) graph processor
InfiniteGraph graph database
JanusGraph graph database
Cosmos DB graph database
Amazon Neptune graph database
ArcadeDB graph database

Traversal examples

edit

The following examples of Gremlin queries and responses in a Gremlin-Groovy environment are relative to a graph representation of the MovieLens dataset.[4] The dataset includes users who rate movies. Users each have one occupation, and each movie has one or more categories associated with it. The MovieLens graph schema is detailed below.

user--rated[stars:0-5]-->movie
user--occupation-->occupation
movie--category-->category

Simple traversals

edit

For each vertex in the graph, emit its label, then group and count each distinct label.

gremlin> g.V().label().groupCount()
==>[occupation:21, movie:3883, category:18, user:6040]

What year was the oldest movie made?

gremlin> g.V().hasLabel('movie').values('year').min()
==>1919

What is Die Hard's average rating?

gremlin> g.V().has('movie','name','Die Hard').inE('rated').values('stars').mean()
==>4.121848739495798

Projection traversals

edit

For each category, emit a map of its name and the number of movies it represents.

gremlin> g.V().hasLabel('category').as('a','b').
           select('a','b').
             by('name').
             by(inE('category').count())
==>[a:Animation, b:105]
==>[a:Children's, b:251]
==>[a:Comedy, b:1200]
==>[a:Adventure, b:283]
==>[a:Fantasy, b:68]
==>[a:Romance, b:471]
==>[a:Drama, b:1603]
==>[a:Action, b:503]
==>[a:Crime, b:211]
==>[a:Thriller, b:492]
==>[a:Horror, b:343]
==>[a:Sci-Fi, b:276]
==>[a:Documentary, b:127]
==>[a:War, b:143]
==>[a:Musical, b:114]
==>[a:Mystery, b:106]
==>[a:Film-Noir, b:44]
==>[a:Western, b:68]

For each movie with at least 11 ratings, emit a map of its name and average rating. Sort the maps in decreasing order by their average rating. Emit the first 10 maps (i.e. top 10).

gremlin> g.V().hasLabel('movie').as('a','b').
           where(inE('rated').count().is(gt(10))).
           select('a','b').
             by('name').
             by(inE('rated').values('stars').mean()).
           order().by(select('b'),decr).
           limit(10)
==>[a:Sanjuro, b:4.608695652173913]
==>[a:Seven Samurai (The Magnificent Seven), b:4.560509554140127]
==>[a:Shawshank Redemption, The, b:4.554557700942973]
==>[a:Godfather, The, b:4.524966261808367]
==>[a:Close Shave, A, b:4.52054794520548]
==>[a:Usual Suspects, The, b:4.517106001121705]
==>[a:Schindler's List, b:4.510416666666667]
==>[a:Wrong Trousers, The, b:4.507936507936508]
==>[a:Sunset Blvd. (a.k.a. Sunset Boulevard), b:4.491489361702127]
==>[a:Raiders of the Lost Ark, b:4.47772]

Declarative pattern matching traversals

edit

Gremlin supports declarative graph pattern matching similar to SPARQL. For instance, the following query below uses Gremlin's match()-step.

What 80's action movies do 30-something programmers like? Group count the movies by their name and sort the group count map in decreasing order by value. Clip the map to the top 10 and emit the map entries.

gremlin> g.V().
           match(
             __.as('a').hasLabel('movie'),
             __.as('a').out('category').has('name','Action'),
             __.as('a').has('year',between(1980,1990)),
             __.as('a').inE('rated').as('b'),
             __.as('b').has('stars',5),
             __.as('b').outV().as('c'),
             __.as('c').out('occupation').has('name','programmer'),
             __.as('c').has('age',between(30,40))).
           select('a').groupCount().by('name').
           order(local).by(valueDecr).
           limit(local,10)
==>Raiders of the Lost Ark=26
==>Star Wars Episode V - The Empire Strikes Back=26
==>Terminator, The=23
==>Star Wars Episode VI - Return of the Jedi=22
==>Princess Bride, The=19
==>Aliens=18
==>Boat, The (Das Boot)=11
==>Indiana Jones and the Last Crusade=11
==>Star Trek The Wrath of Khan=10
==>Abyss, The=9

OLAP traversal

edit

Which movies are most central in the implicit 5-stars graph?

gremlin> g = graph.traversal(computer(SparkGraphComputer))
==>graphtraversalsource[hadoopgraph[gryoinputformat->gryooutputformat], sparkgraphcomputer]
gremlin> g.V().repeat(outE('rated').has('stars', 5).inV().
                 groupCount('m').by('name').
                 inE('rated').has('stars', 5).outV()).
               times(4).cap('m')
==>Star Wars Episode IV - A New Hope	  35405394353105332
==>American Beauty	  31943228282020585
==>Raiders of the Lost Ark	31224779793238499
==>Star Wars Episode V - The Empire Strikes Back  30434677119726223
==>Godfather, The	30258518523013057
==>Shawshank Redemption, The	28297717387901031
==>Schindler's List	27539336654199309
==>Silence of the Lambs, The	26736276376806173
==>Fargo	 26531050311325270
==>Matrix, The	 26395118239203191

Gremlin graph traversal machine

edit

Gremlin is a virtual machine composed of an instruction set as well as an execution engine. An analogy is drawn between Gremlin and Java.

Java Ecosystem Gremlin Ecosystem
Apache Groovy programming language Gremlin-Groovy
Scala programming language Gremlin-Scala
Clojure programming language Gremlin-Clojure
... ...
Java programming language Gremlin-Java8
Java instruction set Gremlin step library
Java virtual machine Gremlin traversal machine

Gremlin steps (instruction set)

edit

The following traversal is a Gremlin traversal in the Gremlin-Java8 dialect.

g.V().as("a").out("knows").as("b").
  select("a","b").
    by("name").
    by("age")

The Gremlin language (i.e. the fluent-style of expressing a graph traversal) can be represented in any host language that supports function composition and function nesting. Due to this simple requirement, there exists various Gremlin dialects including Gremlin-Groovy, Gremlin-Scala, Gremlin-Clojure, etc. The above Gremlin-Java8 traversal is ultimately compiled down to a step sequence called a traversal. A string representation of the traversal above provided below.

[GraphStep([],vertex)@[a], VertexStep(OUT,[knows],vertex)@[b], SelectStep([a, b],[value(name), value(age)])]

The steps are the primitives of the Gremlin graph traversal machine. They are the parameterized instructions that the machine ultimately executes. The Gremlin instruction set is approximately 30 steps. These steps are sufficient to provide general purpose computing and what is typically required to express the common motifs of any graph traversal query.

Given that Gremlin is a language, an instruction set, and a virtual machine, it is possible to design another traversal language that compiles to the Gremlin traversal machine (analogous to how Scala compiles to the JVM). For instance, the popular SPARQL graph pattern match language can be compiled to execute on the Gremlin machine. The following SPARQL query

SELECT ?a ?b ?c
WHERE {
  ?a a Person .
  ?a ex:knows ?b .
  ?a ex:created ?c .
  ?b ex:created ?c .
  ?b ex:age ? d .
    FILTER(?d < 30)
}

would compile to

[GraphStep([],vertex), MatchStep(AND,[[MatchStartStep(a), LabelStep, IsStep(eq(Person)), MatchEndStep], [MatchStartStep(a), VertexStep(OUT,[knows],vertex), MatchEndStep(b)], [MatchStartStep(a), VertexStep(OUT,[created],vertex), MatchEndStep(c)], [MatchStartStep(b), VertexStep(OUT,[created],vertex), MatchEndStep(c)], [MatchStartStep(b), PropertiesStep([age],value), MatchEndStep(d)], [MatchStartStep(d), IsStep(gt(30)), MatchEndStep]]), SelectStep([a, b, c])].

In Gremlin-Java8, the SPARQL query above would be represented as below and compile to the identical Gremlin step sequence (i.e. traversal).

g.V().match(
  as("a").label().is("person"),
  as("a").out("knows").as("b"),
  as("a").out("created").as("c"),
  as("b").out("created").as("c"),
  as("b").values("age").as("d"),
  as("d").is(gt(30))).
    select("a","b","c")

Gremlin Machine (virtual machine)

edit

The Gremlin graph traversal machine can execute on a single machine or across a multi-machine compute cluster. Execution agnosticism allows Gremlin to run over both graph databases (OLTP) and graph processors (OLAP).

See also

edit

References

edit
  1. ^ "Apache TinkerPop - Downloads". Retrieved 27 October 2023.
  2. ^ Rodriguez, Marko A. (2015). "The Gremlin graph traversal machine and language (invited talk)". The Gremlin Graph Traversal Machine and Language. pp. 1–10. arXiv:1508.03843. doi:10.1145/2815072.2815073. ISBN 9781450339025. S2CID 10533031.
  3. ^ "The Benefits of the Gremlin Graph Traversal Machine". 2025-08-07. Retrieved September 17, 2015.
  4. ^ "The Gremlin Graph Traversal Language". 2025-08-07. Retrieved August 22, 2015.
edit
  1. Apache TinkerPop Homepage
  2. sql2gremlin.com (TinkerPop2)
  3. Rodriguez, M.A., "The Gremlin Graph Traversal Machine and Language," Proceedings of the ACM Database Programming Languages Conference, October, 2015.
男性乳头疼是什么原因 切除甲状腺有什么影响 右肺中叶小结节是什么意思严重吗 掉头发吃什么药最有效 孕妇头疼是什么原因
细胞结构包括什么 双侧瞳孔缩小见于什么 补体c3偏低是什么意思 骨质疏松症有什么症状 检查尿酸挂什么科
阴茎疼是什么原因 study是什么意思 青龙男是什么意思 高危妊娠监督什么意思 为什么会突然吐血
准生证什么时候办 子宫脱垂吃什么药怎么恢复正常 软件开发需要学什么 唱反调是什么意思 吃什么能增强免疫力和抵抗力
牛皮和牛皮革有什么区别hcv8jop9ns5r.cn 心率快是什么原因hcv9jop2ns3r.cn 腹部痛挂什么科hcv9jop3ns7r.cn 李宇春父亲是干什么的hcv9jop2ns6r.cn 前兆是什么意思hcv8jop6ns0r.cn
走路腰疼是什么原因hcv8jop4ns7r.cn 59岁属什么jinxinzhichuang.com 无间是什么意思hcv9jop3ns2r.cn 微信密码是什么hcv7jop6ns4r.cn 平五行属什么hcv8jop0ns9r.cn
子宫内膜薄有什么危害hcv8jop7ns1r.cn 甲鱼吃什么东西hcv8jop6ns7r.cn 手脚发麻是什么病征兆hcv8jop1ns0r.cn 总胆汁酸高说明什么hcv8jop2ns7r.cn 简单明了是什么意思hcv8jop9ns1r.cn
胎盘内血池是什么hcv7jop4ns8r.cn 氯读什么拼音hcv9jop0ns4r.cn 开天辟地是什么生肖hcv9jop7ns2r.cn 为什么不愿意工作hcv7jop4ns8r.cn 九月初三是什么星座hcv8jop1ns0r.cn
百度