<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>QUERY LANGUAGE on Apache HugeGraph</title><link>https://hugegraph.apache.org/versions/1.3/docs/language/</link><description>Recent content in QUERY LANGUAGE on Apache HugeGraph</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 14 May 2023 07:29:41 -0500</lastBuildDate><atom:link href="https://hugegraph.apache.org/versions/1.3/docs/language/index.xml" rel="self" type="application/rss+xml"/><item><title>HugeGraph Gremlin</title><link>https://hugegraph.apache.org/versions/1.3/docs/language/hugegraph-gremlin/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugegraph.apache.org/versions/1.3/docs/language/hugegraph-gremlin/</guid><description>&lt;h3 id="overview"&gt;Overview&#10;&lt;/h3&gt;&#10;&lt;p&gt;HugeGraph supports &lt;a href="https://tinkerpop.apache.org/gremlin.html"&gt;Gremlin&lt;/a&gt;, a graph traversal query language of &lt;a href="https://tinkerpop.apache.org"&gt;Apache TinkerPop3&lt;/a&gt;. While SQL is a query language for relational databases, Gremlin is a general-purpose query language for graph databases. Gremlin can be used to create entities (Vertex and Edge) of a graph, modify the properties of entities, delete entities, as well as perform graph queries.&lt;/p&gt;&#10;&lt;p&gt;Gremlin can be used to create entities (Vertex and Edge) of a graph, modify the properties of entities, and delete entities. More importantly, it can be used to perform graph querying and analysis operations.&lt;/p&gt;</description></item><item><title>HugeGraph Examples</title><link>https://hugegraph.apache.org/versions/1.3/docs/language/hugegraph-example/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugegraph.apache.org/versions/1.3/docs/language/hugegraph-example/</guid><description>&lt;h3 id="1-概述"&gt;1 概述&#10;&lt;/h3&gt;&#10;&lt;p&gt;本示例将&lt;a href="http://s3.thinkaurelius.com/docs/titan/1.0.0/getting-started.html"&gt;TitanDB Getting Started&lt;/a&gt; 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB，了解HugeGraph和TitanDB的差异。&lt;/p&gt;&#10;&lt;h4 id="11-hugegraph与titandb的异同"&gt;1.1 HugeGraph与TitanDB的异同&#10;&lt;/h4&gt;&#10;&lt;p&gt;HugeGraph和TitanDB都是基于&lt;a href="https://tinkerpop.apache.org"&gt;Apache TinkerPop3&lt;/a&gt;框架的图数据库，均支持&lt;a href="https://tinkerpop.apache.org/gremlin.html"&gt;Gremlin&lt;/a&gt;图查询语言，在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的，其代码结构清晰，功能较为丰富，接口更为友好等特点。&lt;/p&gt;&#10;&lt;p&gt;HugeGraph相对于TitanDB而言，其主要特点如下：&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件，可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能；&lt;/li&gt;&#10;&lt;li&gt;HugeGraph具有Server和Client的概念，第三方系统可以通过jar引用、client、api等多种方式接入，而TitanDB仅支持jar引用方式接入。&lt;/li&gt;&#10;&lt;li&gt;HugeGraph的Schema需要显式定义，所有的插入和查询均需要通过严格的schema校验，目前暂不支持schema的隐式创建。&lt;/li&gt;&#10;&lt;li&gt;HugeGraph充分利用后端存储系统的特点来实现数据高效存取，而TitanDB以统一的Kv结构无视后端的差异性。&lt;/li&gt;&#10;&lt;li&gt;HugeGraph的更新操作可以实现按需操作（例如：更新某个属性）性能更好。TitanDB的更新是read and update方式。&lt;/li&gt;&#10;&lt;li&gt;HugeGraph的VertexId和EdgeId均支持拼接，可实现自动去重，同时查询性能更好。TitanDB的所有Id均是自动生成，查询需要经索引。&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h4 id="12-人物关系图谱"&gt;1.2 人物关系图谱&#10;&lt;/h4&gt;&#10;&lt;p&gt;本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系（也被成为人物关系图谱），具体关系详见下图。&lt;/p&gt;&#10;&lt;div style="text-align: center;"&gt;&#10; &lt;img src="https://hugegraph.apache.org/versions/1.3/docs/images/graph-of-gods.png" alt="image"&gt;&#10;&lt;/div&gt;&#10;&lt;p&gt;其中，圆形节点代表实体(Vertex)，箭头代表关系（Edge），方框的内容为属性。&lt;/p&gt;&#10;&lt;p&gt;该关系图谱中有两类顶点，分别是人物（character）和位置（location）如下表：&lt;/p&gt;&#10;&lt;div class="td-table-scroll td-table-scroll--static"&gt;&#10;&lt;table&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th scope="col"&gt;名称&lt;/th&gt;&#10; &lt;th scope="col"&gt;类型&lt;/th&gt;&#10; &lt;th scope="col"&gt;属性&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;character&lt;/td&gt;&#10; &lt;td&gt;vertex&lt;/td&gt;&#10; &lt;td&gt;name,age,type&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;location&lt;/td&gt;&#10; &lt;td&gt;vertex&lt;/td&gt;&#10; &lt;td&gt;name&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;有六种关系，分别是父子（father）、母子（mother）、兄弟（brother）、战斗（battled）、居住(lives)、拥有宠物（pet） 关于关系图谱的具体信息如下：&lt;/p&gt;&#10;&lt;div class="td-table-scroll td-table-scroll--static"&gt;&#10;&lt;table&gt;&#10; &lt;thead&gt;&#10; &lt;tr&gt;&#10; &lt;th scope="col"&gt;名称&lt;/th&gt;&#10; &lt;th scope="col"&gt;类型&lt;/th&gt;&#10; &lt;th scope="col"&gt;source vertex label&lt;/th&gt;&#10; &lt;th scope="col"&gt;target vertex label&lt;/th&gt;&#10; &lt;th scope="col"&gt;属性&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;father&lt;/td&gt;&#10; &lt;td&gt;edge&lt;/td&gt;&#10; &lt;td&gt;character&lt;/td&gt;&#10; &lt;td&gt;character&lt;/td&gt;&#10; &lt;td&gt;-&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;mother&lt;/td&gt;&#10; &lt;td&gt;edge&lt;/td&gt;&#10; &lt;td&gt;character&lt;/td&gt;&#10; &lt;td&gt;character&lt;/td&gt;&#10; &lt;td&gt;-&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;brother&lt;/td&gt;&#10; &lt;td&gt;edge&lt;/td&gt;&#10; &lt;td&gt;character&lt;/td&gt;&#10; &lt;td&gt;character&lt;/td&gt;&#10; &lt;td&gt;-&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;pet&lt;/td&gt;&#10; &lt;td&gt;edge&lt;/td&gt;&#10; &lt;td&gt;character&lt;/td&gt;&#10; &lt;td&gt;character&lt;/td&gt;&#10; &lt;td&gt;-&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;lives&lt;/td&gt;&#10; &lt;td&gt;edge&lt;/td&gt;&#10; &lt;td&gt;character&lt;/td&gt;&#10; &lt;td&gt;location&lt;/td&gt;&#10; &lt;td&gt;reason&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;在HugeGraph中，每个edge label只能作用于一对source vertex label和target vertex label。也就是说，如果一个图内定义了一种关系father连接character和character，那farther就不能再连接其他的vertex labels。&lt;/p&gt;</description></item></channel></rss>