diff --git a/cn/docs/_print/index.html b/cn/docs/_print/index.html index 445650689..e74abe6bc 100644 --- a/cn/docs/_print/index.html +++ b/cn/docs/_print/index.html @@ -6493,8 +6493,7 @@ # | %23 & | %26 = | %3D -
  • 查询某一类别的顶点或边(query by label)时提示超时

    由于属于某一label的数据量可能比较多,请加上limit限制。

  • 通过RESTful API操作图是可以的,但是发送Gremlin语句就报错:Request Failed(500)

    可能是GremlinServer的配置有误,检查gremlin-server.yamlhostport是否与rest-server.propertiesgremlinserver.url匹配,如不匹配则修改,然后重启服务。

  • 使用Loader导数据出现Socket Timeout异常,然后导致Loader中断

    持续地导入数据会使Server的压力过大,然后导致有些请求超时。可以通过调整Loader的参数来适当缓解Server压力(如:重试次数,重试间隔,错误容忍数等),降低该问题出现频率。

  • 如何删除全部的顶点和边,RESTful API中没有这样的接口,调用gremling.V().drop()会报错Vertices in transaction have reached capacity xxx

    目前确实没有好办法删除全部的数据,用户如果是自己部署的Server和后端,可以直接清空数据库,重启Server。可以使用paging API或scan API先获取所有数据,再逐条删除。

  • 清空了数据库,并且执行了init-store,但是添加schema时提示"xxx has existed"

    HugeGraphServer内是有缓存的,清空数据库的同时是需要重启Server的,否则残留的缓存会产生不一致。

  • 插入顶点或边的过程中报错:Id max length is 128, but got xxx {yyy}Big id max length is 32768, but got xxx

    为了保证查询性能,目前的后端存储对id列的长度做了限制,顶点id不能超过128字节,边id长度不能超过32768字节,索引id不能超过128字节。

  • 是否支持嵌套属性,如果不支持,是否有什么替代方案

    嵌套属性目前暂不支持。替代方案:可以把嵌套属性作为单独的顶点拿出来,然后用边连接起来。

  • 一个EdgeLabel是否可以连接多对VertexLabel,比如"投资"关系,可以是"个人"投资"企业",也可以是"企业"投资"企业"

    一个EdgeLabel不支持连接多对VertexLabel,需要用户将EdgeLabel拆分得更细一点,如:“个人投资”,“企业投资”。

  • 通过RestAPI发送请求时提示HTTP 415 Unsupported Media Type

    请求头中需要指定Content-Type:application/json

  • 其他问题可以在对应项目的 issue 区搜索,例如 Server-Issues / Loader Issues

    7 - QUERY LANGUAGE

    7.1 - HugeGraph Gremlin

    概述

    HugeGraph支持Apache TinkerPop3的图形遍历查询语言Gremlin。 SQL是关系型数据库查询语言,而Gremlin是一种通用的图数据库查询语言,Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,也可执行图的查询操作。

    Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,更主要的是可用于执行图的查询及分析操作。

    TinkerPop Features

    HugeGraph实现了TinkerPop框架,但是并没有实现TinkerPop所有的特性。

    下表列出HugeGraph对TinkerPop各种特性的支持情况:

    Graph Features

    NameDescriptionSupport
    ComputerDetermines if the {@code Graph} implementation supports {@link GraphComputer} based processingfalse
    TransactionsDetermines if the {@code Graph} implementations supports transactions.true
    PersistenceDetermines if the {@code Graph} implementation supports persisting it’s contents natively to disk.This feature does not refer to every graph’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.true
    ThreadedTransactionsDetermines if the {@code Graph} implementation supports threaded transactions which allow a transaction be executed across multiple threads via {@link Transaction#createThreadedTx()}.false
    ConcurrentAccessDetermines 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.false

    Vertex Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddVerticesDetermines if a {@link Vertex} can be added to the {@code Graph}.true
    MultiPropertiesDetermines if a {@link Vertex} can support multiple properties with the same key.false
    DuplicateMultiPropertiesDetermines 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.false
    MetaPropertiesDetermines 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.false
    RemoveVerticesDetermines if a {@link Vertex} can be removed from the {@code Graph}.true

    Edge Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddEdgesDetermines if an {@link Edge} can be added to a {@code Vertex}.true
    RemoveEdgesDetermines if an {@link Edge} can be removed from a {@code Vertex}.true

    Data Type Features

    NameDescriptionSupport
    BooleanValuestrue
    ByteValuestrue
    DoubleValuestrue
    FloatValuestrue
    IntegerValuestrue
    LongValuestrue
    MapValuesSupports 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 itselffalse
    MixedListValuesSupports 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 “mixed” it does not need to contain objects of the same type.false
    BooleanArrayValuesfalse
    ByteArrayValuestrue
    DoubleArrayValuesfalse
    FloatArrayValuesfalse
    IntegerArrayValuesfalse
    LongArrayValuesfalse
    SerializableValuesfalse
    StringArrayValuesfalse
    StringValuestrue
    UniformListValuesSupports 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 “uniform” it must contain objects of the same type.false

    Gremlin的步骤

    HugeGraph支持Gremlin的所有步骤。有关Gremlin的完整参考信息,请参与Gremlin官网

    步骤说明文档
    addE在两个顶点之间添加边addE step
    addV将顶点添加到图形addV step
    and确保所有遍历都返回值and step
    as用于向步骤的输出分配变量的步骤调制器as step
    bygrouporder配合使用的步骤调制器by step
    coalesce返回第一个返回结果的遍历coalesce step
    constant返回常量值。 与coalesce配合使用constant step
    count从遍历返回计数count step
    dedup返回已删除重复内容的值dedup step
    drop丢弃值(顶点/边缘)drop step
    fold充当用于计算结果聚合值的屏障fold step
    group根据指定的标签将值分组group step
    has用于筛选属性、顶点和边缘。 支持hasLabelhasIdhasNothas 变体has step
    inject将值注入流中inject step
    is用于通过布尔表达式执行筛选器is step
    limit用于限制遍历中的项数limit step
    local本地包装遍历的某个部分,类似于子查询local step
    not用于生成筛选器的求反结果not step
    optional如果生成了某个结果,则返回指定遍历的结果,否则返回调用元素optional step
    or确保至少有一个遍历会返回值or step
    order按指定的排序顺序返回结果order step
    path返回遍历的完整路径path step
    project将属性投影为映射project step
    properties返回指定标签的属性properties step
    range根据指定的值范围进行筛选range step
    repeat将步骤重复指定的次数。 用于循环repeat step
    sample用于对遍历返回的结果采样sample step
    select用于投影遍历返回的结果select step
    store用于遍历返回的非阻塞聚合store step
    tree将顶点中的路径聚合到树中tree step
    unfold将迭代器作为步骤展开unfold step
    union合并多个遍历返回的结果union step
    V包括顶点与边之间的遍历所需的步骤:VEoutinbothoutEinEbothEoutVinVbothVotherVorder step
    where用于筛选遍历返回的结果。 支持 eqneqltltegtgtebetween 运算符where step

    7.2 - HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持[Gremlin](https://tinkerpop.apache -.org/gremlin.html)图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    schema = hugegraph.schema()
    +
  • 查询某一类别的顶点或边(query by label)时提示超时

    由于属于某一label的数据量可能比较多,请加上limit限制。

  • 通过RESTful API操作图是可以的,但是发送Gremlin语句就报错:Request Failed(500)

    可能是GremlinServer的配置有误,检查gremlin-server.yamlhostport是否与rest-server.propertiesgremlinserver.url匹配,如不匹配则修改,然后重启服务。

  • 使用Loader导数据出现Socket Timeout异常,然后导致Loader中断

    持续地导入数据会使Server的压力过大,然后导致有些请求超时。可以通过调整Loader的参数来适当缓解Server压力(如:重试次数,重试间隔,错误容忍数等),降低该问题出现频率。

  • 如何删除全部的顶点和边,RESTful API中没有这样的接口,调用gremling.V().drop()会报错Vertices in transaction have reached capacity xxx

    目前确实没有好办法删除全部的数据,用户如果是自己部署的Server和后端,可以直接清空数据库,重启Server。可以使用paging API或scan API先获取所有数据,再逐条删除。

  • 清空了数据库,并且执行了init-store,但是添加schema时提示"xxx has existed"

    HugeGraphServer内是有缓存的,清空数据库的同时是需要重启Server的,否则残留的缓存会产生不一致。

  • 插入顶点或边的过程中报错:Id max length is 128, but got xxx {yyy}Big id max length is 32768, but got xxx

    为了保证查询性能,目前的后端存储对id列的长度做了限制,顶点id不能超过128字节,边id长度不能超过32768字节,索引id不能超过128字节。

  • 是否支持嵌套属性,如果不支持,是否有什么替代方案

    嵌套属性目前暂不支持。替代方案:可以把嵌套属性作为单独的顶点拿出来,然后用边连接起来。

  • 一个EdgeLabel是否可以连接多对VertexLabel,比如"投资"关系,可以是"个人"投资"企业",也可以是"企业"投资"企业"

    一个EdgeLabel不支持连接多对VertexLabel,需要用户将EdgeLabel拆分得更细一点,如:“个人投资”,“企业投资”。

  • 通过RestAPI发送请求时提示HTTP 415 Unsupported Media Type

    请求头中需要指定Content-Type:application/json

  • 其他问题可以在对应项目的 issue 区搜索,例如 Server-Issues / Loader Issues

    7 - QUERY LANGUAGE

    7.1 - HugeGraph Gremlin

    概述

    HugeGraph支持Apache TinkerPop3的图形遍历查询语言Gremlin。 SQL是关系型数据库查询语言,而Gremlin是一种通用的图数据库查询语言,Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,也可执行图的查询操作。

    Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,更主要的是可用于执行图的查询及分析操作。

    TinkerPop Features

    HugeGraph实现了TinkerPop框架,但是并没有实现TinkerPop所有的特性。

    下表列出HugeGraph对TinkerPop各种特性的支持情况:

    Graph Features

    NameDescriptionSupport
    ComputerDetermines if the {@code Graph} implementation supports {@link GraphComputer} based processingfalse
    TransactionsDetermines if the {@code Graph} implementations supports transactions.true
    PersistenceDetermines if the {@code Graph} implementation supports persisting it’s contents natively to disk.This feature does not refer to every graph’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.true
    ThreadedTransactionsDetermines if the {@code Graph} implementation supports threaded transactions which allow a transaction be executed across multiple threads via {@link Transaction#createThreadedTx()}.false
    ConcurrentAccessDetermines 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.false

    Vertex Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddVerticesDetermines if a {@link Vertex} can be added to the {@code Graph}.true
    MultiPropertiesDetermines if a {@link Vertex} can support multiple properties with the same key.false
    DuplicateMultiPropertiesDetermines 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.false
    MetaPropertiesDetermines 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.false
    RemoveVerticesDetermines if a {@link Vertex} can be removed from the {@code Graph}.true

    Edge Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddEdgesDetermines if an {@link Edge} can be added to a {@code Vertex}.true
    RemoveEdgesDetermines if an {@link Edge} can be removed from a {@code Vertex}.true

    Data Type Features

    NameDescriptionSupport
    BooleanValuestrue
    ByteValuestrue
    DoubleValuestrue
    FloatValuestrue
    IntegerValuestrue
    LongValuestrue
    MapValuesSupports 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 itselffalse
    MixedListValuesSupports 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 “mixed” it does not need to contain objects of the same type.false
    BooleanArrayValuesfalse
    ByteArrayValuestrue
    DoubleArrayValuesfalse
    FloatArrayValuesfalse
    IntegerArrayValuesfalse
    LongArrayValuesfalse
    SerializableValuesfalse
    StringArrayValuesfalse
    StringValuestrue
    UniformListValuesSupports 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 “uniform” it must contain objects of the same type.false

    Gremlin的步骤

    HugeGraph支持Gremlin的所有步骤。有关Gremlin的完整参考信息,请参与Gremlin官网

    步骤说明文档
    addE在两个顶点之间添加边addE step
    addV将顶点添加到图形addV step
    and确保所有遍历都返回值and step
    as用于向步骤的输出分配变量的步骤调制器as step
    bygrouporder配合使用的步骤调制器by step
    coalesce返回第一个返回结果的遍历coalesce step
    constant返回常量值。 与coalesce配合使用constant step
    count从遍历返回计数count step
    dedup返回已删除重复内容的值dedup step
    drop丢弃值(顶点/边缘)drop step
    fold充当用于计算结果聚合值的屏障fold step
    group根据指定的标签将值分组group step
    has用于筛选属性、顶点和边缘。 支持hasLabelhasIdhasNothas 变体has step
    inject将值注入流中inject step
    is用于通过布尔表达式执行筛选器is step
    limit用于限制遍历中的项数limit step
    local本地包装遍历的某个部分,类似于子查询local step
    not用于生成筛选器的求反结果not step
    optional如果生成了某个结果,则返回指定遍历的结果,否则返回调用元素optional step
    or确保至少有一个遍历会返回值or step
    order按指定的排序顺序返回结果order step
    path返回遍历的完整路径path step
    project将属性投影为映射project step
    properties返回指定标签的属性properties step
    range根据指定的值范围进行筛选range step
    repeat将步骤重复指定的次数。 用于循环repeat step
    sample用于对遍历返回的结果采样sample step
    select用于投影遍历返回的结果select step
    store用于遍历返回的非阻塞聚合store step
    tree将顶点中的路径聚合到树中tree step
    unfold将迭代器作为步骤展开unfold step
    union合并多个遍历返回的结果union step
    V包括顶点与边之间的遍历所需的步骤:VEoutinbothoutEinEbothEoutVinVbothVotherVorder step
    where用于筛选遍历返回的结果。 支持 eqneqltltegtgtebetween 运算符where step

    7.2 - HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持Gremlin图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    schema = hugegraph.schema()
     
     schema.propertyKey("name").asText().ifNotExist().create()
     schema.propertyKey("age").asInt().ifNotExist().create()
    diff --git a/cn/docs/index.xml b/cn/docs/index.xml
    index 9795a5d7f..3fcafdcaa 100644
    --- a/cn/docs/index.xml
    +++ b/cn/docs/index.xml
    @@ -3801,8 +3801,7 @@ HugeGraph目前采用EdgeCut的分区方案。</p>
     <h3 id="1-概述">1 概述</h3>
     <p>本示例将<a href="http://s3.thinkaurelius.com/docs/titan/1.0.0/getting-started.html">TitanDB Getting Started</a> 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。</p>
     <h4 id="11-hugegraph与titandb的异同">1.1 HugeGraph与TitanDB的异同</h4>
    -<p>HugeGraph和TitanDB都是基于<a href="https://tinkerpop.apache.org">Apache TinkerPop3</a>框架的图数据库,均支持[Gremlin](<a href="https://tinkerpop.apache">https://tinkerpop.apache</a>
    -.org/gremlin.html)图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。</p>
    +<p>HugeGraph和TitanDB都是基于<a href="https://tinkerpop.apache.org">Apache TinkerPop3</a>框架的图数据库,均支持<a href="https://tinkerpop.apache.org/gremlin.html">Gremlin</a>图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。</p>
     <p>HugeGraph相对于TitanDB而言,其主要特点如下:</p>
     <ul>
     <li>HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;</li>
    diff --git a/cn/docs/language/_print/index.html b/cn/docs/language/_print/index.html
    index 60d89f57a..dc46752d8 100644
    --- a/cn/docs/language/_print/index.html
    +++ b/cn/docs/language/_print/index.html
    @@ -1,7 +1,6 @@
     QUERY LANGUAGE | HugeGraph
     

    This is the multi-page printable view of this section. -Click here to print.

    Return to the regular view of this page.

    QUERY LANGUAGE

    1 - HugeGraph Gremlin

    概述

    HugeGraph支持Apache TinkerPop3的图形遍历查询语言Gremlin。 SQL是关系型数据库查询语言,而Gremlin是一种通用的图数据库查询语言,Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,也可执行图的查询操作。

    Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,更主要的是可用于执行图的查询及分析操作。

    TinkerPop Features

    HugeGraph实现了TinkerPop框架,但是并没有实现TinkerPop所有的特性。

    下表列出HugeGraph对TinkerPop各种特性的支持情况:

    Graph Features

    NameDescriptionSupport
    ComputerDetermines if the {@code Graph} implementation supports {@link GraphComputer} based processingfalse
    TransactionsDetermines if the {@code Graph} implementations supports transactions.true
    PersistenceDetermines if the {@code Graph} implementation supports persisting it’s contents natively to disk.This feature does not refer to every graph’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.true
    ThreadedTransactionsDetermines if the {@code Graph} implementation supports threaded transactions which allow a transaction be executed across multiple threads via {@link Transaction#createThreadedTx()}.false
    ConcurrentAccessDetermines 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.false

    Vertex Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddVerticesDetermines if a {@link Vertex} can be added to the {@code Graph}.true
    MultiPropertiesDetermines if a {@link Vertex} can support multiple properties with the same key.false
    DuplicateMultiPropertiesDetermines 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.false
    MetaPropertiesDetermines 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.false
    RemoveVerticesDetermines if a {@link Vertex} can be removed from the {@code Graph}.true

    Edge Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddEdgesDetermines if an {@link Edge} can be added to a {@code Vertex}.true
    RemoveEdgesDetermines if an {@link Edge} can be removed from a {@code Vertex}.true

    Data Type Features

    NameDescriptionSupport
    BooleanValuestrue
    ByteValuestrue
    DoubleValuestrue
    FloatValuestrue
    IntegerValuestrue
    LongValuestrue
    MapValuesSupports 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 itselffalse
    MixedListValuesSupports 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 “mixed” it does not need to contain objects of the same type.false
    BooleanArrayValuesfalse
    ByteArrayValuestrue
    DoubleArrayValuesfalse
    FloatArrayValuesfalse
    IntegerArrayValuesfalse
    LongArrayValuesfalse
    SerializableValuesfalse
    StringArrayValuesfalse
    StringValuestrue
    UniformListValuesSupports 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 “uniform” it must contain objects of the same type.false

    Gremlin的步骤

    HugeGraph支持Gremlin的所有步骤。有关Gremlin的完整参考信息,请参与Gremlin官网

    步骤说明文档
    addE在两个顶点之间添加边addE step
    addV将顶点添加到图形addV step
    and确保所有遍历都返回值and step
    as用于向步骤的输出分配变量的步骤调制器as step
    bygrouporder配合使用的步骤调制器by step
    coalesce返回第一个返回结果的遍历coalesce step
    constant返回常量值。 与coalesce配合使用constant step
    count从遍历返回计数count step
    dedup返回已删除重复内容的值dedup step
    drop丢弃值(顶点/边缘)drop step
    fold充当用于计算结果聚合值的屏障fold step
    group根据指定的标签将值分组group step
    has用于筛选属性、顶点和边缘。 支持hasLabelhasIdhasNothas 变体has step
    inject将值注入流中inject step
    is用于通过布尔表达式执行筛选器is step
    limit用于限制遍历中的项数limit step
    local本地包装遍历的某个部分,类似于子查询local step
    not用于生成筛选器的求反结果not step
    optional如果生成了某个结果,则返回指定遍历的结果,否则返回调用元素optional step
    or确保至少有一个遍历会返回值or step
    order按指定的排序顺序返回结果order step
    path返回遍历的完整路径path step
    project将属性投影为映射project step
    properties返回指定标签的属性properties step
    range根据指定的值范围进行筛选range step
    repeat将步骤重复指定的次数。 用于循环repeat step
    sample用于对遍历返回的结果采样sample step
    select用于投影遍历返回的结果select step
    store用于遍历返回的非阻塞聚合store step
    tree将顶点中的路径聚合到树中tree step
    unfold将迭代器作为步骤展开unfold step
    union合并多个遍历返回的结果union step
    V包括顶点与边之间的遍历所需的步骤:VEoutinbothoutEinEbothEoutVinVbothVotherVorder step
    where用于筛选遍历返回的结果。 支持 eqneqltltegtgtebetween 运算符where step

    2 - HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持[Gremlin](https://tinkerpop.apache -.org/gremlin.html)图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    • HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;
    • HugeGraph具有Server和Client的概念,第三方系统可以通过jar引用、client、api等多种方式接入,而TitanDB仅支持jar引用方式接入。
    • HugeGraph的Schema需要显式定义,所有的插入和查询均需要通过严格的schema校验,目前暂不支持schema的隐式创建。
    • HugeGraph充分利用后端存储系统的特点来实现数据高效存取,而TitanDB以统一的Kv结构无视后端的差异性。
    • HugeGraph的更新操作可以实现按需操作(例如:更新某个属性)性能更好。TitanDB的更新是read and update方式。
    • HugeGraph的VertexId和EdgeId均支持拼接,可实现自动去重,同时查询性能更好。TitanDB的所有Id均是自动生成,查询需要经索引。

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    QUERY LANGUAGE

    1 - HugeGraph Gremlin

    概述

    HugeGraph支持Apache TinkerPop3的图形遍历查询语言Gremlin。 SQL是关系型数据库查询语言,而Gremlin是一种通用的图数据库查询语言,Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,也可执行图的查询操作。

    Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,更主要的是可用于执行图的查询及分析操作。

    TinkerPop Features

    HugeGraph实现了TinkerPop框架,但是并没有实现TinkerPop所有的特性。

    下表列出HugeGraph对TinkerPop各种特性的支持情况:

    Graph Features

    NameDescriptionSupport
    ComputerDetermines if the {@code Graph} implementation supports {@link GraphComputer} based processingfalse
    TransactionsDetermines if the {@code Graph} implementations supports transactions.true
    PersistenceDetermines if the {@code Graph} implementation supports persisting it’s contents natively to disk.This feature does not refer to every graph’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.true
    ThreadedTransactionsDetermines if the {@code Graph} implementation supports threaded transactions which allow a transaction be executed across multiple threads via {@link Transaction#createThreadedTx()}.false
    ConcurrentAccessDetermines 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.false

    Vertex Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddVerticesDetermines if a {@link Vertex} can be added to the {@code Graph}.true
    MultiPropertiesDetermines if a {@link Vertex} can support multiple properties with the same key.false
    DuplicateMultiPropertiesDetermines 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.false
    MetaPropertiesDetermines 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.false
    RemoveVerticesDetermines if a {@link Vertex} can be removed from the {@code Graph}.true

    Edge Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddEdgesDetermines if an {@link Edge} can be added to a {@code Vertex}.true
    RemoveEdgesDetermines if an {@link Edge} can be removed from a {@code Vertex}.true

    Data Type Features

    NameDescriptionSupport
    BooleanValuestrue
    ByteValuestrue
    DoubleValuestrue
    FloatValuestrue
    IntegerValuestrue
    LongValuestrue
    MapValuesSupports 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 itselffalse
    MixedListValuesSupports 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 “mixed” it does not need to contain objects of the same type.false
    BooleanArrayValuesfalse
    ByteArrayValuestrue
    DoubleArrayValuesfalse
    FloatArrayValuesfalse
    IntegerArrayValuesfalse
    LongArrayValuesfalse
    SerializableValuesfalse
    StringArrayValuesfalse
    StringValuestrue
    UniformListValuesSupports 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 “uniform” it must contain objects of the same type.false

    Gremlin的步骤

    HugeGraph支持Gremlin的所有步骤。有关Gremlin的完整参考信息,请参与Gremlin官网

    步骤说明文档
    addE在两个顶点之间添加边addE step
    addV将顶点添加到图形addV step
    and确保所有遍历都返回值and step
    as用于向步骤的输出分配变量的步骤调制器as step
    bygrouporder配合使用的步骤调制器by step
    coalesce返回第一个返回结果的遍历coalesce step
    constant返回常量值。 与coalesce配合使用constant step
    count从遍历返回计数count step
    dedup返回已删除重复内容的值dedup step
    drop丢弃值(顶点/边缘)drop step
    fold充当用于计算结果聚合值的屏障fold step
    group根据指定的标签将值分组group step
    has用于筛选属性、顶点和边缘。 支持hasLabelhasIdhasNothas 变体has step
    inject将值注入流中inject step
    is用于通过布尔表达式执行筛选器is step
    limit用于限制遍历中的项数limit step
    local本地包装遍历的某个部分,类似于子查询local step
    not用于生成筛选器的求反结果not step
    optional如果生成了某个结果,则返回指定遍历的结果,否则返回调用元素optional step
    or确保至少有一个遍历会返回值or step
    order按指定的排序顺序返回结果order step
    path返回遍历的完整路径path step
    project将属性投影为映射project step
    properties返回指定标签的属性properties step
    range根据指定的值范围进行筛选range step
    repeat将步骤重复指定的次数。 用于循环repeat step
    sample用于对遍历返回的结果采样sample step
    select用于投影遍历返回的结果select step
    store用于遍历返回的非阻塞聚合store step
    tree将顶点中的路径聚合到树中tree step
    unfold将迭代器作为步骤展开unfold step
    union合并多个遍历返回的结果union step
    V包括顶点与边之间的遍历所需的步骤:VEoutinbothoutEinEbothEoutVinVbothVotherVorder step
    where用于筛选遍历返回的结果。 支持 eqneqltltegtgtebetween 运算符where step

    2 - HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持Gremlin图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    • HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;
    • HugeGraph具有Server和Client的概念,第三方系统可以通过jar引用、client、api等多种方式接入,而TitanDB仅支持jar引用方式接入。
    • HugeGraph的Schema需要显式定义,所有的插入和查询均需要通过严格的schema校验,目前暂不支持schema的隐式创建。
    • HugeGraph充分利用后端存储系统的特点来实现数据高效存取,而TitanDB以统一的Kv结构无视后端的差异性。
    • HugeGraph的更新操作可以实现按需操作(例如:更新某个属性)性能更好。TitanDB的更新是read and update方式。
    • HugeGraph的VertexId和EdgeId均支持拼接,可实现自动去重,同时查询性能更好。TitanDB的所有Id均是自动生成,查询需要经索引。

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    schema = hugegraph.schema()
     
     schema.propertyKey("name").asText().ifNotExist().create()
     schema.propertyKey("age").asInt().ifNotExist().create()
    diff --git a/cn/docs/language/hugegraph-example/index.html b/cn/docs/language/hugegraph-example/index.html
    index 68453e29a..bd3b91a8c 100644
    --- a/cn/docs/language/hugegraph-example/index.html
    +++ b/cn/docs/language/hugegraph-example/index.html
    @@ -2,21 +2,21 @@
     本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。
     1.1 HugeGraph与TitanDB的异同
     HugeGraph和TitanDB …"> Create child page
      Create documentation issue
      Create project issue
    - Print entire section

    HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持[Gremlin](https://tinkerpop.apache -.org/gremlin.html)图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    • HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;
    • HugeGraph具有Server和Client的概念,第三方系统可以通过jar引用、client、api等多种方式接入,而TitanDB仅支持jar引用方式接入。
    • HugeGraph的Schema需要显式定义,所有的插入和查询均需要通过严格的schema校验,目前暂不支持schema的隐式创建。
    • HugeGraph充分利用后端存储系统的特点来实现数据高效存取,而TitanDB以统一的Kv结构无视后端的差异性。
    • HugeGraph的更新操作可以实现按需操作(例如:更新某个属性)性能更好。TitanDB的更新是read and update方式。
    • HugeGraph的VertexId和EdgeId均支持拼接,可实现自动去重,同时查询性能更好。TitanDB的所有Id均是自动生成,查询需要经索引。

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    schema = hugegraph.schema()
    + Print entire section

    HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持Gremlin图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    • HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;
    • HugeGraph具有Server和Client的概念,第三方系统可以通过jar引用、client、api等多种方式接入,而TitanDB仅支持jar引用方式接入。
    • HugeGraph的Schema需要显式定义,所有的插入和查询均需要通过严格的schema校验,目前暂不支持schema的隐式创建。
    • HugeGraph充分利用后端存储系统的特点来实现数据高效存取,而TitanDB以统一的Kv结构无视后端的差异性。
    • HugeGraph的更新操作可以实现按需操作(例如:更新某个属性)性能更好。TitanDB的更新是read and update方式。
    • HugeGraph的VertexId和EdgeId均支持拼接,可实现自动去重,同时查询性能更好。TitanDB的所有Id均是自动生成,查询需要经索引。

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    schema = hugegraph.schema()
     
     schema.propertyKey("name").asText().ifNotExist().create()
     schema.propertyKey("age").asInt().ifNotExist().create()
    @@ -97,7 +96,7 @@
     
     // what is the name of the brother and the name of the place?
     g.V(pluto).out('brother').as('god').out('lives').as('place').select('god','place').by('name')
    -

    推荐使用HugeGraph-Studio 通过可视化的方式来执行上述代码。另外也可以通过HugeGraph-Client、HugeApi、GremlinConsole和GremlinDriver等多种方式执行上述代码。

    3.2 总结

    HugeGraph 目前支持 Gremlin 的语法,用户可以通过 Gremlin / REST-API 实现各种查询需求。


    Last modified January 1, 2023: enhance validate doc (#171) (89a0a1a6)
    +

    推荐使用HugeGraph-Studio 通过可视化的方式来执行上述代码。另外也可以通过HugeGraph-Client、HugeApi、GremlinConsole和GremlinDriver等多种方式执行上述代码。

    3.2 总结

    HugeGraph 目前支持 Gremlin 的语法,用户可以通过 Gremlin / REST-API 实现各种查询需求。


    diff --git a/cn/docs/language/index.xml b/cn/docs/language/index.xml index c96d1aa85..3dc58afe4 100644 --- a/cn/docs/language/index.xml +++ b/cn/docs/language/index.xml @@ -469,8 +469,7 @@ <h3 id="1-概述">1 概述</h3> <p>本示例将<a href="http://s3.thinkaurelius.com/docs/titan/1.0.0/getting-started.html">TitanDB Getting Started</a> 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。</p> <h4 id="11-hugegraph与titandb的异同">1.1 HugeGraph与TitanDB的异同</h4> -<p>HugeGraph和TitanDB都是基于<a href="https://tinkerpop.apache.org">Apache TinkerPop3</a>框架的图数据库,均支持[Gremlin](<a href="https://tinkerpop.apache">https://tinkerpop.apache</a> -.org/gremlin.html)图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。</p> +<p>HugeGraph和TitanDB都是基于<a href="https://tinkerpop.apache.org">Apache TinkerPop3</a>框架的图数据库,均支持<a href="https://tinkerpop.apache.org/gremlin.html">Gremlin</a>图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。</p> <p>HugeGraph相对于TitanDB而言,其主要特点如下:</p> <ul> <li>HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;</li> diff --git a/cn/sitemap.xml b/cn/sitemap.xml index 11bd050f5..d2b8374a9 100644 --- a/cn/sitemap.xml +++ b/cn/sitemap.xml @@ -1 +1 @@ -/cn/docs/guides/architectural/2023-01-01T16:16:43+08:00/cn/docs/config/config-guide/2022-04-17T11:36:55+08:00/cn/docs/language/hugegraph-gremlin/2023-01-01T16:16:43+08:00/cn/docs/performance/hugegraph-benchmark-0.5.6/2022-09-15T15:16:23+08:00/cn/docs/quickstart/hugegraph-server/2023-01-04T22:59:07+08:00/cn/docs/introduction/readme/2023-01-04T22:59:07+08:00/cn/docs/changelog/hugegraph-1.0.0-release-notes/2023-01-09T07:41:46+08:00/cn/docs/clients/restful-api/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/schema/2022-04-17T11:36:55+08:00/cn/docs/performance/api-preformance/hugegraph-api-0.5.6-rocksdb/2023-01-01T16:16:43+08:00/cn/docs/contribution-guidelines/contribute/2023-01-04T22:59:07+08:00/cn/docs/config/config-option/2023-01-01T16:16:43+08:00/cn/docs/guides/desgin-concept/2022-04-17T11:36:55+08:00/cn/docs/download/download/2023-01-01T16:16:43+08:00/cn/docs/language/hugegraph-example/2023-01-01T16:16:43+08:00/cn/docs/clients/hugegraph-client/2022-09-15T15:16:23+08:00/cn/docs/performance/api-preformance/2022-04-17T11:36:55+08:00/cn/docs/quickstart/hugegraph-loader/2023-01-04T22:59:07+08:00/cn/docs/clients/restful-api/propertykey/2022-05-12T21:24:05+08:00/cn/docs/changelog/hugegraph-0.11.2-release-notes/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.12.0-release-notes/2023-01-01T16:16:43+08:00/cn/docs/performance/api-preformance/hugegraph-api-0.5.6-cassandra/2023-01-01T16:16:43+08:00/cn/docs/contribution-guidelines/subscribe/2022-12-30T19:57:48+08:00/cn/docs/config/config-authentication/2022-04-17T11:36:55+08:00/cn/docs/clients/gremlin-console/2022-04-17T11:36:55+08:00/cn/docs/guides/custom-plugin/2022-09-15T15:16:23+08:00/cn/docs/performance/hugegraph-loader-performance/2022-04-17T11:36:55+08:00/cn/docs/quickstart/hugegraph-tools/2023-01-04T22:59:07+08:00/cn/docs/quickstart/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.10.4-release-notes/2022-04-17T11:36:55+08:00/cn/docs/performance/api-preformance/hugegraph-api-0.4.4/2023-01-01T16:16:43+08:00/cn/docs/clients/restful-api/vertexlabel/2022-04-17T11:36:55+08:00/cn/docs/contribution-guidelines/validate-release/2023-01-07T14:50:47+08:00/cn/docs/guides/backup-restore/2022-04-17T11:36:55+08:00/cn/docs/config/2022-04-17T11:36:55+08:00/cn/docs/config/config-https/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/edgelabel/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.9.2-release-notes/2022-04-17T11:36:55+08:00/cn/docs/performance/api-preformance/hugegraph-api-0.2/2023-01-01T16:16:43+08:00/cn/docs/quickstart/hugegraph-hubble/2023-01-01T16:16:43+08:00/cn/docs/clients/2022-04-17T11:36:55+08:00/cn/docs/config/config-computer/2023-01-01T16:16:43+08:00/cn/docs/guides/faq/2023-01-04T22:59:07+08:00/cn/docs/clients/restful-api/indexlabel/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.8.0-release-notes/2022-04-17T11:36:55+08:00/cn/docs/quickstart/hugegraph-client/2023-01-01T16:16:43+08:00/cn/docs/guides/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/rebuild/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.7.4-release-notes/2022-04-17T11:36:55+08:00/cn/docs/quickstart/hugegraph-computer/2023-01-01T16:16:43+08:00/cn/docs/language/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.6.1-release-notes/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/vertex/2022-09-15T15:16:23+08:00/cn/docs/clients/restful-api/edge/2022-09-15T15:16:23+08:00/cn/docs/performance/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.5.6-release-notes/2022-04-17T11:36:55+08:00/cn/docs/changelog/2022-04-17T11:36:55+08:00/cn/docs/contribution-guidelines/2022-12-30T19:57:48+08:00/cn/docs/changelog/hugegraph-0.4.4-release-notes/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/traverser/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/rank/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.3.3-release-notes/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.2-release-notes/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/variable/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/graphs/2022-05-27T09:27:37+08:00/cn/docs/changelog/hugegraph-0.2.4-release-notes/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/task/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/gremlin/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/auth/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/other/2022-04-17T11:36:55+08:00/cn/docs/2022-12-30T19:57:48+08:00/cn/blog/news/2022-04-17T11:36:55+08:00/cn/blog/releases/2022-04-17T11:36:55+08:00/cn/blog/2018/10/06/easy-documentation-with-docsy/2022-04-17T11:36:55+08:00/cn/blog/2018/10/06/the-second-blog-post/2022-04-17T11:36:55+08:00/cn/blog/2018/01/04/another-great-release/2022-04-17T11:36:55+08:00/cn/docs/cla/2022-04-17T11:36:55+08:00/cn/docs/performance/hugegraph-benchmark-0.4.4/2022-09-15T15:16:23+08:00/cn/docs/summary/2022-11-27T21:05:55+08:00/cn/blog/2022-04-17T11:36:55+08:00/cn/categories//cn/community/2022-04-17T11:36:55+08:00/cn/2023-01-04T22:59:07+08:00/cn/search/2022-04-17T11:36:55+08:00/cn/tags/ \ No newline at end of file +/cn/docs/guides/architectural/2023-01-01T16:16:43+08:00/cn/docs/config/config-guide/2022-04-17T11:36:55+08:00/cn/docs/language/hugegraph-gremlin/2023-01-01T16:16:43+08:00/cn/docs/performance/hugegraph-benchmark-0.5.6/2022-09-15T15:16:23+08:00/cn/docs/quickstart/hugegraph-server/2023-01-04T22:59:07+08:00/cn/docs/introduction/readme/2023-01-04T22:59:07+08:00/cn/docs/changelog/hugegraph-1.0.0-release-notes/2023-01-09T07:41:46+08:00/cn/docs/clients/restful-api/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/schema/2022-04-17T11:36:55+08:00/cn/docs/performance/api-preformance/hugegraph-api-0.5.6-rocksdb/2023-01-01T16:16:43+08:00/cn/docs/contribution-guidelines/contribute/2023-01-04T22:59:07+08:00/cn/docs/config/config-option/2023-01-01T16:16:43+08:00/cn/docs/guides/desgin-concept/2022-04-17T11:36:55+08:00/cn/docs/download/download/2023-01-01T16:16:43+08:00/cn/docs/language/hugegraph-example/2023-02-02T01:21:10+08:00/cn/docs/clients/hugegraph-client/2022-09-15T15:16:23+08:00/cn/docs/performance/api-preformance/2022-04-17T11:36:55+08:00/cn/docs/quickstart/hugegraph-loader/2023-01-04T22:59:07+08:00/cn/docs/clients/restful-api/propertykey/2022-05-12T21:24:05+08:00/cn/docs/changelog/hugegraph-0.11.2-release-notes/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.12.0-release-notes/2023-01-01T16:16:43+08:00/cn/docs/performance/api-preformance/hugegraph-api-0.5.6-cassandra/2023-01-01T16:16:43+08:00/cn/docs/contribution-guidelines/subscribe/2022-12-30T19:57:48+08:00/cn/docs/config/config-authentication/2022-04-17T11:36:55+08:00/cn/docs/clients/gremlin-console/2022-04-17T11:36:55+08:00/cn/docs/guides/custom-plugin/2022-09-15T15:16:23+08:00/cn/docs/performance/hugegraph-loader-performance/2022-04-17T11:36:55+08:00/cn/docs/quickstart/hugegraph-tools/2023-01-04T22:59:07+08:00/cn/docs/quickstart/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.10.4-release-notes/2022-04-17T11:36:55+08:00/cn/docs/performance/api-preformance/hugegraph-api-0.4.4/2023-01-01T16:16:43+08:00/cn/docs/clients/restful-api/vertexlabel/2022-04-17T11:36:55+08:00/cn/docs/contribution-guidelines/validate-release/2023-01-07T14:50:47+08:00/cn/docs/guides/backup-restore/2022-04-17T11:36:55+08:00/cn/docs/config/2022-04-17T11:36:55+08:00/cn/docs/config/config-https/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/edgelabel/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.9.2-release-notes/2022-04-17T11:36:55+08:00/cn/docs/performance/api-preformance/hugegraph-api-0.2/2023-01-01T16:16:43+08:00/cn/docs/quickstart/hugegraph-hubble/2023-01-01T16:16:43+08:00/cn/docs/clients/2022-04-17T11:36:55+08:00/cn/docs/config/config-computer/2023-01-01T16:16:43+08:00/cn/docs/guides/faq/2023-01-04T22:59:07+08:00/cn/docs/clients/restful-api/indexlabel/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.8.0-release-notes/2022-04-17T11:36:55+08:00/cn/docs/quickstart/hugegraph-client/2023-01-01T16:16:43+08:00/cn/docs/guides/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/rebuild/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.7.4-release-notes/2022-04-17T11:36:55+08:00/cn/docs/quickstart/hugegraph-computer/2023-01-01T16:16:43+08:00/cn/docs/language/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.6.1-release-notes/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/vertex/2022-09-15T15:16:23+08:00/cn/docs/clients/restful-api/edge/2022-09-15T15:16:23+08:00/cn/docs/performance/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.5.6-release-notes/2022-04-17T11:36:55+08:00/cn/docs/changelog/2022-04-17T11:36:55+08:00/cn/docs/contribution-guidelines/2022-12-30T19:57:48+08:00/cn/docs/changelog/hugegraph-0.4.4-release-notes/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/traverser/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/rank/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.3.3-release-notes/2022-04-17T11:36:55+08:00/cn/docs/changelog/hugegraph-0.2-release-notes/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/variable/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/graphs/2022-05-27T09:27:37+08:00/cn/docs/changelog/hugegraph-0.2.4-release-notes/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/task/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/gremlin/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/auth/2022-04-17T11:36:55+08:00/cn/docs/clients/restful-api/other/2022-04-17T11:36:55+08:00/cn/docs/2022-12-30T19:57:48+08:00/cn/blog/news/2022-04-17T11:36:55+08:00/cn/blog/releases/2022-04-17T11:36:55+08:00/cn/blog/2018/10/06/easy-documentation-with-docsy/2022-04-17T11:36:55+08:00/cn/blog/2018/10/06/the-second-blog-post/2022-04-17T11:36:55+08:00/cn/blog/2018/01/04/another-great-release/2022-04-17T11:36:55+08:00/cn/docs/cla/2022-04-17T11:36:55+08:00/cn/docs/performance/hugegraph-benchmark-0.4.4/2022-09-15T15:16:23+08:00/cn/docs/summary/2022-11-27T21:05:55+08:00/cn/blog/2022-04-17T11:36:55+08:00/cn/categories//cn/community/2022-04-17T11:36:55+08:00/cn/2023-01-04T22:59:07+08:00/cn/search/2022-04-17T11:36:55+08:00/cn/tags/ \ No newline at end of file diff --git a/docs/_print/index.html b/docs/_print/index.html index 6044a20ad..65adf48c3 100644 --- a/docs/_print/index.html +++ b/docs/_print/index.html @@ -6489,8 +6489,7 @@ # | %23 & | %26 = | %3D -
  • 查询某一类别的顶点或边(query by label)时提示超时

    由于属于某一label的数据量可能比较多,请加上limit限制。

  • 通过RESTful API操作图是可以的,但是发送Gremlin语句就报错:Request Failed(500)

    可能是GremlinServer的配置有误,检查gremlin-server.yamlhostport是否与rest-server.propertiesgremlinserver.url匹配,如不匹配则修改,然后重启服务。

  • 使用Loader导数据出现Socket Timeout异常,然后导致Loader中断

    持续地导入数据会使Server的压力过大,然后导致有些请求超时。可以通过调整Loader的参数来适当缓解Server压力(如:重试次数,重试间隔,错误容忍数等),降低该问题出现频率。

  • 如何删除全部的顶点和边,RESTful API中没有这样的接口,调用gremling.V().drop()会报错Vertices in transaction have reached capacity xxx

    目前确实没有好办法删除全部的数据,用户如果是自己部署的Server和后端,可以直接清空数据库,重启Server。可以使用paging API或scan API先获取所有数据,再逐条删除。

  • 清空了数据库,并且执行了init-store,但是添加schema时提示"xxx has existed"

    HugeGraphServer内是有缓存的,清空数据库的同时是需要重启Server的,否则残留的缓存会产生不一致。

  • 插入顶点或边的过程中报错:Id max length is 128, but got xxx {yyy}Big id max length is 32768, but got xxx

    为了保证查询性能,目前的后端存储对id列的长度做了限制,顶点id不能超过128字节,边id长度不能超过32768字节,索引id不能超过128字节。

  • 是否支持嵌套属性,如果不支持,是否有什么替代方案

    嵌套属性目前暂不支持。替代方案:可以把嵌套属性作为单独的顶点拿出来,然后用边连接起来。

  • 一个EdgeLabel是否可以连接多对VertexLabel,比如"投资"关系,可以是"个人"投资"企业",也可以是"企业"投资"企业"

    一个EdgeLabel不支持连接多对VertexLabel,需要用户将EdgeLabel拆分得更细一点,如:“个人投资”,“企业投资”。

  • 通过RestAPI发送请求时提示HTTP 415 Unsupported Media Type

    请求头中需要指定Content-Type:application/json

  • 其他问题可以在对应项目的 issue 区搜索,例如 Server-Issues / Loader Issues

    7 - QUERY LANGUAGE

    7.1 - HugeGraph Gremlin

    概述

    HugeGraph支持Apache TinkerPop3的图形遍历查询语言Gremlin。 SQL是关系型数据库查询语言,而Gremlin是一种通用的图数据库查询语言,Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,也可执行图的查询操作。

    Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,更主要的是可用于执行图的查询及分析操作。

    TinkerPop Features

    HugeGraph实现了TinkerPop框架,但是并没有实现TinkerPop所有的特性。

    下表列出HugeGraph对TinkerPop各种特性的支持情况:

    Graph Features

    NameDescriptionSupport
    ComputerDetermines if the {@code Graph} implementation supports {@link GraphComputer} based processingfalse
    TransactionsDetermines if the {@code Graph} implementations supports transactions.true
    PersistenceDetermines if the {@code Graph} implementation supports persisting it’s contents natively to disk.This feature does not refer to every graph’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.true
    ThreadedTransactionsDetermines if the {@code Graph} implementation supports threaded transactions which allow a transaction be executed across multiple threads via {@link Transaction#createThreadedTx()}.false
    ConcurrentAccessDetermines 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.false

    Vertex Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddVerticesDetermines if a {@link Vertex} can be added to the {@code Graph}.true
    MultiPropertiesDetermines if a {@link Vertex} can support multiple properties with the same key.false
    DuplicateMultiPropertiesDetermines 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.false
    MetaPropertiesDetermines 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.false
    RemoveVerticesDetermines if a {@link Vertex} can be removed from the {@code Graph}.true

    Edge Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddEdgesDetermines if an {@link Edge} can be added to a {@code Vertex}.true
    RemoveEdgesDetermines if an {@link Edge} can be removed from a {@code Vertex}.true

    Data Type Features

    NameDescriptionSupport
    BooleanValuestrue
    ByteValuestrue
    DoubleValuestrue
    FloatValuestrue
    IntegerValuestrue
    LongValuestrue
    MapValuesSupports 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 itselffalse
    MixedListValuesSupports 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 “mixed” it does not need to contain objects of the same type.false
    BooleanArrayValuesfalse
    ByteArrayValuestrue
    DoubleArrayValuesfalse
    FloatArrayValuesfalse
    IntegerArrayValuesfalse
    LongArrayValuesfalse
    SerializableValuesfalse
    StringArrayValuesfalse
    StringValuestrue
    UniformListValuesSupports 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 “uniform” it must contain objects of the same type.false

    Gremlin的步骤

    HugeGraph支持Gremlin的所有步骤。有关Gremlin的完整参考信息,请参与Gremlin官网

    步骤说明文档
    addE在两个顶点之间添加边addE step
    addV将顶点添加到图形addV step
    and确保所有遍历都返回值and step
    as用于向步骤的输出分配变量的步骤调制器as step
    bygrouporder配合使用的步骤调制器by step
    coalesce返回第一个返回结果的遍历coalesce step
    constant返回常量值。 与coalesce配合使用constant step
    count从遍历返回计数count step
    dedup返回已删除重复内容的值dedup step
    drop丢弃值(顶点/边缘)drop step
    fold充当用于计算结果聚合值的屏障fold step
    group根据指定的标签将值分组group step
    has用于筛选属性、顶点和边缘。 支持hasLabelhasIdhasNothas 变体has step
    inject将值注入流中inject step
    is用于通过布尔表达式执行筛选器is step
    limit用于限制遍历中的项数limit step
    local本地包装遍历的某个部分,类似于子查询local step
    not用于生成筛选器的求反结果not step
    optional如果生成了某个结果,则返回指定遍历的结果,否则返回调用元素optional step
    or确保至少有一个遍历会返回值or step
    order按指定的排序顺序返回结果order step
    path返回遍历的完整路径path step
    project将属性投影为映射project step
    properties返回指定标签的属性properties step
    range根据指定的值范围进行筛选range step
    repeat将步骤重复指定的次数。 用于循环repeat step
    sample用于对遍历返回的结果采样sample step
    select用于投影遍历返回的结果select step
    store用于遍历返回的非阻塞聚合store step
    tree将顶点中的路径聚合到树中tree step
    unfold将迭代器作为步骤展开unfold step
    union合并多个遍历返回的结果union step
    V包括顶点与边之间的遍历所需的步骤:VEoutinbothoutEinEbothEoutVinVbothVotherVorder step
    where用于筛选遍历返回的结果。 支持 eqneqltltegtgtebetween 运算符where step

    7.2 - HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持[Gremlin](https://tinkerpop.apache -.org/gremlin.html)图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    schema = hugegraph.schema()
    +
  • 查询某一类别的顶点或边(query by label)时提示超时

    由于属于某一label的数据量可能比较多,请加上limit限制。

  • 通过RESTful API操作图是可以的,但是发送Gremlin语句就报错:Request Failed(500)

    可能是GremlinServer的配置有误,检查gremlin-server.yamlhostport是否与rest-server.propertiesgremlinserver.url匹配,如不匹配则修改,然后重启服务。

  • 使用Loader导数据出现Socket Timeout异常,然后导致Loader中断

    持续地导入数据会使Server的压力过大,然后导致有些请求超时。可以通过调整Loader的参数来适当缓解Server压力(如:重试次数,重试间隔,错误容忍数等),降低该问题出现频率。

  • 如何删除全部的顶点和边,RESTful API中没有这样的接口,调用gremling.V().drop()会报错Vertices in transaction have reached capacity xxx

    目前确实没有好办法删除全部的数据,用户如果是自己部署的Server和后端,可以直接清空数据库,重启Server。可以使用paging API或scan API先获取所有数据,再逐条删除。

  • 清空了数据库,并且执行了init-store,但是添加schema时提示"xxx has existed"

    HugeGraphServer内是有缓存的,清空数据库的同时是需要重启Server的,否则残留的缓存会产生不一致。

  • 插入顶点或边的过程中报错:Id max length is 128, but got xxx {yyy}Big id max length is 32768, but got xxx

    为了保证查询性能,目前的后端存储对id列的长度做了限制,顶点id不能超过128字节,边id长度不能超过32768字节,索引id不能超过128字节。

  • 是否支持嵌套属性,如果不支持,是否有什么替代方案

    嵌套属性目前暂不支持。替代方案:可以把嵌套属性作为单独的顶点拿出来,然后用边连接起来。

  • 一个EdgeLabel是否可以连接多对VertexLabel,比如"投资"关系,可以是"个人"投资"企业",也可以是"企业"投资"企业"

    一个EdgeLabel不支持连接多对VertexLabel,需要用户将EdgeLabel拆分得更细一点,如:“个人投资”,“企业投资”。

  • 通过RestAPI发送请求时提示HTTP 415 Unsupported Media Type

    请求头中需要指定Content-Type:application/json

  • 其他问题可以在对应项目的 issue 区搜索,例如 Server-Issues / Loader Issues

    7 - QUERY LANGUAGE

    7.1 - HugeGraph Gremlin

    概述

    HugeGraph支持Apache TinkerPop3的图形遍历查询语言Gremlin。 SQL是关系型数据库查询语言,而Gremlin是一种通用的图数据库查询语言,Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,也可执行图的查询操作。

    Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,更主要的是可用于执行图的查询及分析操作。

    TinkerPop Features

    HugeGraph实现了TinkerPop框架,但是并没有实现TinkerPop所有的特性。

    下表列出HugeGraph对TinkerPop各种特性的支持情况:

    Graph Features

    NameDescriptionSupport
    ComputerDetermines if the {@code Graph} implementation supports {@link GraphComputer} based processingfalse
    TransactionsDetermines if the {@code Graph} implementations supports transactions.true
    PersistenceDetermines if the {@code Graph} implementation supports persisting it’s contents natively to disk.This feature does not refer to every graph’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.true
    ThreadedTransactionsDetermines if the {@code Graph} implementation supports threaded transactions which allow a transaction be executed across multiple threads via {@link Transaction#createThreadedTx()}.false
    ConcurrentAccessDetermines 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.false

    Vertex Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddVerticesDetermines if a {@link Vertex} can be added to the {@code Graph}.true
    MultiPropertiesDetermines if a {@link Vertex} can support multiple properties with the same key.false
    DuplicateMultiPropertiesDetermines 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.false
    MetaPropertiesDetermines 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.false
    RemoveVerticesDetermines if a {@link Vertex} can be removed from the {@code Graph}.true

    Edge Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddEdgesDetermines if an {@link Edge} can be added to a {@code Vertex}.true
    RemoveEdgesDetermines if an {@link Edge} can be removed from a {@code Vertex}.true

    Data Type Features

    NameDescriptionSupport
    BooleanValuestrue
    ByteValuestrue
    DoubleValuestrue
    FloatValuestrue
    IntegerValuestrue
    LongValuestrue
    MapValuesSupports 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 itselffalse
    MixedListValuesSupports 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 “mixed” it does not need to contain objects of the same type.false
    BooleanArrayValuesfalse
    ByteArrayValuestrue
    DoubleArrayValuesfalse
    FloatArrayValuesfalse
    IntegerArrayValuesfalse
    LongArrayValuesfalse
    SerializableValuesfalse
    StringArrayValuesfalse
    StringValuestrue
    UniformListValuesSupports 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 “uniform” it must contain objects of the same type.false

    Gremlin的步骤

    HugeGraph支持Gremlin的所有步骤。有关Gremlin的完整参考信息,请参与Gremlin官网

    步骤说明文档
    addE在两个顶点之间添加边addE step
    addV将顶点添加到图形addV step
    and确保所有遍历都返回值and step
    as用于向步骤的输出分配变量的步骤调制器as step
    bygrouporder配合使用的步骤调制器by step
    coalesce返回第一个返回结果的遍历coalesce step
    constant返回常量值。 与coalesce配合使用constant step
    count从遍历返回计数count step
    dedup返回已删除重复内容的值dedup step
    drop丢弃值(顶点/边缘)drop step
    fold充当用于计算结果聚合值的屏障fold step
    group根据指定的标签将值分组group step
    has用于筛选属性、顶点和边缘。 支持hasLabelhasIdhasNothas 变体has step
    inject将值注入流中inject step
    is用于通过布尔表达式执行筛选器is step
    limit用于限制遍历中的项数limit step
    local本地包装遍历的某个部分,类似于子查询local step
    not用于生成筛选器的求反结果not step
    optional如果生成了某个结果,则返回指定遍历的结果,否则返回调用元素optional step
    or确保至少有一个遍历会返回值or step
    order按指定的排序顺序返回结果order step
    path返回遍历的完整路径path step
    project将属性投影为映射project step
    properties返回指定标签的属性properties step
    range根据指定的值范围进行筛选range step
    repeat将步骤重复指定的次数。 用于循环repeat step
    sample用于对遍历返回的结果采样sample step
    select用于投影遍历返回的结果select step
    store用于遍历返回的非阻塞聚合store step
    tree将顶点中的路径聚合到树中tree step
    unfold将迭代器作为步骤展开unfold step
    union合并多个遍历返回的结果union step
    V包括顶点与边之间的遍历所需的步骤:VEoutinbothoutEinEbothEoutVinVbothVotherVorder step
    where用于筛选遍历返回的结果。 支持 eqneqltltegtgtebetween 运算符where step

    7.2 - HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持Gremlin图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    schema = hugegraph.schema()
     
     schema.propertyKey("name").asText().ifNotExist().create()
     schema.propertyKey("age").asInt().ifNotExist().create()
    diff --git a/docs/index.xml b/docs/index.xml
    index ea7c67653..798caca5b 100644
    --- a/docs/index.xml
    +++ b/docs/index.xml
    @@ -3786,8 +3786,7 @@ HugeGraph目前采用EdgeCut的分区方案。</p>
     <h3 id="1-概述">1 概述</h3>
     <p>本示例将<a href="http://s3.thinkaurelius.com/docs/titan/1.0.0/getting-started.html">TitanDB Getting Started</a> 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。</p>
     <h4 id="11-hugegraph与titandb的异同">1.1 HugeGraph与TitanDB的异同</h4>
    -<p>HugeGraph和TitanDB都是基于<a href="https://tinkerpop.apache.org">Apache TinkerPop3</a>框架的图数据库,均支持[Gremlin](<a href="https://tinkerpop.apache">https://tinkerpop.apache</a>
    -.org/gremlin.html)图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。</p>
    +<p>HugeGraph和TitanDB都是基于<a href="https://tinkerpop.apache.org">Apache TinkerPop3</a>框架的图数据库,均支持<a href="https://tinkerpop.apache.org/gremlin.html">Gremlin</a>图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。</p>
     <p>HugeGraph相对于TitanDB而言,其主要特点如下:</p>
     <ul>
     <li>HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;</li>
    diff --git a/docs/language/_print/index.html b/docs/language/_print/index.html
    index 5a1475ff9..6151ef515 100644
    --- a/docs/language/_print/index.html
    +++ b/docs/language/_print/index.html
    @@ -1,7 +1,6 @@
     QUERY LANGUAGE | HugeGraph
     

    This is the multi-page printable view of this section. -Click here to print.

    Return to the regular view of this page.

    QUERY LANGUAGE

    1 - HugeGraph Gremlin

    概述

    HugeGraph支持Apache TinkerPop3的图形遍历查询语言Gremlin。 SQL是关系型数据库查询语言,而Gremlin是一种通用的图数据库查询语言,Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,也可执行图的查询操作。

    Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,更主要的是可用于执行图的查询及分析操作。

    TinkerPop Features

    HugeGraph实现了TinkerPop框架,但是并没有实现TinkerPop所有的特性。

    下表列出HugeGraph对TinkerPop各种特性的支持情况:

    Graph Features

    NameDescriptionSupport
    ComputerDetermines if the {@code Graph} implementation supports {@link GraphComputer} based processingfalse
    TransactionsDetermines if the {@code Graph} implementations supports transactions.true
    PersistenceDetermines if the {@code Graph} implementation supports persisting it’s contents natively to disk.This feature does not refer to every graph’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.true
    ThreadedTransactionsDetermines if the {@code Graph} implementation supports threaded transactions which allow a transaction be executed across multiple threads via {@link Transaction#createThreadedTx()}.false
    ConcurrentAccessDetermines 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.false

    Vertex Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddVerticesDetermines if a {@link Vertex} can be added to the {@code Graph}.true
    MultiPropertiesDetermines if a {@link Vertex} can support multiple properties with the same key.false
    DuplicateMultiPropertiesDetermines 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.false
    MetaPropertiesDetermines 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.false
    RemoveVerticesDetermines if a {@link Vertex} can be removed from the {@code Graph}.true

    Edge Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddEdgesDetermines if an {@link Edge} can be added to a {@code Vertex}.true
    RemoveEdgesDetermines if an {@link Edge} can be removed from a {@code Vertex}.true

    Data Type Features

    NameDescriptionSupport
    BooleanValuestrue
    ByteValuestrue
    DoubleValuestrue
    FloatValuestrue
    IntegerValuestrue
    LongValuestrue
    MapValuesSupports 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 itselffalse
    MixedListValuesSupports 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 “mixed” it does not need to contain objects of the same type.false
    BooleanArrayValuesfalse
    ByteArrayValuestrue
    DoubleArrayValuesfalse
    FloatArrayValuesfalse
    IntegerArrayValuesfalse
    LongArrayValuesfalse
    SerializableValuesfalse
    StringArrayValuesfalse
    StringValuestrue
    UniformListValuesSupports 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 “uniform” it must contain objects of the same type.false

    Gremlin的步骤

    HugeGraph支持Gremlin的所有步骤。有关Gremlin的完整参考信息,请参与Gremlin官网

    步骤说明文档
    addE在两个顶点之间添加边addE step
    addV将顶点添加到图形addV step
    and确保所有遍历都返回值and step
    as用于向步骤的输出分配变量的步骤调制器as step
    bygrouporder配合使用的步骤调制器by step
    coalesce返回第一个返回结果的遍历coalesce step
    constant返回常量值。 与coalesce配合使用constant step
    count从遍历返回计数count step
    dedup返回已删除重复内容的值dedup step
    drop丢弃值(顶点/边缘)drop step
    fold充当用于计算结果聚合值的屏障fold step
    group根据指定的标签将值分组group step
    has用于筛选属性、顶点和边缘。 支持hasLabelhasIdhasNothas 变体has step
    inject将值注入流中inject step
    is用于通过布尔表达式执行筛选器is step
    limit用于限制遍历中的项数limit step
    local本地包装遍历的某个部分,类似于子查询local step
    not用于生成筛选器的求反结果not step
    optional如果生成了某个结果,则返回指定遍历的结果,否则返回调用元素optional step
    or确保至少有一个遍历会返回值or step
    order按指定的排序顺序返回结果order step
    path返回遍历的完整路径path step
    project将属性投影为映射project step
    properties返回指定标签的属性properties step
    range根据指定的值范围进行筛选range step
    repeat将步骤重复指定的次数。 用于循环repeat step
    sample用于对遍历返回的结果采样sample step
    select用于投影遍历返回的结果select step
    store用于遍历返回的非阻塞聚合store step
    tree将顶点中的路径聚合到树中tree step
    unfold将迭代器作为步骤展开unfold step
    union合并多个遍历返回的结果union step
    V包括顶点与边之间的遍历所需的步骤:VEoutinbothoutEinEbothEoutVinVbothVotherVorder step
    where用于筛选遍历返回的结果。 支持 eqneqltltegtgtebetween 运算符where step

    2 - HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持[Gremlin](https://tinkerpop.apache -.org/gremlin.html)图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    • HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;
    • HugeGraph具有Server和Client的概念,第三方系统可以通过jar引用、client、api等多种方式接入,而TitanDB仅支持jar引用方式接入。
    • HugeGraph的Schema需要显式定义,所有的插入和查询均需要通过严格的schema校验,目前暂不支持schema的隐式创建。
    • HugeGraph充分利用后端存储系统的特点来实现数据高效存取,而TitanDB以统一的Kv结构无视后端的差异性。
    • HugeGraph的更新操作可以实现按需操作(例如:更新某个属性)性能更好。TitanDB的更新是read and update方式。
    • HugeGraph的VertexId和EdgeId均支持拼接,可实现自动去重,同时查询性能更好。TitanDB的所有Id均是自动生成,查询需要经索引。

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    QUERY LANGUAGE

    1 - HugeGraph Gremlin

    概述

    HugeGraph支持Apache TinkerPop3的图形遍历查询语言Gremlin。 SQL是关系型数据库查询语言,而Gremlin是一种通用的图数据库查询语言,Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,也可执行图的查询操作。

    Gremlin可用于创建图的实体(Vertex和Edge)、修改实体内部属性、删除实体,更主要的是可用于执行图的查询及分析操作。

    TinkerPop Features

    HugeGraph实现了TinkerPop框架,但是并没有实现TinkerPop所有的特性。

    下表列出HugeGraph对TinkerPop各种特性的支持情况:

    Graph Features

    NameDescriptionSupport
    ComputerDetermines if the {@code Graph} implementation supports {@link GraphComputer} based processingfalse
    TransactionsDetermines if the {@code Graph} implementations supports transactions.true
    PersistenceDetermines if the {@code Graph} implementation supports persisting it’s contents natively to disk.This feature does not refer to every graph’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.true
    ThreadedTransactionsDetermines if the {@code Graph} implementation supports threaded transactions which allow a transaction be executed across multiple threads via {@link Transaction#createThreadedTx()}.false
    ConcurrentAccessDetermines 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.false

    Vertex Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddVerticesDetermines if a {@link Vertex} can be added to the {@code Graph}.true
    MultiPropertiesDetermines if a {@link Vertex} can support multiple properties with the same key.false
    DuplicateMultiPropertiesDetermines 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.false
    MetaPropertiesDetermines 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.false
    RemoveVerticesDetermines if a {@link Vertex} can be removed from the {@code Graph}.true

    Edge Features

    NameDescriptionSupport
    UserSuppliedIdsDetermines 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.false
    NumericIdsDetermines 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.false
    StringIdsDetermines 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.false
    UuidIdsDetermines 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.false
    CustomIdsDetermines 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’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.false
    AnyIdsDetermines 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}.false
    AddPropertyDetermines if an {@link Element} allows properties to be added. This feature is set independently from supporting “data types” and refers to support of calls to {@link Element#property(String, Object)}.true
    RemovePropertyDetermines if an {@link Element} allows properties to be removed.true
    AddEdgesDetermines if an {@link Edge} can be added to a {@code Vertex}.true
    RemoveEdgesDetermines if an {@link Edge} can be removed from a {@code Vertex}.true

    Data Type Features

    NameDescriptionSupport
    BooleanValuestrue
    ByteValuestrue
    DoubleValuestrue
    FloatValuestrue
    IntegerValuestrue
    LongValuestrue
    MapValuesSupports 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 itselffalse
    MixedListValuesSupports 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 “mixed” it does not need to contain objects of the same type.false
    BooleanArrayValuesfalse
    ByteArrayValuestrue
    DoubleArrayValuesfalse
    FloatArrayValuesfalse
    IntegerArrayValuesfalse
    LongArrayValuesfalse
    SerializableValuesfalse
    StringArrayValuesfalse
    StringValuestrue
    UniformListValuesSupports 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 “uniform” it must contain objects of the same type.false

    Gremlin的步骤

    HugeGraph支持Gremlin的所有步骤。有关Gremlin的完整参考信息,请参与Gremlin官网

    步骤说明文档
    addE在两个顶点之间添加边addE step
    addV将顶点添加到图形addV step
    and确保所有遍历都返回值and step
    as用于向步骤的输出分配变量的步骤调制器as step
    bygrouporder配合使用的步骤调制器by step
    coalesce返回第一个返回结果的遍历coalesce step
    constant返回常量值。 与coalesce配合使用constant step
    count从遍历返回计数count step
    dedup返回已删除重复内容的值dedup step
    drop丢弃值(顶点/边缘)drop step
    fold充当用于计算结果聚合值的屏障fold step
    group根据指定的标签将值分组group step
    has用于筛选属性、顶点和边缘。 支持hasLabelhasIdhasNothas 变体has step
    inject将值注入流中inject step
    is用于通过布尔表达式执行筛选器is step
    limit用于限制遍历中的项数limit step
    local本地包装遍历的某个部分,类似于子查询local step
    not用于生成筛选器的求反结果not step
    optional如果生成了某个结果,则返回指定遍历的结果,否则返回调用元素optional step
    or确保至少有一个遍历会返回值or step
    order按指定的排序顺序返回结果order step
    path返回遍历的完整路径path step
    project将属性投影为映射project step
    properties返回指定标签的属性properties step
    range根据指定的值范围进行筛选range step
    repeat将步骤重复指定的次数。 用于循环repeat step
    sample用于对遍历返回的结果采样sample step
    select用于投影遍历返回的结果select step
    store用于遍历返回的非阻塞聚合store step
    tree将顶点中的路径聚合到树中tree step
    unfold将迭代器作为步骤展开unfold step
    union合并多个遍历返回的结果union step
    V包括顶点与边之间的遍历所需的步骤:VEoutinbothoutEinEbothEoutVinVbothVotherVorder step
    where用于筛选遍历返回的结果。 支持 eqneqltltegtgtebetween 运算符where step

    2 - HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持Gremlin图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    • HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;
    • HugeGraph具有Server和Client的概念,第三方系统可以通过jar引用、client、api等多种方式接入,而TitanDB仅支持jar引用方式接入。
    • HugeGraph的Schema需要显式定义,所有的插入和查询均需要通过严格的schema校验,目前暂不支持schema的隐式创建。
    • HugeGraph充分利用后端存储系统的特点来实现数据高效存取,而TitanDB以统一的Kv结构无视后端的差异性。
    • HugeGraph的更新操作可以实现按需操作(例如:更新某个属性)性能更好。TitanDB的更新是read and update方式。
    • HugeGraph的VertexId和EdgeId均支持拼接,可实现自动去重,同时查询性能更好。TitanDB的所有Id均是自动生成,查询需要经索引。

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    schema = hugegraph.schema()
     
     schema.propertyKey("name").asText().ifNotExist().create()
     schema.propertyKey("age").asInt().ifNotExist().create()
    diff --git a/docs/language/hugegraph-example/index.html b/docs/language/hugegraph-example/index.html
    index 0b6f3b4eb..a48c1ae19 100644
    --- a/docs/language/hugegraph-example/index.html
    +++ b/docs/language/hugegraph-example/index.html
    @@ -2,21 +2,21 @@
     本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。
     1.1 HugeGraph与TitanDB的异同
     HugeGraph和TitanDB …"> Create child page
      Create documentation issue
      Create project issue
    - Print entire section

    HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持[Gremlin](https://tinkerpop.apache -.org/gremlin.html)图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    • HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;
    • HugeGraph具有Server和Client的概念,第三方系统可以通过jar引用、client、api等多种方式接入,而TitanDB仅支持jar引用方式接入。
    • HugeGraph的Schema需要显式定义,所有的插入和查询均需要通过严格的schema校验,目前暂不支持schema的隐式创建。
    • HugeGraph充分利用后端存储系统的特点来实现数据高效存取,而TitanDB以统一的Kv结构无视后端的差异性。
    • HugeGraph的更新操作可以实现按需操作(例如:更新某个属性)性能更好。TitanDB的更新是read and update方式。
    • HugeGraph的VertexId和EdgeId均支持拼接,可实现自动去重,同时查询性能更好。TitanDB的所有Id均是自动生成,查询需要经索引。

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    schema = hugegraph.schema()
    + Print entire section

    HugeGraph Examples

    1 概述

    本示例将TitanDB Getting Started 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。

    1.1 HugeGraph与TitanDB的异同

    HugeGraph和TitanDB都是基于Apache TinkerPop3框架的图数据库,均支持Gremlin图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。

    HugeGraph相对于TitanDB而言,其主要特点如下:

    • HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;
    • HugeGraph具有Server和Client的概念,第三方系统可以通过jar引用、client、api等多种方式接入,而TitanDB仅支持jar引用方式接入。
    • HugeGraph的Schema需要显式定义,所有的插入和查询均需要通过严格的schema校验,目前暂不支持schema的隐式创建。
    • HugeGraph充分利用后端存储系统的特点来实现数据高效存取,而TitanDB以统一的Kv结构无视后端的差异性。
    • HugeGraph的更新操作可以实现按需操作(例如:更新某个属性)性能更好。TitanDB的更新是read and update方式。
    • HugeGraph的VertexId和EdgeId均支持拼接,可实现自动去重,同时查询性能更好。TitanDB的所有Id均是自动生成,查询需要经索引。

    1.2 人物关系图谱

    本示例通过Property Graph Model图数据模型来描述希腊神话中各人物角色的关系(也被成为人物关系图谱),具体关系详见下图。

    image

    其中,圆形节点代表实体(Vertex),箭头代表关系(Edge),方框的内容为属性。

    该关系图谱中有两类顶点,分别是人物(character)和位置(location)如下表:

    名称类型属性
    charactervertexname,age,type
    locationvertexname

    有六种关系,分别是父子(father)、母子(mother)、兄弟(brother)、战斗(battled)、居住(lives)、拥有宠物(pet) 关于关系图谱的具体信息如下:

    名称类型source vertex labeltarget vertex label属性
    fatheredgecharactercharacter-
    motheredgecharactercharacter-
    brotheredgecharactercharacter-
    petedgecharactercharacter-
    livesedgecharacterlocationreason

    在HugeGraph中,每个edge label只能作用于一对source vertex label和target vertex label。也就是说,如果一个图内定义了一种关系father连接character和character,那farther就不能再连接其他的vertex labels。

    因此本例子将原TitanDB中的monster, god, human, demigod均使用相同的vertex label: character来表示, 同时增加属性type来标识人物的类型。edge label与原TitanDB保持一致。当然为了满足edge label约束,也可以通过调整edge labelname来实现。

    2 Graph Schema and Data Ingest Examples

    HugeGraph需要显示创建Schema,因此需要依次创建PropertyKey、VertexLabel、EdgeLabel,如果有需要索引还需要创建IndexLabel。

    2.1 Graph Schema

    schema = hugegraph.schema()
     
     schema.propertyKey("name").asText().ifNotExist().create()
     schema.propertyKey("age").asInt().ifNotExist().create()
    @@ -97,7 +96,7 @@
     
     // what is the name of the brother and the name of the place?
     g.V(pluto).out('brother').as('god').out('lives').as('place').select('god','place').by('name')
    -

    推荐使用HugeGraph-Studio 通过可视化的方式来执行上述代码。另外也可以通过HugeGraph-Client、HugeApi、GremlinConsole和GremlinDriver等多种方式执行上述代码。

    3.2 总结

    HugeGraph 目前支持 Gremlin 的语法,用户可以通过 Gremlin / REST-API 实现各种查询需求。


    Last modified January 1, 2023: enhance validate doc (#171) (89a0a1a6)
    +

    推荐使用HugeGraph-Studio 通过可视化的方式来执行上述代码。另外也可以通过HugeGraph-Client、HugeApi、GremlinConsole和GremlinDriver等多种方式执行上述代码。

    3.2 总结

    HugeGraph 目前支持 Gremlin 的语法,用户可以通过 Gremlin / REST-API 实现各种查询需求。


    diff --git a/docs/language/index.xml b/docs/language/index.xml index d03e97a64..38f9dff7b 100644 --- a/docs/language/index.xml +++ b/docs/language/index.xml @@ -469,8 +469,7 @@ <h3 id="1-概述">1 概述</h3> <p>本示例将<a href="http://s3.thinkaurelius.com/docs/titan/1.0.0/getting-started.html">TitanDB Getting Started</a> 为模板来演示HugeGraph的使用方法。通过对比HugeGraph和TitanDB,了解HugeGraph和TitanDB的差异。</p> <h4 id="11-hugegraph与titandb的异同">1.1 HugeGraph与TitanDB的异同</h4> -<p>HugeGraph和TitanDB都是基于<a href="https://tinkerpop.apache.org">Apache TinkerPop3</a>框架的图数据库,均支持[Gremlin](<a href="https://tinkerpop.apache">https://tinkerpop.apache</a> -.org/gremlin.html)图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。</p> +<p>HugeGraph和TitanDB都是基于<a href="https://tinkerpop.apache.org">Apache TinkerPop3</a>框架的图数据库,均支持<a href="https://tinkerpop.apache.org/gremlin.html">Gremlin</a>图查询语言,在使用方法和接口方面具有很多相似的地方。然而HugeGraph是全新设计开发的,其代码结构清晰,功能较为丰富,接口更为友好等特点。</p> <p>HugeGraph相对于TitanDB而言,其主要特点如下:</p> <ul> <li>HugeGraph目前有HugeGraph-API、HugeGraph-Client、HugeGraph-Loader、HugeGraph-Studio、HugeGraph-Spark等完善的工具组件,可以完成系统集成、数据载入、图可视化查询、Spark 连接等功能;</li> diff --git a/en/index.html b/en/index.html index 2b6417980..017c4d50b 100644 --- a/en/index.html +++ b/en/index.html @@ -1 +1 @@ -/ \ No newline at end of file +/ \ No newline at end of file diff --git a/en/sitemap.xml b/en/sitemap.xml index 4beeea4ed..bc053f670 100644 --- a/en/sitemap.xml +++ b/en/sitemap.xml @@ -1 +1 @@ -/docs/guides/architectural/2022-11-27T21:05:55+08:00/docs/config/config-guide/2022-04-17T11:36:55+08:00/docs/language/hugegraph-gremlin/2023-01-01T16:16:43+08:00/docs/contribution-guidelines/contribute/2023-01-04T22:59:07+08:00/docs/performance/hugegraph-benchmark-0.5.6/2022-09-15T12:59:59+08:00/docs/quickstart/hugegraph-server/2023-01-01T16:16:43+08:00/docs/introduction/readme/2022-11-27T21:44:37+08:00/docs/changelog/hugegraph-1.0.0-release-notes/2023-01-09T07:41:46+08:00/docs/clients/restful-api/2022-04-17T11:36:55+08:00/docs/clients/restful-api/schema/2022-04-17T11:36:55+08:00/docs/performance/api-preformance/hugegraph-api-0.5.6-rocksdb/2022-04-17T11:36:55+08:00/docs/config/config-option/2023-01-01T16:16:43+08:00/docs/guides/desgin-concept/2022-04-17T11:36:55+08:00/docs/download/download/2023-01-01T22:24:37+08:00/docs/language/hugegraph-example/2023-01-01T16:16:43+08:00/docs/clients/hugegraph-client/2023-01-01T16:16:43+08:00/docs/performance/api-preformance/2022-04-17T11:36:55+08:00/docs/quickstart/hugegraph-loader/2023-01-04T22:59:07+08:00/docs/clients/restful-api/propertykey/2022-05-12T21:24:05+08:00/docs/changelog/hugegraph-0.12.0-release-notes/2023-01-01T16:16:43+08:00/docs/contribution-guidelines/subscribe/2022-09-15T12:59:59+08:00/docs/performance/api-preformance/hugegraph-api-0.5.6-cassandra/2022-04-17T11:36:55+08:00/docs/config/config-authentication/2022-04-17T11:36:55+08:00/docs/clients/gremlin-console/2022-05-25T21:16:41+08:00/docs/guides/custom-plugin/2022-09-15T12:59:59+08:00/docs/performance/hugegraph-loader-performance/2022-04-17T11:36:55+08:00/docs/quickstart/hugegraph-tools/2023-01-04T22:59:07+08:00/docs/quickstart/2022-04-17T11:36:55+08:00/docs/performance/api-preformance/hugegraph-api-0.4.4/2022-04-17T11:36:55+08:00/docs/contribution-guidelines/validate-release/2023-01-07T14:50:47+08:00/docs/clients/restful-api/vertexlabel/2022-04-17T11:36:55+08:00/docs/guides/backup-restore/2022-04-17T11:36:55+08:00/docs/config/2022-04-17T11:36:55+08:00/docs/config/config-https/2022-04-17T11:36:55+08:00/docs/clients/restful-api/edgelabel/2022-04-17T11:36:55+08:00/docs/performance/api-preformance/hugegraph-api-0.2/2022-04-17T11:36:55+08:00/docs/quickstart/hugegraph-hubble/2023-01-04T22:59:07+08:00/docs/clients/2022-04-17T11:36:55+08:00/docs/config/config-computer/2023-01-01T16:16:43+08:00/docs/guides/faq/2023-01-01T16:16:43+08:00/docs/clients/restful-api/indexlabel/2022-04-17T11:36:55+08:00/docs/quickstart/hugegraph-client/2023-01-01T16:16:43+08:00/docs/guides/2022-04-17T11:36:55+08:00/docs/clients/restful-api/rebuild/2022-05-09T18:43:53+08:00/docs/quickstart/hugegraph-computer/2023-01-01T16:16:43+08:00/docs/language/2022-04-17T11:36:55+08:00/docs/clients/restful-api/vertex/2023-01-15T21:47:17+08:00/docs/clients/restful-api/edge/2023-01-15T21:46:48+08:00/docs/performance/2022-04-17T11:36:55+08:00/docs/contribution-guidelines/2022-12-30T19:36:31+08:00/docs/clients/restful-api/traverser/2022-04-17T11:36:55+08:00/docs/changelog/2022-04-28T21:26:41+08:00/docs/clients/restful-api/rank/2022-09-15T12:59:59+08:00/docs/clients/restful-api/variable/2022-04-17T11:36:55+08:00/docs/clients/restful-api/graphs/2022-05-27T09:27:37+08:00/docs/clients/restful-api/task/2022-09-15T12:59:59+08:00/docs/clients/restful-api/gremlin/2022-04-17T11:36:55+08:00/docs/clients/restful-api/auth/2022-04-17T11:36:55+08:00/docs/clients/restful-api/other/2022-04-17T11:36:55+08:00/docs/2022-12-30T19:57:48+08:00/blog/news/2022-03-21T18:55:33+08:00/blog/releases/2022-03-21T18:55:33+08:00/blog/2018/10/06/easy-documentation-with-docsy/2022-03-21T18:55:33+08:00/blog/2018/10/06/the-second-blog-post/2022-03-21T18:55:33+08:00/blog/2018/01/04/another-great-release/2022-03-21T18:55:33+08:00/docs/cla/2022-03-21T19:51:14+08:00/docs/performance/hugegraph-benchmark-0.4.4/2022-09-15T12:59:59+08:00/docs/summary/2022-11-27T21:05:55+08:00/blog/2022-03-21T18:55:33+08:00/categories//community/2022-03-21T18:55:33+08:00/2023-01-15T13:44:01+00:00/search/2022-03-21T18:55:33+08:00/tags/ \ No newline at end of file +/docs/guides/architectural/2022-11-27T21:05:55+08:00/docs/config/config-guide/2022-04-17T11:36:55+08:00/docs/language/hugegraph-gremlin/2023-01-01T16:16:43+08:00/docs/contribution-guidelines/contribute/2023-01-04T22:59:07+08:00/docs/performance/hugegraph-benchmark-0.5.6/2022-09-15T12:59:59+08:00/docs/quickstart/hugegraph-server/2023-01-01T16:16:43+08:00/docs/introduction/readme/2022-11-27T21:44:37+08:00/docs/changelog/hugegraph-1.0.0-release-notes/2023-01-09T07:41:46+08:00/docs/clients/restful-api/2022-04-17T11:36:55+08:00/docs/clients/restful-api/schema/2022-04-17T11:36:55+08:00/docs/performance/api-preformance/hugegraph-api-0.5.6-rocksdb/2022-04-17T11:36:55+08:00/docs/config/config-option/2023-01-01T16:16:43+08:00/docs/guides/desgin-concept/2022-04-17T11:36:55+08:00/docs/download/download/2023-01-01T22:24:37+08:00/docs/language/hugegraph-example/2023-02-02T01:21:10+08:00/docs/clients/hugegraph-client/2023-01-01T16:16:43+08:00/docs/performance/api-preformance/2022-04-17T11:36:55+08:00/docs/quickstart/hugegraph-loader/2023-01-04T22:59:07+08:00/docs/clients/restful-api/propertykey/2022-05-12T21:24:05+08:00/docs/changelog/hugegraph-0.12.0-release-notes/2023-01-01T16:16:43+08:00/docs/contribution-guidelines/subscribe/2022-09-15T12:59:59+08:00/docs/performance/api-preformance/hugegraph-api-0.5.6-cassandra/2022-04-17T11:36:55+08:00/docs/config/config-authentication/2022-04-17T11:36:55+08:00/docs/clients/gremlin-console/2022-05-25T21:16:41+08:00/docs/guides/custom-plugin/2022-09-15T12:59:59+08:00/docs/performance/hugegraph-loader-performance/2022-04-17T11:36:55+08:00/docs/quickstart/hugegraph-tools/2023-01-04T22:59:07+08:00/docs/quickstart/2022-04-17T11:36:55+08:00/docs/performance/api-preformance/hugegraph-api-0.4.4/2022-04-17T11:36:55+08:00/docs/contribution-guidelines/validate-release/2023-01-07T14:50:47+08:00/docs/clients/restful-api/vertexlabel/2022-04-17T11:36:55+08:00/docs/guides/backup-restore/2022-04-17T11:36:55+08:00/docs/config/2022-04-17T11:36:55+08:00/docs/config/config-https/2022-04-17T11:36:55+08:00/docs/clients/restful-api/edgelabel/2022-04-17T11:36:55+08:00/docs/performance/api-preformance/hugegraph-api-0.2/2022-04-17T11:36:55+08:00/docs/quickstart/hugegraph-hubble/2023-01-04T22:59:07+08:00/docs/clients/2022-04-17T11:36:55+08:00/docs/config/config-computer/2023-01-01T16:16:43+08:00/docs/guides/faq/2023-01-01T16:16:43+08:00/docs/clients/restful-api/indexlabel/2022-04-17T11:36:55+08:00/docs/quickstart/hugegraph-client/2023-01-01T16:16:43+08:00/docs/guides/2022-04-17T11:36:55+08:00/docs/clients/restful-api/rebuild/2022-05-09T18:43:53+08:00/docs/quickstart/hugegraph-computer/2023-01-01T16:16:43+08:00/docs/language/2022-04-17T11:36:55+08:00/docs/clients/restful-api/vertex/2023-01-15T21:47:17+08:00/docs/clients/restful-api/edge/2023-01-15T21:46:48+08:00/docs/performance/2022-04-17T11:36:55+08:00/docs/contribution-guidelines/2022-12-30T19:36:31+08:00/docs/clients/restful-api/traverser/2022-04-17T11:36:55+08:00/docs/changelog/2022-04-28T21:26:41+08:00/docs/clients/restful-api/rank/2022-09-15T12:59:59+08:00/docs/clients/restful-api/variable/2022-04-17T11:36:55+08:00/docs/clients/restful-api/graphs/2022-05-27T09:27:37+08:00/docs/clients/restful-api/task/2022-09-15T12:59:59+08:00/docs/clients/restful-api/gremlin/2022-04-17T11:36:55+08:00/docs/clients/restful-api/auth/2022-04-17T11:36:55+08:00/docs/clients/restful-api/other/2022-04-17T11:36:55+08:00/docs/2022-12-30T19:57:48+08:00/blog/news/2022-03-21T18:55:33+08:00/blog/releases/2022-03-21T18:55:33+08:00/blog/2018/10/06/easy-documentation-with-docsy/2022-03-21T18:55:33+08:00/blog/2018/10/06/the-second-blog-post/2022-03-21T18:55:33+08:00/blog/2018/01/04/another-great-release/2022-03-21T18:55:33+08:00/docs/cla/2022-03-21T19:51:14+08:00/docs/performance/hugegraph-benchmark-0.4.4/2022-09-15T12:59:59+08:00/docs/summary/2022-11-27T21:05:55+08:00/blog/2022-03-21T18:55:33+08:00/categories//community/2022-03-21T18:55:33+08:00/2023-01-15T13:44:01+00:00/search/2022-03-21T18:55:33+08:00/tags/ \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index 659fea2ea..05cb44732 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -/en/sitemap.xml2023-01-15T21:47:17+08:00/cn/sitemap.xml2023-01-09T07:41:46+08:00 \ No newline at end of file +/cn/sitemap.xml2023-02-02T01:21:10+08:00/en/sitemap.xml2023-02-02T01:21:10+08:00 \ No newline at end of file