<?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.0/docs/language/</link><description>Recent content in QUERY LANGUAGE on Apache HugeGraph</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Thu, 15 Sep 2022 12:59:59 +0800</lastBuildDate><atom:link href="https://hugegraph.apache.org/versions/1.0/docs/language/index.xml" rel="self" type="application/rss+xml"/><item><title>HugeGraph Gremlin</title><link>https://hugegraph.apache.org/versions/1.0/docs/language/hugegraph-gremlin/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugegraph.apache.org/versions/1.0/docs/language/hugegraph-gremlin/</guid><description>&lt;h3 id="概述"&gt;概述&#10;&lt;/h3&gt;&#10;&lt;p&gt;HugeGraph支持&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;。 SQL是关系型数据库查询语言，而Gremlin是一种通用的图数据库查询语言，Gremlin可用于创建图的实体（Vertex和Edge）、修改实体内部属性、删除实体，也可执行图的查询操作。&lt;/p&gt;&#10;&lt;p&gt;Gremlin可用于创建图的实体（Vertex和Edge）、修改实体内部属性、删除实体，更主要的是可用于执行图的查询及分析操作。&lt;/p&gt;&#10;&lt;h3 id="tinkerpop-features"&gt;TinkerPop Features&#10;&lt;/h3&gt;&#10;&lt;p&gt;HugeGraph实现了TinkerPop框架，但是并没有实现TinkerPop所有的特性。&lt;/p&gt;&#10;&lt;p&gt;下表列出HugeGraph对TinkerPop各种特性的支持情况：&lt;/p&gt;&#10;&lt;h3 id="graph-features"&gt;Graph Features&#10;&lt;/h3&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;Name&lt;/th&gt;&#10; &lt;th scope="col"&gt;Description&lt;/th&gt;&#10; &lt;th scope="col"&gt;Support&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Computer&lt;/td&gt;&#10; &lt;td&gt;Determines if the {@code Graph} implementation supports {@link GraphComputer} based processing&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Transactions&lt;/td&gt;&#10; &lt;td&gt;Determines if the {@code Graph} implementations supports transactions.&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;Persistence&lt;/td&gt;&#10; &lt;td&gt;Determines if the {@code Graph} implementation supports persisting it&amp;rsquo;s contents natively to disk.This feature does not refer to every graph&amp;rsquo;s ability to write to disk via the Gremlin IO packages(.e.g. GraphML), unless the graph natively persists to disk via those options somehow. For example,TinkerGraph does not support this feature as it is a pure in-sideEffects graph.&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;ThreadedTransactions&lt;/td&gt;&#10; &lt;td&gt;Determines if the {@code Graph} implementation supports threaded transactions which allow a transaction be executed across multiple threads via {@link Transaction#createThreadedTx()}.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;ConcurrentAccess&lt;/td&gt;&#10; &lt;td&gt;Determines if the {@code Graph} implementation supports more than one connection to the same instance at the same time. For example, Neo4j embedded does not support this feature because concurrent access to the same database files by multiple instances is not possible. However, Neo4j HA could support this feature as each new {@code Graph} instance coordinates with the Neo4j cluster allowing multiple instances to operate on the same database.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;h3 id="vertex-features"&gt;Vertex Features&#10;&lt;/h3&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;Name&lt;/th&gt;&#10; &lt;th scope="col"&gt;Description&lt;/th&gt;&#10; &lt;th scope="col"&gt;Support&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;UserSuppliedIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} can have a user defined identifier. Implementation that do not support this feature will be expected to auto-generate unique identifiers. In other words, if the {@link Graph} allows {@code graph.addVertex(id,x)} to work and thus set the identifier of the newly added {@link Vertex} to the value of {@code x} then this feature should return true. In this case, {@code x} is assumed to be an identifier data type that the {@link Graph} will accept.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;NumericIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} has numeric identifiers as their internal representation. In other words,if the value returned from {@link Element#id()} is a numeric value then this method should be return {@code true}. Note that this feature is most generally used for determining the appropriate tests to execute in the Gremlin Test Suite.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;StringIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} has string identifiers as their internal representation. In other words, if the value returned from {@link Element#id()} is a string value then this method should be return {@code true}. Note that this feature is most generally used for determining the appropriate tests to execute in the Gremlin Test Suite.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;UuidIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} has UUID identifiers as their internal representation. In other words,if the value returned from {@link Element#id()} is a {@link UUID} value then this method should be return {@code true}.Note that this feature is most generally used for determining the appropriate tests to execute in the Gremlin Test Suite.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;CustomIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} has a specific custom object as their internal representation.In other words, if the value returned from {@link Element#id()} is a type defined by the graph implementations, such as OrientDB&amp;rsquo;s {@code Rid}, then this method should be return {@code true}.Note that this feature is most generally used for determining the appropriate tests to execute in the Gremlin Test Suite.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;AnyIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} any Java object is a suitable identifier. TinkerGraph is a good example of a {@link Graph} that can support this feature, as it can use any {@link Object} as a value for the identifier. Note that this feature is most generally used for determining the appropriate tests to execute in the Gremlin Test Suite. This setting should only return {@code true} if {@link #supportsUserSuppliedIds()} is {@code true}.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;AddProperty&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} allows properties to be added. This feature is set independently from supporting &amp;ldquo;data types&amp;rdquo; and refers to support of calls to {@link Element#property(String, Object)}.&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;RemoveProperty&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} allows properties to be removed.&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;AddVertices&lt;/td&gt;&#10; &lt;td&gt;Determines if a {@link Vertex} can be added to the {@code Graph}.&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;MultiProperties&lt;/td&gt;&#10; &lt;td&gt;Determines if a {@link Vertex} can support multiple properties with the same key.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;DuplicateMultiProperties&lt;/td&gt;&#10; &lt;td&gt;Determines if a {@link Vertex} can support non-unique values on the same key. For this value to be {@code true}, then {@link #supportsMetaProperties()} must also return true. By default this method, just returns what {@link #supportsMultiProperties()} returns.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;MetaProperties&lt;/td&gt;&#10; &lt;td&gt;Determines if a {@link Vertex} can support properties on vertex properties. It is assumed that a graph will support all the same data types for meta-properties that are supported for regular properties.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;RemoveVertices&lt;/td&gt;&#10; &lt;td&gt;Determines if a {@link Vertex} can be removed from the {@code Graph}.&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;h3 id="edge-features"&gt;Edge Features&#10;&lt;/h3&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;Name&lt;/th&gt;&#10; &lt;th scope="col"&gt;Description&lt;/th&gt;&#10; &lt;th scope="col"&gt;Support&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;UserSuppliedIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} can have a user defined identifier. Implementation that do not support this feature will be expected to auto-generate unique identifiers. In other words, if the {@link Graph} allows {@code graph.addVertex(id,x)} to work and thus set the identifier of the newly added {@link Vertex} to the value of {@code x} then this feature should return true. In this case, {@code x} is assumed to be an identifier data type that the {@link Graph} will accept.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;NumericIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} has numeric identifiers as their internal representation. In other words,if the value returned from {@link Element#id()} is a numeric value then this method should be return {@code true}. Note that this feature is most generally used for determining the appropriate tests to execute in the Gremlin Test Suite.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;StringIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} has string identifiers as their internal representation. In other words, if the value returned from {@link Element#id()} is a string value then this method should be return {@code true}. Note that this feature is most generally used for determining the appropriate tests to execute in the Gremlin Test Suite.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;UuidIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} has UUID identifiers as their internal representation. In other words,if the value returned from {@link Element#id()} is a {@link UUID} value then this method should be return {@code true}.Note that this feature is most generally used for determining the appropriate tests to execute in the Gremlin Test Suite.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;CustomIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} has a specific custom object as their internal representation.In other words, if the value returned from {@link Element#id()} is a type defined by the graph implementations, such as OrientDB&amp;rsquo;s {@code Rid}, then this method should be return {@code true}.Note that this feature is most generally used for determining the appropriate tests to execute in the Gremlin Test Suite.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;AnyIds&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} any Java object is a suitable identifier. TinkerGraph is a good example of a {@link Graph} that can support this feature, as it can use any {@link Object} as a value for the identifier. Note that this feature is most generally used for determining the appropriate tests to execute in the Gremlin Test Suite. This setting should only return {@code true} if {@link #supportsUserSuppliedIds()} is {@code true}.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;AddProperty&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} allows properties to be added. This feature is set independently from supporting &amp;ldquo;data types&amp;rdquo; and refers to support of calls to {@link Element#property(String, Object)}.&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;RemoveProperty&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Element} allows properties to be removed.&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;AddEdges&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Edge} can be added to a {@code Vertex}.&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;RemoveEdges&lt;/td&gt;&#10; &lt;td&gt;Determines if an {@link Edge} can be removed from a {@code Vertex}.&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;h3 id="data-type-features"&gt;Data Type Features&#10;&lt;/h3&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;Name&lt;/th&gt;&#10; &lt;th scope="col"&gt;Description&lt;/th&gt;&#10; &lt;th scope="col"&gt;Support&lt;/th&gt;&#10; &lt;/tr&gt;&#10; &lt;/thead&gt;&#10; &lt;tbody&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;BooleanValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;ByteValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;DoubleValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;FloatValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;IntegerValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;LongValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;MapValues&lt;/td&gt;&#10; &lt;td&gt;Supports setting of a {@code Map} value. The assumption is that the {@code Map} can contain arbitrary serializable values that may or may not be defined as a feature itself&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;MixedListValues&lt;/td&gt;&#10; &lt;td&gt;Supports setting of a {@code List} value. The assumption is that the {@code List} can contain arbitrary serializable values that may or may not be defined as a feature itself. As this{@code List} is &amp;ldquo;mixed&amp;rdquo; it does not need to contain objects of the same type.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;BooleanArrayValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;ByteArrayValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;DoubleArrayValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;FloatArrayValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;IntegerArrayValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;LongArrayValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;SerializableValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;StringArrayValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;StringValues&lt;/td&gt;&#10; &lt;td&gt;&lt;/td&gt;&#10; &lt;td&gt;true&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;tr&gt;&#10; &lt;td&gt;UniformListValues&lt;/td&gt;&#10; &lt;td&gt;Supports setting of a {@code List} value. The assumption is that the {@code List} can contain arbitrary serializable values that may or may not be defined as a feature itself. As this{@code List} is &amp;ldquo;uniform&amp;rdquo; it must contain objects of the same type.&lt;/td&gt;&#10; &lt;td&gt;false&lt;/td&gt;&#10; &lt;/tr&gt;&#10; &lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;h3 id="gremlin的步骤"&gt;Gremlin的步骤&#10;&lt;/h3&gt;&#10;&lt;p&gt;HugeGraph支持Gremlin的所有步骤。有关Gremlin的完整参考信息，请参与&lt;a href="http://tinkerpop.apache.org/docs/current/reference/"&gt;Gremlin官网&lt;/a&gt;。&lt;/p&gt;</description></item><item><title>HugeGraph Examples</title><link>https://hugegraph.apache.org/versions/1.0/docs/language/hugegraph-example/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://hugegraph.apache.org/versions/1.0/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;框架的图数据库，均支持[Gremlin](&lt;a href="https://tinkerpop.apache"&gt;https://tinkerpop.apache&lt;/a&gt;&#10;.org/gremlin.html)图查询语言，在使用方法和接口方面具有很多相似的地方。然而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;center&gt;&#10; &lt;img src="https://hugegraph.apache.org/versions/1.0/docs/images/graph-of-gods.png" alt="image"&gt;&#10;&lt;/center&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>