本书通过反应现实世界的典型的图数据的真实例子为您介绍阿帕奇TinkerPop 3 小精灵图查询和遍历语言。这些数据、样例代码和样例应用及相关内容都可以从Github中下载。 示例中的航线图是世界飞行航线网络的一个模型,该航空网络中有2273个机场和43400条航线。您无需修改导入air-routes.graphml文件到小精灵控制台,上述例子就可以工作。关于如何设置环境的内容将在“下载、安装和启动控制台”一节中详述。
This book introduces the Apache TinkerPop 3 Gremlin graph query and traversal language via real
examples featuring real-world graph data. That data along with sample code and example
applications is available for download from the GitHub project as well as many other items. The
graph, air-routes, is a model of the world airline route network between 3,373 airports including
43,400 routes. The examples presented will work unmodified with the air-routes.graphml file
loaded into the Gremlin console running with a TinkerGraph. How to set that environment up is
covered in the Downloading, installing and launching the console section below.
本书中所用到的例子已在阿帕奇TinerPop 3.5.1版本中测试过。当然要在本书中囊括该版本中新增的特征和功能,还有相当多的工作要做。
The examples in this book have been tested using Apache TinkerPop release 3.5.1.
However, work remains to be done to add coverage of new features in that release
to the book.
廷克图(TinkerGraph)是一种内存图,这意味着没什么东西会自动的存储到磁盘上。它做为阿帕奇TinkerPop3的一部分被下载。本入门向导的目标帮助仅有一点点或者几乎没有先导知识的朋友们,使得他们起步并迅速上手小精灵控制台和航行图。在本书的后续章节中,本人将会讨论更多技术内容:例如:杰森图(JanusGraph)、阿帕奇卡珊德拉(Apache Cassandra), 小精灵服务器( Gremlin Server )和 搜索引擎解决方案(Elasticsearch),并基于这些技术来构建可扩展的、持久化的图存储,且这些图存储可以使用小精灵查询语言来进行遍历访问。本人还会探讨使用小精灵控制台并编写独立运行的Java和Groovy应用;本人也提供了若干Ruby语言的例子。
TinkerGraph is an in-memory graph, meaning nothing gets saved to disk automatically. It is shipped
as part of the Apache TinkerPop 3 download. The goal of this tutorial is to allow someone with little
to no prior knowledge to get up and going quickly using the Gremlin console and the air-routes
graph. Later in the book I will discuss using additional technologies such as JanusGraph, Apache
Cassandra, Gremlin Server and Elasticsearch to build scalable and persisted graph stores that can
still be traversed using Gremlin queries. I will also discuss writing standalone Java and Groovy
applications as well as using the Gremlin Console. I even slipped a couple of Ruby examples in too!
在本书最开始的章节中,笔者重点聚焦于展示使用小精灵查询语言进行多种不同类型的查询。 笔者仅列举了挑选的诸多例子中部分输出结果并未展示所有的输出结果,您可以通过执行案例中的各个查询并得到全部的例子的输出。该部分内容将在本书的第四、五、六章中深入研究。
In the first few sections of this book I have mainly focussed on showing the
different types of queries that you can issue using Gremlin. I have not tried to
show all of the output that you will get back from entering these queries but have
selectively shown examples of output. I go a lot deeper into things in chapters 4, 5
and 6.
本书是如何组织的?
How this book is organized
第一章 --介绍
• 导入内容是一起回顾为什么大家关注图形数据库,并一起探讨图的一些优秀的使用案例。笔者同样提供样例程序和本书的一些其它的相关资料。
Chapter 1 - INTRODUCTION
• I start off by briefly doing a recap on why Graph databases are of interest to us and discuss
some good use cases for graphs. I also provide pointers to the sample programs and other
additional materials referenced by the book.
第二章 --启航
• 第二章中将介绍的内容是阿帕奇TinkerPop的一些组件,当然也会介绍航线图的文件air-routes.graphml,该文件是本书的绝大多数例子都会用到的图。
Chapter 2 - GETTING STARTED
• In Chapter two I introduce several of the components of Apache TinkerPop and also
introduce the air-routes.graphml file that will be used as the graph the majority of examples
shown in this book are based on.
第三章 --编写小精灵查询
• 从第三章起内容会更加有趣,更加精彩了。笔者开始讨论如何使用小精灵图遍历和查询语言并查询航线图。 笔者将会对比:如何使用传统的关系数据库建立航线图,并看看使用结构化查询语言(SQL)和小精灵(Gremlin)图查询语言的异同。本章其余部分将介绍Gemlin查询语言的几种关建方法,它们有时也被称为“步骤”。本章重点关注的内容是读图(而不是增加或者删除图)。
Chapter 3 - WRITING GREMLIN QUERIES
• In Chapter three things start to get a lot more interesting! I start discussing how to use the
Gremlin graph traversal and query language to interrogate the air-routes graph. I begin by
comparing how we could have built the air-routes graph using a more traditional relational
database and then look at how SQL and Gremlin are both similar in some ways and very
different in others. For the rest of the Chapter, I introduce several of the key Gremlin
methods, or as they are often called, "steps". I mostly focus on reading the graph (not adding
or deleting things) in this Chapter.
第四章 --超越基本的查询
• 第四章的内容远不止仅仅是读取或查询图,笔者将叙述如何增加节点、边或弧、属性,还有如何删除或者更新它们。笔者还展开各种最佳实践方案的讨论和研究。本章还会涉及一些更有深度的话题。
Chapter 4 - BEYOND BASIC QUERIES
• In Chapter four the focus moves beyond just reading the graph and I describe how to add
vertices (nodes), edges and properties as well as how to delete and update them. I also
present a discussion of various best practices. I also start to explore some slightly more
advanced topics in this chapter.
第五章 -- 复合查询和查询结果生成
• 第五章,笔者将着重于使用之前几章学习的内容来编写查询句语,从而获得更真实的感受。笔者将运行本章节的各个例子,查看它们的运行结果。笔者也会讨论如下主题:分析距离、路径分布和编写地理空间查询。
Chapter 5 - MISCELLANEOUS QUERIES AND THE RESULTS THEY GENERATE
• In Chapter five I focus on using what has been covered in the prior Chapters to write queries
that have a more real-world feel. I present a lot more examples of the output from running
queries in this Chapter. I also start to discuss topics such as analyzing distances, route
distribution and writing geospatial queries.
第六章 -- 超越控制台和廷克图(TinkerGraph)
•从第六章开始,本书的关注点将从小精灵控制台和迁克图移步至其它概念。笔者将开始此类内容:编写可以用到图数据库且独立运行的Java和Groovy程序。笔者也会简要介绍杰森图(JanusGraph)并详细的了解该图数据库的能力,例如对于数据库事务的支持,数据库模式和数据库索引。与此同时各种各样的后端持久化存储和索引技术也将会在本章中出现。
Chapter 6 - MOVING BEYOND THE CONSOLE AND TINKERGRAPH
• In Chapter six I start to expand the focus to concepts beyond using the Gremlin Console and
a TinkerGraph. I start by looking at how you can write standalone Java and Groovy
applications that can work with a graph. I then introduce JanusGraph and take a fairly
detailed look at its capabilities such as support for transactions, schemas and indexes.
Various technology choices for back end persistent stores and indexes are explored along the
way.
第七章 -- 小精灵服务器介绍
• 第七章,介绍小精灵服务器喽! 笔者将探索从小精灵控制台和程序代码去连接远程的图数据库并在其上工作。本书刚刚发布时,绝大多数”真实的“使用案例都集中在直连的图数据库或者内存图数据库。 自从阿岶奇Tinerpop项目出现以来,使用小精灵服务器来连接远程的图数据库变得更为常见了。
Chapter 7 - INTRODUCING GREMLIN SERVER
• In Chapter seven, Gremlin Server is introduced. I begin to explore connecting to and working
with a remote graph both from the Gremlin Console and the command line as well as from
code. When this book was first released, the majority of "real world" use cases focussed on
directly attached or even in memory graphs. As Apache TinkerPop has evolved, it has
become a lot more common to connect to a graph remotely via a Gremlin Server.
第八章 常见的图序列化格式
• 第八章中讨论的内容如下:一些常见的图序更化的文件格式,以及如何在TinkerPop 3支持的图数据库中使用这些序列化格式。
Chapter 8 - COMMON GRAPH SERIALIZATION FORMATS
• In Chapter eight a discussion is presented of some common Graph serialization file formats
along with coverage of how to use them in the context of TinkerPop 3 enabled graphs.
第九章 延伸阅读
• 本书的最后,笔者将以一些有用的链接结尾,通过这些网址,您可以找到本书中所涉及的诸多主题和技术的一些工具和文档资料。
Chapter 9 - FURTHER READING
• I finish up by providing several links to useful web sites where you can find tools and
documentation for many of the topics and technologies covered in this book.
 
 
posted on 2022-03-30 16:44  bokeyuannicheng0000  阅读(149)  评论(0)    收藏  举报