diff --git a/cn/docs/_print/index.html b/cn/docs/_print/index.html index dd3596fce..c90c34b48 100644 --- a/cn/docs/_print/index.html +++ b/cn/docs/_print/index.html @@ -2910,340 +2910,283 @@
Response Status
204
 

根据Label+Id删除顶点

通过指定Label参数和Id来删除顶点时,一般来说其性能比仅根据Id删除会更好。

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/vertices/"1:marko"?label=person
 
Response Status
204
-

5.1.8 - Edge API

2.2 Edge

顶点 id 格式的修改也影响到了边的 Id 以及源顶点和目标顶点 id 的格式。

EdgeId是由 src-vertex-id + direction + label + sort-values + tgt-vertex-id 拼接而成, -但是这里的顶点id类型不是通过引号区分的,而是根据前缀区分:


接下来的示例均假设已经创建好了前述的各种schema和vertex信息

2.2.1 创建一条边

Params说明

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
+

5.1.8 - Edge API

2.2 Edge

顶点 id 格式的修改也影响到了边的 id 以及源顶点和目标顶点 id 的格式

EdgeId 是由 src-vertex-id + direction + label + sort-values + tgt-vertex-id 拼接而成,但是这里的顶点 id 类型不是通过引号区分的,而是根据前缀区分:


接下来的示例需要先根据以下 groovy 脚本创建图 schema

import org.apache.hugegraph.HugeFactory
+import org.apache.tinkerpop.gremlin.structure.T
+
+conf = "conf/graphs/hugegraph.properties"
+graph = HugeFactory.open(conf)
+schema = graph.schema()
+
+schema.propertyKey("name").asText().ifNotExist().create()
+schema.propertyKey("age").asInt().ifNotExist().create()
+schema.propertyKey("city").asText().ifNotExist().create()
+schema.propertyKey("weight").asDouble().ifNotExist().create()
+schema.propertyKey("lang").asText().ifNotExist().create()
+schema.propertyKey("date").asText().ifNotExist().create()
+schema.propertyKey("price").asInt().ifNotExist().create()
+
+schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create()
+schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create()
+schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create()
+schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create()
+schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create()
+schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create()
+schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create()
+schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create()
+schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create()
+schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create()
+
+marko = graph.addVertex(T.label, "person", "name", "marko", "age", 29, "city", "Beijing")
+vadas = graph.addVertex(T.label, "person", "name", "vadas", "age", 27, "city", "Hongkong")
+lop = graph.addVertex(T.label, "software", "name", "lop", "lang", "java", "price", 328)
+josh = graph.addVertex(T.label, "person", "name", "josh", "age", 32, "city", "Beijing")
+ripple = graph.addVertex(T.label, "software", "name", "ripple", "lang", "java", "price", 199)
+peter = graph.addVertex(T.label, "person", "name", "peter", "age", 35, "city", "Shanghai")
+
+graph.tx().commit()
+g = graph.traversal()
+

2.2.1 创建一条边

Params

路径参数说明:

请求体说明:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
 
Request Body
{
     "label": "created",
-    "outV": "1:peter",
+    "outV": "1:marko",
     "inV": "2:lop",
     "outVLabel": "person",
     "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "date": "20171210",
+        "weight": 0.4
     }
 }
 
Response Status
201
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 0.4,
+        "date": "20171210"
     }
 }
-

2.2.2 创建多条边

Params
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
+

2.2.2 创建多条边

Params

路径参数说明:

请求参数说明:

请求体说明:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
[
     {
-        "label": "created",
-        "outV": "1:peter",
-        "inV": "2:lop",
+        "label": "knows",
+        "outV": "1:marko",
+        "inV": "1:vadas",
         "outVLabel": "person",
-        "inVLabel": "software",
+        "inVLabel": "person",
         "properties": {
-            "date": "2017-5-18",
-            "weight": 0.2
+            "date": "20160110",
+            "weight": 0.5
         }
     },
     {
         "label": "knows",
         "outV": "1:marko",
-        "inV": "1:vadas",
+        "inV": "1:josh",
         "outVLabel": "person",
         "inVLabel": "person",
         "properties": {
-            "date": "2016-01-10",
-            "weight": 0.5
+            "date": "20130220",
+            "weight": 1.0
         }
     }
 ]
 
Response Status
201
 
Response Body
[
-    "S1:peter>1>>S2:lop",
-    "S1:marko>2>>S1:vadas"
+    "S1:marko>1>>S1:vadas",
+    "S1:marko>1>>S1:josh"
 ]
-

2.2.3 更新边属性

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=append
+

2.2.3 更新边属性

Params

路径参数说明:

请求参数说明:

请求体说明:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=append
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

注意:属性的取值是有三种类别的,分别是single、set和list。如果是single,表示增加或更新属性值;如果是set或list,则表示追加属性值。

Response Status
200
+

注意:属性的取值是有三种类别的,分别是 single、set 和 list。如果是 single,表示增加或更新属性值;如果是 set 或 list,则表示追加属性值

Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 1
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.4 批量更新边属性

功能说明

与批量更新顶点属性类似

假设原边及属性为:

{
-    "edges":[
-        {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1,
-                "date":1512835200000
-            }
-        },
-        {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1,
-                "date":1361289600000
-            }
-        }
-    ]
-}
-
Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
+

2.2.4 批量更新边属性

Params

路径参数说明:

请求体说明:

Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":0.1,
-                "date":1522835200000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:vadas",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20160111",
+                "weight": 1.0
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":0.2,
-                "date":1301289600000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:josh",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20130221",
+                "weight": 0.5
             }
         }
     ],
-    "update_strategies":{
-        "weight":"SUM",
-        "date":"BIGGER"
+    "update_strategies": {
+        "weight": "SUM",
+        "date": "OVERRIDE"
     },
     "check_vertex": false,
-    "create_if_not_exist":true
+    "create_if_not_exist": true
 }
 
Response Status
200
 
Response Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1.1,
-                "date":1522835200000
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:vadas",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20160111"
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1.2,
-                "date":1301289600000
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         }
     ]
 }
-

2.2.5 删除边属性

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=eliminate
+

2.2.5 删除边属性

Params

路径参数说明:

请求参数说明:

请求体说明:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=eliminate
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

注意:这里会直接删除属性(删除key和所有value),无论其属性的取值是single、set或list。

Response Status
200
-
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
-    "label": "created",
-    "type": "edge",
-    "inVLabel": "software",
-    "outVLabel": "person",
-    "inV": "2:lop",
-    "outV": "1:peter",
-    "properties": {
-        "date": "20170324"
-    }
+

注意:这里会直接删除属性(删除 key 和所有 value),无论其属性的取值是 single、set 或 list

Response Status
400
+
Response Body

无法删除未设置为 nullable 的属性

{
+    "exception": "class java.lang.IllegalArgumentException",
+    "message": "Can't remove non-null edge property 'p[weight->1.0]'",
+    "cause": ""
 }
-

2.2.6 获取符合条件的边

Params

支持的查询有以下几种:

属性键值对由JSON格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如properties={"weight":0.8},范围匹配时形如properties={"age":"P.gt(0.8)"},范围匹配支持的表达式如下:

表达式说明
P.eq(number)属性值等于number的边
P.neq(number)属性值不等于number的边
P.lt(number)属性值小于number的边
P.lte(number)属性值小于等于number的边
P.gt(number)属性值大于number的边
P.gte(number)属性值大于等于number的边
P.between(number1,number2)属性值大于等于number1且小于number2的边
P.inside(number1,number2)属性值大于number1且小于number2的边
P.outside(number1,number2)属性值小于number1且大于number2的边
P.within(value1,value2,value3,…)属性值等于任何一个给定value的边

查询与顶点 person:josh(vertex_id=“1:josh”) 相连且 label 为 created 的边

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:josh"&direction=BOTH&label=created&properties={}
+

2.2.6 获取符合条件的边

Params

路径参数说明:

请求参数说明:

属性键值对由 JSON 格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如 properties={"weight":0.8},范围匹配时形如 properties={"age":"P.gt(0.8)"},范围匹配支持的表达式如下:

表达式说明
P.eq(number)属性值等于 number 的边
P.neq(number)属性值不等于 number 的边
P.lt(number)属性值小于 number 的边
P.lte(number)属性值小于等于 number 的边
P.gt(number)属性值大于 number 的边
P.gte(number)属性值大于等于 number 的边
P.between(number1,number2)属性值大于等于 number1 且小于 number2 的边
P.inside(number1,number2)属性值大于 number1 且小于 number2 的边
P.outside(number1,number2)属性值小于 number1 且大于 number2 的边
P.within(value1,value2,value3,…)属性值等于任何一个给定 value 的边
P.textcontains(value)属性值包含给定 value 的边 (string 类型)
P.contains(value)属性值包含给定 value 的边 (collection 类型)

查询与顶点 person:marko(vertex_id=“1:marko”) 相连且 label 为 knows 的且 date 属性等于 “20160111” 的边

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:marko"&label=knows&properties={"date":"P.within(\"20160111\")"}
 
Response Status
200
 
Response Body
{
     "edges": [
         {
-            "id": "S1:josh>1>>S2:lop",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:lop",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20091111",
-                "weight": 0.4
+                "weight": 1.5,
+                "date": "20160111"
+            }
+        }
+    ]
+}
+

分页查询所有边,获取第一页(page 不带参数值),限定 2 条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=2
+
Response Status
200
+
Response Body
{
+    "edges": [
+        {
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         },
         {
-            "id": "S1:josh>1>>S2:ripple",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:ripple",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20171210",
-                "weight": 1
+                "weight": 1.5,
+                "date": "20160111"
             }
         }
-    ]
-}
-

分页查询所有边,获取第一页(page不带参数值),限定3条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=3
-
Response Status
200
-
Response Body
{
-	"edges": [{
-			"id": "S1:peter>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:peter",
-			"properties": {
-				"weight": 0.2,
-				"date": "20170324"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 0.4,
-				"date": "20091111"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:ripple",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:ripple",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 1,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004"
+    ],
+    "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC"
 }
-

返回的body里面是带有下一页的页号信息的,"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004", -在查询下一页的时候将该值赋给page参数。

分页查询所有边,获取下一页(page带上上一页返回的page值),限定3条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&limit=3
+

返回的 body 里面是带有下一页的页号信息的,"page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC",在查询下一页的时候将该值赋给 page 参数

分页查询所有边,获取下一页(page 带上上一页返回的 page 值),限定 2 条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&limit=2
 
Response Status
200
 
Response Body
{
-	"edges": [{
-			"id": "S1:marko>1>20130220>S1:josh",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:josh",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 1,
-				"date": "20130220"
-			}
-		},
-		{
-			"id": "S1:marko>1>20160110>S1:vadas",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:vadas",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.5,
-				"date": "20160110"
-			}
-		},
-		{
-			"id": "S1:marko>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.4,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": null
+    "edges": [
+        {
+            "id": "S1:marko>2>>S2:lop",
+            "label": "created",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "2:lop",
+            "inVLabel": "software",
+            "properties": {
+                "weight": 1.0,
+                "date": "20171210"
+            }
+        }
+    ],
+    "page": null
 }
-

此时"page": null表示已经没有下一页了 (注: 后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 page 值可能非空,通过该 page 再请求下一页数据时则返回 空数据page = null,其他情况类似)

2.2.7 根据Id获取边

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

此时 "page": null 表示已经没有下一页了

注:后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 page 值可能非空,通过该 page 再请求下一页数据时则返回 空数据page = null,其他情况类似

2.2.7 根据 id 获取边

Params

路径参数说明:

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.8 根据Id删除边

Params

仅根据Id删除边

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

2.2.8 根据 id 删除边

Params

路径参数说明:

请求参数说明:

仅根据 id 删除边

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
204
-

根据Label+Id删除边

通过指定Label参数和Id来删除边时,一般来说其性能比仅根据Id删除会更好。

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?label=person
+

根据 label + id 删除边

通过指定 label 参数和 id 来删除边时,一般来说其性能比仅根据 id 删除会更好

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>1>>S1:vadas?label=knows
 
Response Status
204
 

5.1.9 - Traverser API

3.1 traverser API概述

HugeGraphServer为HugeGraph图数据库提供了RESTful API接口。除了顶点和边的CRUD基本操作以外,还提供了一些遍历(traverser)方法,我们称为traverser API。这些遍历方法实现了一些复杂的图算法,方便用户对图进行分析和挖掘。

HugeGraph支持的Traverser API包括:

3.2. traverser API详解

使用方法中的例子,都是基于TinkerPop官网给出的图:

tinkerpop示例图

数据导入程序如下:

public class Loader {
     public static void main(String[] args) {
diff --git a/cn/docs/clients/_print/index.html b/cn/docs/clients/_print/index.html
index 367dff010..932ce835e 100644
--- a/cn/docs/clients/_print/index.html
+++ b/cn/docs/clients/_print/index.html
@@ -1182,340 +1182,283 @@
 
Response Status
204
 

根据Label+Id删除顶点

通过指定Label参数和Id来删除顶点时,一般来说其性能比仅根据Id删除会更好。

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/vertices/"1:marko"?label=person
 
Response Status
204
-

1.8 - Edge API

2.2 Edge

顶点 id 格式的修改也影响到了边的 Id 以及源顶点和目标顶点 id 的格式。

EdgeId是由 src-vertex-id + direction + label + sort-values + tgt-vertex-id 拼接而成, -但是这里的顶点id类型不是通过引号区分的,而是根据前缀区分:


接下来的示例均假设已经创建好了前述的各种schema和vertex信息

2.2.1 创建一条边

Params说明

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
+

1.8 - Edge API

2.2 Edge

顶点 id 格式的修改也影响到了边的 id 以及源顶点和目标顶点 id 的格式

EdgeId 是由 src-vertex-id + direction + label + sort-values + tgt-vertex-id 拼接而成,但是这里的顶点 id 类型不是通过引号区分的,而是根据前缀区分:


接下来的示例需要先根据以下 groovy 脚本创建图 schema

import org.apache.hugegraph.HugeFactory
+import org.apache.tinkerpop.gremlin.structure.T
+
+conf = "conf/graphs/hugegraph.properties"
+graph = HugeFactory.open(conf)
+schema = graph.schema()
+
+schema.propertyKey("name").asText().ifNotExist().create()
+schema.propertyKey("age").asInt().ifNotExist().create()
+schema.propertyKey("city").asText().ifNotExist().create()
+schema.propertyKey("weight").asDouble().ifNotExist().create()
+schema.propertyKey("lang").asText().ifNotExist().create()
+schema.propertyKey("date").asText().ifNotExist().create()
+schema.propertyKey("price").asInt().ifNotExist().create()
+
+schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create()
+schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create()
+schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create()
+schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create()
+schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create()
+schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create()
+schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create()
+schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create()
+schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create()
+schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create()
+
+marko = graph.addVertex(T.label, "person", "name", "marko", "age", 29, "city", "Beijing")
+vadas = graph.addVertex(T.label, "person", "name", "vadas", "age", 27, "city", "Hongkong")
+lop = graph.addVertex(T.label, "software", "name", "lop", "lang", "java", "price", 328)
+josh = graph.addVertex(T.label, "person", "name", "josh", "age", 32, "city", "Beijing")
+ripple = graph.addVertex(T.label, "software", "name", "ripple", "lang", "java", "price", 199)
+peter = graph.addVertex(T.label, "person", "name", "peter", "age", 35, "city", "Shanghai")
+
+graph.tx().commit()
+g = graph.traversal()
+

2.2.1 创建一条边

Params

路径参数说明:

请求体说明:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
 
Request Body
{
     "label": "created",
-    "outV": "1:peter",
+    "outV": "1:marko",
     "inV": "2:lop",
     "outVLabel": "person",
     "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "date": "20171210",
+        "weight": 0.4
     }
 }
 
Response Status
201
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 0.4,
+        "date": "20171210"
     }
 }
-

2.2.2 创建多条边

Params
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
+

2.2.2 创建多条边

Params

路径参数说明:

请求参数说明:

请求体说明:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
[
     {
-        "label": "created",
-        "outV": "1:peter",
-        "inV": "2:lop",
+        "label": "knows",
+        "outV": "1:marko",
+        "inV": "1:vadas",
         "outVLabel": "person",
-        "inVLabel": "software",
+        "inVLabel": "person",
         "properties": {
-            "date": "2017-5-18",
-            "weight": 0.2
+            "date": "20160110",
+            "weight": 0.5
         }
     },
     {
         "label": "knows",
         "outV": "1:marko",
-        "inV": "1:vadas",
+        "inV": "1:josh",
         "outVLabel": "person",
         "inVLabel": "person",
         "properties": {
-            "date": "2016-01-10",
-            "weight": 0.5
+            "date": "20130220",
+            "weight": 1.0
         }
     }
 ]
 
Response Status
201
 
Response Body
[
-    "S1:peter>1>>S2:lop",
-    "S1:marko>2>>S1:vadas"
+    "S1:marko>1>>S1:vadas",
+    "S1:marko>1>>S1:josh"
 ]
-

2.2.3 更新边属性

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=append
+

2.2.3 更新边属性

Params

路径参数说明:

请求参数说明:

请求体说明:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=append
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

注意:属性的取值是有三种类别的,分别是single、set和list。如果是single,表示增加或更新属性值;如果是set或list,则表示追加属性值。

Response Status
200
+

注意:属性的取值是有三种类别的,分别是 single、set 和 list。如果是 single,表示增加或更新属性值;如果是 set 或 list,则表示追加属性值

Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 1
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.4 批量更新边属性

功能说明

与批量更新顶点属性类似

假设原边及属性为:

{
-    "edges":[
-        {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1,
-                "date":1512835200000
-            }
-        },
-        {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1,
-                "date":1361289600000
-            }
-        }
-    ]
-}
-
Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
+

2.2.4 批量更新边属性

Params

路径参数说明:

请求体说明:

Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":0.1,
-                "date":1522835200000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:vadas",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20160111",
+                "weight": 1.0
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":0.2,
-                "date":1301289600000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:josh",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20130221",
+                "weight": 0.5
             }
         }
     ],
-    "update_strategies":{
-        "weight":"SUM",
-        "date":"BIGGER"
+    "update_strategies": {
+        "weight": "SUM",
+        "date": "OVERRIDE"
     },
     "check_vertex": false,
-    "create_if_not_exist":true
+    "create_if_not_exist": true
 }
 
Response Status
200
 
Response Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1.1,
-                "date":1522835200000
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:vadas",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20160111"
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1.2,
-                "date":1301289600000
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         }
     ]
 }
-

2.2.5 删除边属性

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=eliminate
+

2.2.5 删除边属性

Params

路径参数说明:

请求参数说明:

请求体说明:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=eliminate
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

注意:这里会直接删除属性(删除key和所有value),无论其属性的取值是single、set或list。

Response Status
200
-
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
-    "label": "created",
-    "type": "edge",
-    "inVLabel": "software",
-    "outVLabel": "person",
-    "inV": "2:lop",
-    "outV": "1:peter",
-    "properties": {
-        "date": "20170324"
-    }
+

注意:这里会直接删除属性(删除 key 和所有 value),无论其属性的取值是 single、set 或 list

Response Status
400
+
Response Body

无法删除未设置为 nullable 的属性

{
+    "exception": "class java.lang.IllegalArgumentException",
+    "message": "Can't remove non-null edge property 'p[weight->1.0]'",
+    "cause": ""
 }
-

2.2.6 获取符合条件的边

Params

支持的查询有以下几种:

属性键值对由JSON格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如properties={"weight":0.8},范围匹配时形如properties={"age":"P.gt(0.8)"},范围匹配支持的表达式如下:

表达式说明
P.eq(number)属性值等于number的边
P.neq(number)属性值不等于number的边
P.lt(number)属性值小于number的边
P.lte(number)属性值小于等于number的边
P.gt(number)属性值大于number的边
P.gte(number)属性值大于等于number的边
P.between(number1,number2)属性值大于等于number1且小于number2的边
P.inside(number1,number2)属性值大于number1且小于number2的边
P.outside(number1,number2)属性值小于number1且大于number2的边
P.within(value1,value2,value3,…)属性值等于任何一个给定value的边

查询与顶点 person:josh(vertex_id=“1:josh”) 相连且 label 为 created 的边

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:josh"&direction=BOTH&label=created&properties={}
+

2.2.6 获取符合条件的边

Params

路径参数说明:

请求参数说明:

属性键值对由 JSON 格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如 properties={"weight":0.8},范围匹配时形如 properties={"age":"P.gt(0.8)"},范围匹配支持的表达式如下:

表达式说明
P.eq(number)属性值等于 number 的边
P.neq(number)属性值不等于 number 的边
P.lt(number)属性值小于 number 的边
P.lte(number)属性值小于等于 number 的边
P.gt(number)属性值大于 number 的边
P.gte(number)属性值大于等于 number 的边
P.between(number1,number2)属性值大于等于 number1 且小于 number2 的边
P.inside(number1,number2)属性值大于 number1 且小于 number2 的边
P.outside(number1,number2)属性值小于 number1 且大于 number2 的边
P.within(value1,value2,value3,…)属性值等于任何一个给定 value 的边
P.textcontains(value)属性值包含给定 value 的边 (string 类型)
P.contains(value)属性值包含给定 value 的边 (collection 类型)

查询与顶点 person:marko(vertex_id=“1:marko”) 相连且 label 为 knows 的且 date 属性等于 “20160111” 的边

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:marko"&label=knows&properties={"date":"P.within(\"20160111\")"}
 
Response Status
200
 
Response Body
{
     "edges": [
         {
-            "id": "S1:josh>1>>S2:lop",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:lop",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20091111",
-                "weight": 0.4
+                "weight": 1.5,
+                "date": "20160111"
+            }
+        }
+    ]
+}
+

分页查询所有边,获取第一页(page 不带参数值),限定 2 条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=2
+
Response Status
200
+
Response Body
{
+    "edges": [
+        {
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         },
         {
-            "id": "S1:josh>1>>S2:ripple",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:ripple",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20171210",
-                "weight": 1
+                "weight": 1.5,
+                "date": "20160111"
             }
         }
-    ]
-}
-

分页查询所有边,获取第一页(page不带参数值),限定3条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=3
-
Response Status
200
-
Response Body
{
-	"edges": [{
-			"id": "S1:peter>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:peter",
-			"properties": {
-				"weight": 0.2,
-				"date": "20170324"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 0.4,
-				"date": "20091111"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:ripple",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:ripple",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 1,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004"
+    ],
+    "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC"
 }
-

返回的body里面是带有下一页的页号信息的,"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004", -在查询下一页的时候将该值赋给page参数。

分页查询所有边,获取下一页(page带上上一页返回的page值),限定3条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&limit=3
+

返回的 body 里面是带有下一页的页号信息的,"page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC",在查询下一页的时候将该值赋给 page 参数

分页查询所有边,获取下一页(page 带上上一页返回的 page 值),限定 2 条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&limit=2
 
Response Status
200
 
Response Body
{
-	"edges": [{
-			"id": "S1:marko>1>20130220>S1:josh",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:josh",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 1,
-				"date": "20130220"
-			}
-		},
-		{
-			"id": "S1:marko>1>20160110>S1:vadas",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:vadas",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.5,
-				"date": "20160110"
-			}
-		},
-		{
-			"id": "S1:marko>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.4,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": null
+    "edges": [
+        {
+            "id": "S1:marko>2>>S2:lop",
+            "label": "created",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "2:lop",
+            "inVLabel": "software",
+            "properties": {
+                "weight": 1.0,
+                "date": "20171210"
+            }
+        }
+    ],
+    "page": null
 }
-

此时"page": null表示已经没有下一页了 (注: 后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 page 值可能非空,通过该 page 再请求下一页数据时则返回 空数据page = null,其他情况类似)

2.2.7 根据Id获取边

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

此时 "page": null 表示已经没有下一页了

注:后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 page 值可能非空,通过该 page 再请求下一页数据时则返回 空数据page = null,其他情况类似

2.2.7 根据 id 获取边

Params

路径参数说明:

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.8 根据Id删除边

Params

仅根据Id删除边

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

2.2.8 根据 id 删除边

Params

路径参数说明:

请求参数说明:

仅根据 id 删除边

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
204
-

根据Label+Id删除边

通过指定Label参数和Id来删除边时,一般来说其性能比仅根据Id删除会更好。

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?label=person
+

根据 label + id 删除边

通过指定 label 参数和 id 来删除边时,一般来说其性能比仅根据 id 删除会更好

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>1>>S1:vadas?label=knows
 
Response Status
204
 

1.9 - Traverser API

3.1 traverser API概述

HugeGraphServer为HugeGraph图数据库提供了RESTful API接口。除了顶点和边的CRUD基本操作以外,还提供了一些遍历(traverser)方法,我们称为traverser API。这些遍历方法实现了一些复杂的图算法,方便用户对图进行分析和挖掘。

HugeGraph支持的Traverser API包括:

3.2. traverser API详解

使用方法中的例子,都是基于TinkerPop官网给出的图:

tinkerpop示例图

数据导入程序如下:

public class Loader {
     public static void main(String[] args) {
diff --git a/cn/docs/clients/restful-api/_print/index.html b/cn/docs/clients/restful-api/_print/index.html
index 8093dadaf..07a96f218 100644
--- a/cn/docs/clients/restful-api/_print/index.html
+++ b/cn/docs/clients/restful-api/_print/index.html
@@ -1184,340 +1184,283 @@
 
Response Status
204
 

根据Label+Id删除顶点

通过指定Label参数和Id来删除顶点时,一般来说其性能比仅根据Id删除会更好。

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/vertices/"1:marko"?label=person
 
Response Status
204
-

8 - Edge API

2.2 Edge

顶点 id 格式的修改也影响到了边的 Id 以及源顶点和目标顶点 id 的格式。

EdgeId是由 src-vertex-id + direction + label + sort-values + tgt-vertex-id 拼接而成, -但是这里的顶点id类型不是通过引号区分的,而是根据前缀区分:


接下来的示例均假设已经创建好了前述的各种schema和vertex信息

2.2.1 创建一条边

Params说明

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
+

8 - Edge API

2.2 Edge

顶点 id 格式的修改也影响到了边的 id 以及源顶点和目标顶点 id 的格式

EdgeId 是由 src-vertex-id + direction + label + sort-values + tgt-vertex-id 拼接而成,但是这里的顶点 id 类型不是通过引号区分的,而是根据前缀区分:


接下来的示例需要先根据以下 groovy 脚本创建图 schema

import org.apache.hugegraph.HugeFactory
+import org.apache.tinkerpop.gremlin.structure.T
+
+conf = "conf/graphs/hugegraph.properties"
+graph = HugeFactory.open(conf)
+schema = graph.schema()
+
+schema.propertyKey("name").asText().ifNotExist().create()
+schema.propertyKey("age").asInt().ifNotExist().create()
+schema.propertyKey("city").asText().ifNotExist().create()
+schema.propertyKey("weight").asDouble().ifNotExist().create()
+schema.propertyKey("lang").asText().ifNotExist().create()
+schema.propertyKey("date").asText().ifNotExist().create()
+schema.propertyKey("price").asInt().ifNotExist().create()
+
+schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create()
+schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create()
+schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create()
+schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create()
+schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create()
+schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create()
+schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create()
+schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create()
+schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create()
+schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create()
+
+marko = graph.addVertex(T.label, "person", "name", "marko", "age", 29, "city", "Beijing")
+vadas = graph.addVertex(T.label, "person", "name", "vadas", "age", 27, "city", "Hongkong")
+lop = graph.addVertex(T.label, "software", "name", "lop", "lang", "java", "price", 328)
+josh = graph.addVertex(T.label, "person", "name", "josh", "age", 32, "city", "Beijing")
+ripple = graph.addVertex(T.label, "software", "name", "ripple", "lang", "java", "price", 199)
+peter = graph.addVertex(T.label, "person", "name", "peter", "age", 35, "city", "Shanghai")
+
+graph.tx().commit()
+g = graph.traversal()
+

2.2.1 创建一条边

Params

路径参数说明:

请求体说明:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
 
Request Body
{
     "label": "created",
-    "outV": "1:peter",
+    "outV": "1:marko",
     "inV": "2:lop",
     "outVLabel": "person",
     "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "date": "20171210",
+        "weight": 0.4
     }
 }
 
Response Status
201
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 0.4,
+        "date": "20171210"
     }
 }
-

2.2.2 创建多条边

Params
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
+

2.2.2 创建多条边

Params

路径参数说明:

请求参数说明:

请求体说明:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
[
     {
-        "label": "created",
-        "outV": "1:peter",
-        "inV": "2:lop",
+        "label": "knows",
+        "outV": "1:marko",
+        "inV": "1:vadas",
         "outVLabel": "person",
-        "inVLabel": "software",
+        "inVLabel": "person",
         "properties": {
-            "date": "2017-5-18",
-            "weight": 0.2
+            "date": "20160110",
+            "weight": 0.5
         }
     },
     {
         "label": "knows",
         "outV": "1:marko",
-        "inV": "1:vadas",
+        "inV": "1:josh",
         "outVLabel": "person",
         "inVLabel": "person",
         "properties": {
-            "date": "2016-01-10",
-            "weight": 0.5
+            "date": "20130220",
+            "weight": 1.0
         }
     }
 ]
 
Response Status
201
 
Response Body
[
-    "S1:peter>1>>S2:lop",
-    "S1:marko>2>>S1:vadas"
+    "S1:marko>1>>S1:vadas",
+    "S1:marko>1>>S1:josh"
 ]
-

2.2.3 更新边属性

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=append
+

2.2.3 更新边属性

Params

路径参数说明:

请求参数说明:

请求体说明:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=append
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

注意:属性的取值是有三种类别的,分别是single、set和list。如果是single,表示增加或更新属性值;如果是set或list,则表示追加属性值。

Response Status
200
+

注意:属性的取值是有三种类别的,分别是 single、set 和 list。如果是 single,表示增加或更新属性值;如果是 set 或 list,则表示追加属性值

Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 1
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.4 批量更新边属性

功能说明

与批量更新顶点属性类似

假设原边及属性为:

{
-    "edges":[
-        {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1,
-                "date":1512835200000
-            }
-        },
-        {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1,
-                "date":1361289600000
-            }
-        }
-    ]
-}
-
Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
+

2.2.4 批量更新边属性

Params

路径参数说明:

请求体说明:

Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":0.1,
-                "date":1522835200000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:vadas",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20160111",
+                "weight": 1.0
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":0.2,
-                "date":1301289600000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:josh",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20130221",
+                "weight": 0.5
             }
         }
     ],
-    "update_strategies":{
-        "weight":"SUM",
-        "date":"BIGGER"
+    "update_strategies": {
+        "weight": "SUM",
+        "date": "OVERRIDE"
     },
     "check_vertex": false,
-    "create_if_not_exist":true
+    "create_if_not_exist": true
 }
 
Response Status
200
 
Response Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1.1,
-                "date":1522835200000
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:vadas",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20160111"
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1.2,
-                "date":1301289600000
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         }
     ]
 }
-

2.2.5 删除边属性

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=eliminate
+

2.2.5 删除边属性

Params

路径参数说明:

请求参数说明:

请求体说明:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=eliminate
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

注意:这里会直接删除属性(删除key和所有value),无论其属性的取值是single、set或list。

Response Status
200
-
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
-    "label": "created",
-    "type": "edge",
-    "inVLabel": "software",
-    "outVLabel": "person",
-    "inV": "2:lop",
-    "outV": "1:peter",
-    "properties": {
-        "date": "20170324"
-    }
+

注意:这里会直接删除属性(删除 key 和所有 value),无论其属性的取值是 single、set 或 list

Response Status
400
+
Response Body

无法删除未设置为 nullable 的属性

{
+    "exception": "class java.lang.IllegalArgumentException",
+    "message": "Can't remove non-null edge property 'p[weight->1.0]'",
+    "cause": ""
 }
-

2.2.6 获取符合条件的边

Params

支持的查询有以下几种:

属性键值对由JSON格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如properties={"weight":0.8},范围匹配时形如properties={"age":"P.gt(0.8)"},范围匹配支持的表达式如下:

表达式说明
P.eq(number)属性值等于number的边
P.neq(number)属性值不等于number的边
P.lt(number)属性值小于number的边
P.lte(number)属性值小于等于number的边
P.gt(number)属性值大于number的边
P.gte(number)属性值大于等于number的边
P.between(number1,number2)属性值大于等于number1且小于number2的边
P.inside(number1,number2)属性值大于number1且小于number2的边
P.outside(number1,number2)属性值小于number1且大于number2的边
P.within(value1,value2,value3,…)属性值等于任何一个给定value的边

查询与顶点 person:josh(vertex_id=“1:josh”) 相连且 label 为 created 的边

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:josh"&direction=BOTH&label=created&properties={}
+

2.2.6 获取符合条件的边

Params

路径参数说明:

请求参数说明:

属性键值对由 JSON 格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如 properties={"weight":0.8},范围匹配时形如 properties={"age":"P.gt(0.8)"},范围匹配支持的表达式如下:

表达式说明
P.eq(number)属性值等于 number 的边
P.neq(number)属性值不等于 number 的边
P.lt(number)属性值小于 number 的边
P.lte(number)属性值小于等于 number 的边
P.gt(number)属性值大于 number 的边
P.gte(number)属性值大于等于 number 的边
P.between(number1,number2)属性值大于等于 number1 且小于 number2 的边
P.inside(number1,number2)属性值大于 number1 且小于 number2 的边
P.outside(number1,number2)属性值小于 number1 且大于 number2 的边
P.within(value1,value2,value3,…)属性值等于任何一个给定 value 的边
P.textcontains(value)属性值包含给定 value 的边 (string 类型)
P.contains(value)属性值包含给定 value 的边 (collection 类型)

查询与顶点 person:marko(vertex_id=“1:marko”) 相连且 label 为 knows 的且 date 属性等于 “20160111” 的边

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:marko"&label=knows&properties={"date":"P.within(\"20160111\")"}
 
Response Status
200
 
Response Body
{
     "edges": [
         {
-            "id": "S1:josh>1>>S2:lop",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:lop",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20091111",
-                "weight": 0.4
+                "weight": 1.5,
+                "date": "20160111"
+            }
+        }
+    ]
+}
+

分页查询所有边,获取第一页(page 不带参数值),限定 2 条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=2
+
Response Status
200
+
Response Body
{
+    "edges": [
+        {
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         },
         {
-            "id": "S1:josh>1>>S2:ripple",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:ripple",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20171210",
-                "weight": 1
+                "weight": 1.5,
+                "date": "20160111"
             }
         }
-    ]
-}
-

分页查询所有边,获取第一页(page不带参数值),限定3条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=3
-
Response Status
200
-
Response Body
{
-	"edges": [{
-			"id": "S1:peter>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:peter",
-			"properties": {
-				"weight": 0.2,
-				"date": "20170324"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 0.4,
-				"date": "20091111"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:ripple",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:ripple",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 1,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004"
+    ],
+    "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC"
 }
-

返回的body里面是带有下一页的页号信息的,"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004", -在查询下一页的时候将该值赋给page参数。

分页查询所有边,获取下一页(page带上上一页返回的page值),限定3条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&limit=3
+

返回的 body 里面是带有下一页的页号信息的,"page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC",在查询下一页的时候将该值赋给 page 参数

分页查询所有边,获取下一页(page 带上上一页返回的 page 值),限定 2 条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&limit=2
 
Response Status
200
 
Response Body
{
-	"edges": [{
-			"id": "S1:marko>1>20130220>S1:josh",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:josh",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 1,
-				"date": "20130220"
-			}
-		},
-		{
-			"id": "S1:marko>1>20160110>S1:vadas",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:vadas",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.5,
-				"date": "20160110"
-			}
-		},
-		{
-			"id": "S1:marko>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.4,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": null
+    "edges": [
+        {
+            "id": "S1:marko>2>>S2:lop",
+            "label": "created",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "2:lop",
+            "inVLabel": "software",
+            "properties": {
+                "weight": 1.0,
+                "date": "20171210"
+            }
+        }
+    ],
+    "page": null
 }
-

此时"page": null表示已经没有下一页了 (注: 后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 page 值可能非空,通过该 page 再请求下一页数据时则返回 空数据page = null,其他情况类似)

2.2.7 根据Id获取边

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

此时 "page": null 表示已经没有下一页了

注:后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 page 值可能非空,通过该 page 再请求下一页数据时则返回 空数据page = null,其他情况类似

2.2.7 根据 id 获取边

Params

路径参数说明:

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.8 根据Id删除边

Params

仅根据Id删除边

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

2.2.8 根据 id 删除边

Params

路径参数说明:

请求参数说明:

仅根据 id 删除边

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
204
-

根据Label+Id删除边

通过指定Label参数和Id来删除边时,一般来说其性能比仅根据Id删除会更好。

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?label=person
+

根据 label + id 删除边

通过指定 label 参数和 id 来删除边时,一般来说其性能比仅根据 id 删除会更好

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>1>>S1:vadas?label=knows
 
Response Status
204
 

9 - Traverser API

3.1 traverser API概述

HugeGraphServer为HugeGraph图数据库提供了RESTful API接口。除了顶点和边的CRUD基本操作以外,还提供了一些遍历(traverser)方法,我们称为traverser API。这些遍历方法实现了一些复杂的图算法,方便用户对图进行分析和挖掘。

HugeGraph支持的Traverser API包括:

3.2. traverser API详解

使用方法中的例子,都是基于TinkerPop官网给出的图:

tinkerpop示例图

数据导入程序如下:

public class Loader {
     public static void main(String[] args) {
diff --git a/cn/docs/clients/restful-api/edge/index.html b/cn/docs/clients/restful-api/edge/index.html
index ac80a687b..11f80e608 100644
--- a/cn/docs/clients/restful-api/edge/index.html
+++ b/cn/docs/clients/restful-api/edge/index.html
@@ -1,360 +1,299 @@
 Edge API | HugeGraph
+顶点 id 格式的修改也影响到了边的 id 以及源顶点和目标顶点 id 的格式
+EdgeId 是由 src-vertex-id + direction + label + sort-values + tgt-vertex-id 拼接而成,但是这里的顶点 id 类型不是通过引号区分 …">
 

Edge API

2.2 Edge

顶点 id 格式的修改也影响到了边的 Id 以及源顶点和目标顶点 id 的格式。

EdgeId是由 src-vertex-id + direction + label + sort-values + tgt-vertex-id 拼接而成, -但是这里的顶点id类型不是通过引号区分的,而是根据前缀区分:

  • 当 id 类型为 number 时,EdgeId 的顶点 id 前有一个前缀L ,形如 “L123456>1»L987654”
  • 当 id 类型为 string 时,EdgeId 的顶点 id 前有一个前缀S ,形如 “S1:peter>1»S2:lop”

接下来的示例均假设已经创建好了前述的各种schema和vertex信息

2.2.1 创建一条边

Params说明

  • label:边类型名称,必填
  • outV:源顶点id,必填
  • inV:目标顶点id,必填
  • outVLabel:源顶点类型。必填
  • inVLabel:目标顶点类型。必填
  • properties: 边关联的属性,对象内部结构为:
    1. name:属性名称
    2. value:属性值
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
+ Print entire section

Edge API

2.2 Edge

顶点 id 格式的修改也影响到了边的 id 以及源顶点和目标顶点 id 的格式

EdgeId 是由 src-vertex-id + direction + label + sort-values + tgt-vertex-id 拼接而成,但是这里的顶点 id 类型不是通过引号区分的,而是根据前缀区分:

  • 当 id 类型为 number 时,EdgeId 的顶点 id 前有一个前缀 L ,形如 “L123456>1»L987654”
  • 当 id 类型为 string 时,EdgeId 的顶点 id 前有一个前缀 S ,形如 “S1:peter>1»S2:lop”

接下来的示例需要先根据以下 groovy 脚本创建图 schema

import org.apache.hugegraph.HugeFactory
+import org.apache.tinkerpop.gremlin.structure.T
+
+conf = "conf/graphs/hugegraph.properties"
+graph = HugeFactory.open(conf)
+schema = graph.schema()
+
+schema.propertyKey("name").asText().ifNotExist().create()
+schema.propertyKey("age").asInt().ifNotExist().create()
+schema.propertyKey("city").asText().ifNotExist().create()
+schema.propertyKey("weight").asDouble().ifNotExist().create()
+schema.propertyKey("lang").asText().ifNotExist().create()
+schema.propertyKey("date").asText().ifNotExist().create()
+schema.propertyKey("price").asInt().ifNotExist().create()
+
+schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create()
+schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create()
+schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create()
+schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create()
+schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create()
+schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create()
+schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create()
+schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create()
+schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create()
+schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create()
+
+marko = graph.addVertex(T.label, "person", "name", "marko", "age", 29, "city", "Beijing")
+vadas = graph.addVertex(T.label, "person", "name", "vadas", "age", 27, "city", "Hongkong")
+lop = graph.addVertex(T.label, "software", "name", "lop", "lang", "java", "price", 328)
+josh = graph.addVertex(T.label, "person", "name", "josh", "age", 32, "city", "Beijing")
+ripple = graph.addVertex(T.label, "software", "name", "ripple", "lang", "java", "price", 199)
+peter = graph.addVertex(T.label, "person", "name", "peter", "age", 35, "city", "Shanghai")
+
+graph.tx().commit()
+g = graph.traversal()
+

2.2.1 创建一条边

Params

路径参数说明:

  • graph:待操作的图

请求体说明:

  • label:边类型名称,必填
  • outV:源顶点 id,必填
  • inV:目标顶点 id,必填
  • outVLabel:源顶点类型,必填
  • inVLabel:目标顶点类型,必填
  • properties: 边关联的属性,对象内部结构为:
    1. name:属性名称
    2. value:属性值
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
 
Request Body
{
     "label": "created",
-    "outV": "1:peter",
+    "outV": "1:marko",
     "inV": "2:lop",
     "outVLabel": "person",
     "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "date": "20171210",
+        "weight": 0.4
     }
 }
 
Response Status
201
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 0.4,
+        "date": "20171210"
     }
 }
-

2.2.2 创建多条边

Params
  • check_vertex: 是否检查顶点存在(true | false),当设置为 true 而待插入边的源顶点或目标顶点不存在时会报错。
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
+

2.2.2 创建多条边

Params

路径参数说明:

  • graph:待操作的图

请求参数说明:

  • check_vertex:是否检查顶点存在 (true | false),当设置为 true 而待插入边的源顶点或目标顶点不存在时会报错,默认为 true

请求体说明:

  • 边信息的列表
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
[
     {
-        "label": "created",
-        "outV": "1:peter",
-        "inV": "2:lop",
+        "label": "knows",
+        "outV": "1:marko",
+        "inV": "1:vadas",
         "outVLabel": "person",
-        "inVLabel": "software",
+        "inVLabel": "person",
         "properties": {
-            "date": "2017-5-18",
-            "weight": 0.2
+            "date": "20160110",
+            "weight": 0.5
         }
     },
     {
         "label": "knows",
         "outV": "1:marko",
-        "inV": "1:vadas",
+        "inV": "1:josh",
         "outVLabel": "person",
         "inVLabel": "person",
         "properties": {
-            "date": "2016-01-10",
-            "weight": 0.5
+            "date": "20130220",
+            "weight": 1.0
         }
     }
 ]
 
Response Status
201
 
Response Body
[
-    "S1:peter>1>>S2:lop",
-    "S1:marko>2>>S1:vadas"
+    "S1:marko>1>>S1:vadas",
+    "S1:marko>1>>S1:josh"
 ]
-

2.2.3 更新边属性

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=append
+

2.2.3 更新边属性

Params

路径参数说明:

  • graph:待操作的图
  • id:待操作的边 id

请求参数说明:

  • action:append 操作

请求体说明:

  • 边信息
Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=append
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

注意:属性的取值是有三种类别的,分别是single、set和list。如果是single,表示增加或更新属性值;如果是set或list,则表示追加属性值。

Response Status
200
+

注意:属性的取值是有三种类别的,分别是 single、set 和 list。如果是 single,表示增加或更新属性值;如果是 set 或 list,则表示追加属性值

Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 1
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.4 批量更新边属性

功能说明

与批量更新顶点属性类似

假设原边及属性为:

{
-    "edges":[
-        {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1,
-                "date":1512835200000
-            }
-        },
-        {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1,
-                "date":1361289600000
-            }
-        }
-    ]
-}
-
Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
+

2.2.4 批量更新边属性

Params

路径参数说明:

  • graph:待操作的图

请求体说明:

  • edges:边信息的列表
  • update_strategies:对于每个属性,可以单独设置其更新策略,包括:
    • SUM:仅支持 number 类型
    • BIGGER/SMALLER:仅支持 date/number 类型
    • UNION/INTERSECTION:仅支持 set 类型
    • APPEND/ELIMINATE:仅支持 collection 类型
    • OVERRIDE
  • check_vertex:是否检查顶点存在 (true | false),当设置为 true 而待插入边的源顶点或目标顶点不存在时会报错,默认为 true
  • create_if_not_exist:目前只支持设定为 true
Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":0.1,
-                "date":1522835200000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:vadas",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20160111",
+                "weight": 1.0
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":0.2,
-                "date":1301289600000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:josh",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20130221",
+                "weight": 0.5
             }
         }
     ],
-    "update_strategies":{
-        "weight":"SUM",
-        "date":"BIGGER"
+    "update_strategies": {
+        "weight": "SUM",
+        "date": "OVERRIDE"
     },
     "check_vertex": false,
-    "create_if_not_exist":true
+    "create_if_not_exist": true
 }
 
Response Status
200
 
Response Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1.1,
-                "date":1522835200000
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:vadas",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20160111"
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1.2,
-                "date":1301289600000
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         }
     ]
 }
-

2.2.5 删除边属性

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=eliminate
+

2.2.5 删除边属性

Params

路径参数说明:

  • graph:待操作的图
  • id:待操作的边 id

请求参数说明:

  • action:eliminate 操作

请求体说明:

  • 边信息
Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=eliminate
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

注意:这里会直接删除属性(删除key和所有value),无论其属性的取值是single、set或list。

Response Status
200
-
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
-    "label": "created",
-    "type": "edge",
-    "inVLabel": "software",
-    "outVLabel": "person",
-    "inV": "2:lop",
-    "outV": "1:peter",
-    "properties": {
-        "date": "20170324"
-    }
+

注意:这里会直接删除属性(删除 key 和所有 value),无论其属性的取值是 single、set 或 list

Response Status
400
+
Response Body

无法删除未设置为 nullable 的属性

{
+    "exception": "class java.lang.IllegalArgumentException",
+    "message": "Can't remove non-null edge property 'p[weight->1.0]'",
+    "cause": ""
 }
-

2.2.6 获取符合条件的边

Params
  • vertex_id: 顶点id
  • direction: 边的方向(OUT | IN | BOTH)
  • label: 边的标签
  • properties: 属性键值对(根据属性查询的前提是预先建立了索引)
  • offset:偏移,默认为0
  • limit: 查询数目,默认为100
  • page: 页号

支持的查询有以下几种:

  • 提供vertex_id参数时,不可以使用参数page,direction、label、properties可选,offset和limit可以 -限制结果范围
  • 不提供vertex_id参数时,label和properties可选
    • 如果使用page参数,则:offset参数不可用(不填或者为0),direction不可用,properties最多只能有一个
    • 如果不使用page参数,则:offset和limit可以用来限制结果范围,direction参数忽略

属性键值对由JSON格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如properties={"weight":0.8},范围匹配时形如properties={"age":"P.gt(0.8)"},范围匹配支持的表达式如下:

表达式说明
P.eq(number)属性值等于number的边
P.neq(number)属性值不等于number的边
P.lt(number)属性值小于number的边
P.lte(number)属性值小于等于number的边
P.gt(number)属性值大于number的边
P.gte(number)属性值大于等于number的边
P.between(number1,number2)属性值大于等于number1且小于number2的边
P.inside(number1,number2)属性值大于number1且小于number2的边
P.outside(number1,number2)属性值小于number1且大于number2的边
P.within(value1,value2,value3,…)属性值等于任何一个给定value的边

查询与顶点 person:josh(vertex_id=“1:josh”) 相连且 label 为 created 的边

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:josh"&direction=BOTH&label=created&properties={}
+

2.2.6 获取符合条件的边

Params

路径参数说明:

  • graph:待操作的图

请求参数说明:

  • vertex_id: 顶点 id
  • direction: 边的方向 (OUT | IN | BOTH),默认为 BOTH
  • label: 边的标签
  • properties: 属性键值对 (根据属性查询的前提是预先建立了索引)
  • keep_start_p: 默认为 false,当设置为 true 后,不会自动转义范围匹配输入的表达式,例如此时 properties={"age":"P.gt(0.8)"} 会被理解为精确匹配,即 age 属性等于 “P.gt(0.8)”
  • offset:偏移,默认为 0
  • limit: 查询数目,默认为 100
  • page: 页号

属性键值对由 JSON 格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如 properties={"weight":0.8},范围匹配时形如 properties={"age":"P.gt(0.8)"},范围匹配支持的表达式如下:

表达式说明
P.eq(number)属性值等于 number 的边
P.neq(number)属性值不等于 number 的边
P.lt(number)属性值小于 number 的边
P.lte(number)属性值小于等于 number 的边
P.gt(number)属性值大于 number 的边
P.gte(number)属性值大于等于 number 的边
P.between(number1,number2)属性值大于等于 number1 且小于 number2 的边
P.inside(number1,number2)属性值大于 number1 且小于 number2 的边
P.outside(number1,number2)属性值小于 number1 且大于 number2 的边
P.within(value1,value2,value3,…)属性值等于任何一个给定 value 的边
P.textcontains(value)属性值包含给定 value 的边 (string 类型)
P.contains(value)属性值包含给定 value 的边 (collection 类型)

查询与顶点 person:marko(vertex_id=“1:marko”) 相连且 label 为 knows 的且 date 属性等于 “20160111” 的边

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:marko"&label=knows&properties={"date":"P.within(\"20160111\")"}
 
Response Status
200
 
Response Body
{
     "edges": [
         {
-            "id": "S1:josh>1>>S2:lop",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:lop",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20160111"
+            }
+        }
+    ]
+}
+

分页查询所有边,获取第一页(page 不带参数值),限定 2 条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=2
+
Response Status
200
+
Response Body
{
+    "edges": [
+        {
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
             "properties": {
-                "date": "20091111",
-                "weight": 0.4
+                "weight": 1.5,
+                "date": "20130221"
             }
         },
         {
-            "id": "S1:josh>1>>S2:ripple",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:ripple",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20171210",
-                "weight": 1
+                "weight": 1.5,
+                "date": "20160111"
             }
         }
-    ]
-}
-

分页查询所有边,获取第一页(page不带参数值),限定3条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=3
-
Response Status
200
-
Response Body
{
-	"edges": [{
-			"id": "S1:peter>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:peter",
-			"properties": {
-				"weight": 0.2,
-				"date": "20170324"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 0.4,
-				"date": "20091111"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:ripple",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:ripple",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 1,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004"
+    ],
+    "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC"
 }
-

返回的body里面是带有下一页的页号信息的,"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004", -在查询下一页的时候将该值赋给page参数。

分页查询所有边,获取下一页(page带上上一页返回的page值),限定3条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&limit=3
+

返回的 body 里面是带有下一页的页号信息的,"page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC",在查询下一页的时候将该值赋给 page 参数

分页查询所有边,获取下一页(page 带上上一页返回的 page 值),限定 2 条

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&limit=2
 
Response Status
200
 
Response Body
{
-	"edges": [{
-			"id": "S1:marko>1>20130220>S1:josh",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:josh",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 1,
-				"date": "20130220"
-			}
-		},
-		{
-			"id": "S1:marko>1>20160110>S1:vadas",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:vadas",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.5,
-				"date": "20160110"
-			}
-		},
-		{
-			"id": "S1:marko>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.4,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": null
+    "edges": [
+        {
+            "id": "S1:marko>2>>S2:lop",
+            "label": "created",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "2:lop",
+            "inVLabel": "software",
+            "properties": {
+                "weight": 1.0,
+                "date": "20171210"
+            }
+        }
+    ],
+    "page": null
 }
-

此时"page": null表示已经没有下一页了 (注: 后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 page 值可能非空,通过该 page 再请求下一页数据时则返回 空数据page = null,其他情况类似)

2.2.7 根据Id获取边

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

此时 "page": null 表示已经没有下一页了

注:后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 page 值可能非空,通过该 page 再请求下一页数据时则返回 空数据page = null,其他情况类似

2.2.7 根据 id 获取边

Params

路径参数说明:

  • graph:待操作的图
  • id:待操作的边 id
Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.8 根据Id删除边

Params
  • label: 边类型,可选参数

仅根据Id删除边

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

2.2.8 根据 id 删除边

Params

路径参数说明:

  • graph:待操作的图
  • id:待操作的边 id

请求参数说明:

  • label: 边的标签

仅根据 id 删除边

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
204
-

根据Label+Id删除边

通过指定Label参数和Id来删除边时,一般来说其性能比仅根据Id删除会更好。

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?label=person
+

根据 label + id 删除边

通过指定 label 参数和 id 来删除边时,一般来说其性能比仅根据 id 删除会更好

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>1>>S1:vadas?label=knows
 
Response Status
204
-

Last modified September 15, 2022: cn: format table & fix typo (#150) (53bf0aaf)
+

diff --git a/cn/docs/clients/restful-api/index.xml b/cn/docs/clients/restful-api/index.xml index cc9329d20..617cc0a10 100644 --- a/cn/docs/clients/restful-api/index.xml +++ b/cn/docs/clients/restful-api/index.xml @@ -1557,23 +1557,62 @@ <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">204</span> </span></span></code></pre></div>Docs: Edge API/cn/docs/clients/restful-api/edge/Mon, 01 Jan 0001 00:00:00 +0000/cn/docs/clients/restful-api/edge/ <h3 id="22-edge">2.2 Edge</h3> -<p>顶点 id 格式的修改也影响到了边的 Id 以及源顶点和目标顶点 id 的格式。</p> -<p>EdgeId是由 <code>src-vertex-id + direction + label + sort-values + tgt-vertex-id</code> 拼接而成, -但是这里的顶点id类型不是通过引号区分的,而是根据前缀区分:</p> +<p>顶点 id 格式的修改也影响到了边的 id 以及源顶点和目标顶点 id 的格式</p> +<p>EdgeId 是由 <code>src-vertex-id + direction + label + sort-values + tgt-vertex-id</code> 拼接而成,但是这里的顶点 id 类型不是通过引号区分的,而是根据前缀区分:</p> <ul> -<li>当 id 类型为 number 时,EdgeId 的顶点 id 前有一个前缀<code>L</code> ,形如 &ldquo;L123456&gt;1&raquo;L987654&rdquo;</li> -<li>当 id 类型为 string 时,EdgeId 的顶点 id 前有一个前缀<code>S</code> ,形如 &ldquo;S1:peter&gt;1&raquo;S2:lop&rdquo;</li> +<li>当 id 类型为 number 时,EdgeId 的顶点 id 前有一个前缀 <code>L</code> ,形如 &ldquo;L123456&gt;1&raquo;L987654&rdquo;</li> +<li>当 id 类型为 string 时,EdgeId 的顶点 id 前有一个前缀 <code>S</code> ,形如 &ldquo;S1:peter&gt;1&raquo;S2:lop&rdquo;</li> </ul> <hr> -<p>接下来的示例均假设已经创建好了前述的各种schema和vertex信息</p> -<h4 id="221-创建一条边">2.2.1 创建一条边</h4> -<p>Params说明</p> +<p>接下来的示例需要先根据以下 <code>groovy</code> 脚本创建图 <code>schema</code></p> +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-groovy" data-lang="groovy"><span style="display:flex;"><span><span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000">org.apache.hugegraph.HugeFactory</span> +</span></span><span style="display:flex;"><span><span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000">org.apache.tinkerpop.gremlin.structure.T</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">conf</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;conf/graphs/hugegraph.properties&#34;</span> +</span></span><span style="display:flex;"><span><span style="color:#000">graph</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">HugeFactory</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">open</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">conf</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">schema</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asInt</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asDouble</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asInt</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">vertexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">primaryKeys</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">vertexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">primaryKeys</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;personByCity&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;personByAgeAndCity&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;softwareByPrice&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">edgeLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">sourceLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">targetLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">edgeLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">sourceLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">targetLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;createdByDate&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;createdByWeight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knowsByWeight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">marko</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;marko&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">29</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Beijing&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">vadas</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;vadas&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">27</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Hongkong&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">lop</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lop&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;java&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">328</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">josh</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;josh&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">32</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Beijing&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">ripple</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;ripple&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;java&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">199</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">peter</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;peter&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">35</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Shanghai&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">tx</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">commit</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">g</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">traversal</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span></code></pre></div><h4 id="221-创建一条边">2.2.1 创建一条边</h4> +<h5 id="params">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +</ul> +<p><strong>请求体说明:</strong></p> <ul> <li>label:边类型名称,必填</li> -<li>outV:源顶点id,必填</li> -<li>inV:目标顶点id,必填</li> -<li>outVLabel:源顶点类型。必填</li> -<li>inVLabel:目标顶点类型。必填</li> +<li>outV:源顶点 id,必填</li> +<li>inV:目标顶点 id,必填</li> +<li>outVLabel:源顶点类型,必填</li> +<li>inVLabel:目标顶点类型,必填</li> <li>properties: 边关联的属性,对象内部结构为: <ol> <li>name:属性名称</li> @@ -1586,60 +1625,69 @@ </span></span></code></pre></div><h5 id="request-body">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h5 id="response-status">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">201</span> </span></span></code></pre></div><h5 id="response-body">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="222-创建多条边">2.2.2 创建多条边</h4> -<h5 id="params">Params</h5> +<h5 id="params-1">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +</ul> +<p><strong>请求参数说明:</strong></p> <ul> -<li>check_vertex: 是否检查顶点存在(true | false),当设置为 true 而待插入边的源顶点或目标顶点不存在时会报错。</li> +<li>check_vertex:是否检查顶点存在 (true | false),当设置为 true 而待插入边的源顶点或目标顶点不存在时会报错,默认为 true</li> +</ul> +<p><strong>请求体说明:</strong></p> +<ul> +<li>边信息的列表</li> </ul> <h5 id="method--url-1">Method &amp; Url</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>POST http://localhost:8080/graphs/hugegraph/graph/edges/batch </span></span></code></pre></div><h5 id="request-body-1">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160110&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2016-01-10&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130220&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">]</span> @@ -1647,12 +1695,26 @@ <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">201</span> </span></span></code></pre></div><h5 id="response-body-1">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">[</span> -</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S1:vadas&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">]</span> </span></span></code></pre></div><h4 id="223-更新边属性">2.2.3 更新边属性</h4> +<h5 id="params-2">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +<li>id:待操作的边 id</li> +</ul> +<p><strong>请求参数说明:</strong></p> +<ul> +<li>action:append 操作</li> +</ul> +<p><strong>请求体说明:</strong></p> +<ul> +<li>边信息</li> +</ul> <h5 id="method--url-2">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?action=append +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop?action=append </span></span></code></pre></div><h5 id="request-body-2">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> @@ -1660,131 +1722,130 @@ </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><blockquote> -<p>注意:属性的取值是有三种类别的,分别是single、set和list。如果是single,表示增加或更新属性值;如果是set或list,则表示追加属性值。</p> +<p>注意:属性的取值是有三种类别的,分别是 single、set 和 list。如果是 single,表示增加或更新属性值;如果是 set 或 list,则表示追加属性值</p> </blockquote> <h5 id="response-status-2">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-2">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="224-批量更新边属性">2.2.4 批量更新边属性</h4> -<h5 id="功能说明">功能说明</h5> -<p>与批量更新顶点属性类似</p> -<p>假设原边及属性为:</p> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1512835200000</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1361289600000</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> -</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><h5 id="method--url-3">Method &amp; Url</h5> +<h5 id="params-3">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +</ul> +<p><strong>请求体说明:</strong></p> +<ul> +<li>edges:边信息的列表</li> +<li>update_strategies:对于每个属性,可以单独设置其更新策略,包括: +<ul> +<li>SUM:仅支持 number 类型</li> +<li>BIGGER/SMALLER:仅支持 date/number 类型</li> +<li>UNION/INTERSECTION:仅支持 set 类型</li> +<li>APPEND/ELIMINATE:仅支持 collection 类型</li> +<li>OVERRIDE</li> +</ul> +</li> +<li>check_vertex:是否检查顶点存在 (true | false),当设置为 true 而待插入边的源顶点或目标顶点不存在时会报错,默认为 true</li> +<li>create_if_not_exist:目前只支持设定为 true</li> +</ul> +<h5 id="method--url-3">Method &amp; Url</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch </span></span></code></pre></div><h5 id="request-body-3">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">0.1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1522835200000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">0.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1301289600000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;update_strategies&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;SUM&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;BIGGER&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;update_strategies&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;SUM&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;OVERRIDE&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;check_vertex&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">false</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;create_if_not_exist&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#204a87;font-weight:bold">true</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;create_if_not_exist&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">true</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h5 id="response-status-3">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-3">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1.1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1522835200000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1301289600000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="225-删除边属性">2.2.5 删除边属性</h4> +<h5 id="params-4">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +<li>id:待操作的边 id</li> +</ul> +<p><strong>请求参数说明:</strong></p> +<ul> +<li>action:eliminate 操作</li> +</ul> +<p><strong>请求体说明:</strong></p> +<ul> +<li>边信息</li> +</ul> <h5 id="method--url-4">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?action=eliminate +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop?action=eliminate </span></span></code></pre></div><h5 id="request-body-4">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> @@ -1792,46 +1853,35 @@ </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><blockquote> -<p>注意:这里会直接删除属性(删除key和所有value),无论其属性的取值是single、set或list。</p> +<p>注意:这里会直接删除属性(删除 key 和所有 value),无论其属性的取值是 single、set 或 list</p> </blockquote> <h5 id="response-status-4">Response Status</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">400</span> </span></span></code></pre></div><h5 id="response-body-4">Response Body</h5> +<p>无法删除未设置为 nullable 的属性</p> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20170324&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;exception&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;class java.lang.IllegalArgumentException&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;message&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;Can&#39;t remove non-null edge property &#39;p[weight-&gt;1.0]&#39;&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;cause&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="226-获取符合条件的边">2.2.6 获取符合条件的边</h4> -<h5 id="params-1">Params</h5> +<h5 id="params-5">Params</h5> +<p><strong>路径参数说明:</strong></p> <ul> -<li>vertex_id: 顶点id</li> -<li>direction: 边的方向(OUT | IN | BOTH)</li> -<li>label: 边的标签</li> -<li>properties: 属性键值对(根据属性查询的前提是预先建立了索引)</li> -<li>offset:偏移,默认为0</li> -<li>limit: 查询数目,默认为100</li> -<li>page: 页号</li> +<li>graph:待操作的图</li> </ul> -<p>支持的查询有以下几种:</p> +<p><strong>请求参数说明:</strong></p> <ul> -<li>提供vertex_id参数时,不可以使用参数page,direction、label、properties可选,offset和limit可以 -限制结果范围</li> -<li>不提供vertex_id参数时,label和properties可选 -<ul> -<li>如果使用page参数,则:offset参数不可用(不填或者为0),direction不可用,properties最多只能有一个</li> -<li>如果不使用page参数,则:offset和limit可以用来限制结果范围,direction参数忽略</li> -</ul> -</li> +<li>vertex_id: 顶点 id</li> +<li>direction: 边的方向 (OUT | IN | BOTH),默认为 BOTH</li> +<li>label: 边的标签</li> +<li>properties: 属性键值对 (根据属性查询的前提是预先建立了索引)</li> +<li>keep_start_p: 默认为 false,当设置为 true 后,不会自动转义范围匹配输入的表达式,例如此时 <code>properties={&quot;age&quot;:&quot;P.gt(0.8)&quot;}</code> 会被理解为精确匹配,即 age 属性等于 &ldquo;P.gt(0.8)&rdquo;</li> +<li>offset:偏移,默认为 0</li> +<li>limit: 查询数目,默认为 100</li> +<li>page: 页号</li> </ul> -<p>属性键值对由JSON格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如<code>properties={&quot;weight&quot;:0.8}</code>,范围匹配时形如<code>properties={&quot;age&quot;:&quot;P.gt(0.8)&quot;}</code>,范围匹配支持的表达式如下:</p> +<p>属性键值对由 JSON 格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如 <code>properties={&quot;weight&quot;:0.8}</code>,范围匹配时形如 <code>properties={&quot;age&quot;:&quot;P.gt(0.8)&quot;}</code>,范围匹配支持的表达式如下:</p> <table> <thead> <tr> @@ -1842,216 +1892,188 @@ <tbody> <tr> <td>P.eq(number)</td> -<td>属性值等于number的边</td> +<td>属性值等于 number 的边</td> </tr> <tr> <td>P.neq(number)</td> -<td>属性值不等于number的边</td> +<td>属性值不等于 number 的边</td> </tr> <tr> <td>P.lt(number)</td> -<td>属性值小于number的边</td> +<td>属性值小于 number 的边</td> </tr> <tr> <td>P.lte(number)</td> -<td>属性值小于等于number的边</td> +<td>属性值小于等于 number 的边</td> </tr> <tr> <td>P.gt(number)</td> -<td>属性值大于number的边</td> +<td>属性值大于 number 的边</td> </tr> <tr> <td>P.gte(number)</td> -<td>属性值大于等于number的边</td> +<td>属性值大于等于 number 的边</td> </tr> <tr> <td>P.between(number1,number2)</td> -<td>属性值大于等于number1且小于number2的边</td> +<td>属性值大于等于 number1 且小于 number2 的边</td> </tr> <tr> <td>P.inside(number1,number2)</td> -<td>属性值大于number1且小于number2的边</td> +<td>属性值大于 number1 且小于 number2 的边</td> </tr> <tr> <td>P.outside(number1,number2)</td> -<td>属性值小于number1且大于number2的边</td> +<td>属性值小于 number1 且大于 number2 的边</td> </tr> <tr> <td>P.within(value1,value2,value3,&hellip;)</td> -<td>属性值等于任何一个给定value的边</td> +<td>属性值等于任何一个给定 value 的边</td> +</tr> +<tr> +<td>P.textcontains(value)</td> +<td>属性值包含给定 value 的边 (string 类型)</td> +</tr> +<tr> +<td>P.contains(value)</td> +<td>属性值包含给定 value 的边 (collection 类型)</td> </tr> </tbody> </table> -<p><strong>查询与顶点 person:josh(vertex_id=&ldquo;1:josh&rdquo;) 相连且 label 为 created 的边</strong></p> +<p><strong>查询与顶点 person:marko(vertex_id=&ldquo;1:marko&rdquo;) 相连且 label 为 knows 的且 date 属性等于 &ldquo;20160111&rdquo; 的边</strong></p> <h5 id="method--url-5">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id=&#34;1:josh&#34;&amp;direction=BOTH&amp;label=created&amp;properties={} +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id=&#34;1:marko&#34;&amp;label=knows&amp;properties={&#34;date&#34;:&#34;P.within(\&#34;20160111\&#34;)&#34;} </span></span></code></pre></div><h5 id="response-status-5">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-5">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20091111&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;1&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p><strong>分页查询所有边,获取第一页(page不带参数值),限定3条</strong></p> +</span></span></code></pre></div><p><strong>分页查询所有边,获取第一页(page 不带参数值),限定 2 条</strong></p> <h5 id="method--url-6">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&amp;limit=3 +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&amp;limit=2 </span></span></code></pre></div><h5 id="response-status-6">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-6">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20170324&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20091111&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p>返回的body里面是带有下一页的页号信息的,<code>&quot;page&quot;: &quot;002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&quot;</code>, -在查询下一页的时候将该值赋给page参数。</p> -<p><strong>分页查询所有边,获取下一页(page带上上一页返回的page值),限定3条</strong></p> +</span></span></code></pre></div><p>返回的 body 里面是带有下一页的页号信息的,<code>&quot;page&quot;: &quot;EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&quot;</code>,在查询下一页的时候将该值赋给 page 参数</p> +<p><strong>分页查询所有边,获取下一页(page 带上上一页返回的 page 值),限定 2 条</strong></p> <h5 id="method--url-7">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&amp;limit=3 +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&amp;limit=2 </span></span></code></pre></div><h5 id="response-status-7">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-7">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;20130220&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130220&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;20160110&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160110&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">null</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p>此时<code>&quot;page&quot;: null</code>表示已经没有下一页了 (注: 后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 <code>page</code> 值可能非空,通过该 <code>page</code> 再请求下一页数据时则返回 <code>空数据</code> 及 <code>page = null</code>,其他情况类似)</p> -<h4 id="227-根据id获取边">2.2.7 根据Id获取边</h4> +</span></span></code></pre></div><p>此时 <code>&quot;page&quot;: null</code> 表示已经没有下一页了</p> +<blockquote> +<p>注:后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 <code>page</code> 值可能非空,通过该 <code>page</code> 再请求下一页数据时则返回 <code>空数据</code> 及 <code>page = null</code>,其他情况类似</p> +</blockquote> +<h4 id="227-根据-id-获取边">2.2.7 根据 id 获取边</h4> +<h5 id="params-6">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +<li>id:待操作的边 id</li> +</ul> <h5 id="method--url-8">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop </span></span></code></pre></div><h5 id="response-status-8">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-8">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><h4 id="228-根据id删除边">2.2.8 根据Id删除边</h4> -<h5 id="params-2">Params</h5> +</span></span></code></pre></div><h4 id="228-根据-id-删除边">2.2.8 根据 id 删除边</h4> +<h5 id="params-7">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +<li>id:待操作的边 id</li> +</ul> +<p><strong>请求参数说明:</strong></p> <ul> -<li>label: 边类型,可选参数</li> +<li>label: 边的标签</li> </ul> -<p><strong>仅根据Id删除边</strong></p> +<p><strong>仅根据 id 删除边</strong></p> <h5 id="method--url-9">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop </span></span></code></pre></div><h5 id="response-status-9">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">204</span> -</span></span></code></pre></div><p><strong>根据Label+Id删除边</strong></p> -<p>通过指定Label参数和Id来删除边时,一般来说其性能比仅根据Id删除会更好。</p> +</span></span></code></pre></div><p><strong>根据 label + id 删除边</strong></p> +<p>通过指定 label 参数和 id 来删除边时,一般来说其性能比仅根据 id 删除会更好</p> <h5 id="method--url-10">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?label=person +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;1&gt;&gt;S1:vadas?label=knows </span></span></code></pre></div><h5 id="response-status-10">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">204</span> </span></span></code></pre></div>Docs: Traverser API/cn/docs/clients/restful-api/traverser/Mon, 01 Jan 0001 00:00:00 +0000/cn/docs/clients/restful-api/traverser/ diff --git a/cn/docs/index.xml b/cn/docs/index.xml index e991c72bf..bf520a0df 100644 --- a/cn/docs/index.xml +++ b/cn/docs/index.xml @@ -11390,23 +11390,62 @@ HugeGraph Toolchain 版本: toolchain-1.0.0</p> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">204</span> </span></span></code></pre></div>Docs: Edge API/cn/docs/clients/restful-api/edge/Mon, 01 Jan 0001 00:00:00 +0000/cn/docs/clients/restful-api/edge/ <h3 id="22-edge">2.2 Edge</h3> -<p>顶点 id 格式的修改也影响到了边的 Id 以及源顶点和目标顶点 id 的格式。</p> -<p>EdgeId是由 <code>src-vertex-id + direction + label + sort-values + tgt-vertex-id</code> 拼接而成, -但是这里的顶点id类型不是通过引号区分的,而是根据前缀区分:</p> +<p>顶点 id 格式的修改也影响到了边的 id 以及源顶点和目标顶点 id 的格式</p> +<p>EdgeId 是由 <code>src-vertex-id + direction + label + sort-values + tgt-vertex-id</code> 拼接而成,但是这里的顶点 id 类型不是通过引号区分的,而是根据前缀区分:</p> <ul> -<li>当 id 类型为 number 时,EdgeId 的顶点 id 前有一个前缀<code>L</code> ,形如 &ldquo;L123456&gt;1&raquo;L987654&rdquo;</li> -<li>当 id 类型为 string 时,EdgeId 的顶点 id 前有一个前缀<code>S</code> ,形如 &ldquo;S1:peter&gt;1&raquo;S2:lop&rdquo;</li> +<li>当 id 类型为 number 时,EdgeId 的顶点 id 前有一个前缀 <code>L</code> ,形如 &ldquo;L123456&gt;1&raquo;L987654&rdquo;</li> +<li>当 id 类型为 string 时,EdgeId 的顶点 id 前有一个前缀 <code>S</code> ,形如 &ldquo;S1:peter&gt;1&raquo;S2:lop&rdquo;</li> </ul> <hr> -<p>接下来的示例均假设已经创建好了前述的各种schema和vertex信息</p> -<h4 id="221-创建一条边">2.2.1 创建一条边</h4> -<p>Params说明</p> +<p>接下来的示例需要先根据以下 <code>groovy</code> 脚本创建图 <code>schema</code></p> +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-groovy" data-lang="groovy"><span style="display:flex;"><span><span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000">org.apache.hugegraph.HugeFactory</span> +</span></span><span style="display:flex;"><span><span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000">org.apache.tinkerpop.gremlin.structure.T</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">conf</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;conf/graphs/hugegraph.properties&#34;</span> +</span></span><span style="display:flex;"><span><span style="color:#000">graph</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">HugeFactory</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">open</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">conf</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">schema</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asInt</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asDouble</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asInt</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">vertexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">primaryKeys</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">vertexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">primaryKeys</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;personByCity&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;personByAgeAndCity&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;softwareByPrice&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">edgeLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">sourceLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">targetLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">edgeLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">sourceLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">targetLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;createdByDate&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;createdByWeight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knowsByWeight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">marko</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;marko&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">29</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Beijing&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">vadas</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;vadas&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">27</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Hongkong&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">lop</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lop&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;java&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">328</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">josh</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;josh&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">32</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Beijing&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">ripple</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;ripple&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;java&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">199</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">peter</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;peter&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">35</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Shanghai&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">tx</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">commit</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">g</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">traversal</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span></code></pre></div><h4 id="221-创建一条边">2.2.1 创建一条边</h4> +<h5 id="params">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +</ul> +<p><strong>请求体说明:</strong></p> <ul> <li>label:边类型名称,必填</li> -<li>outV:源顶点id,必填</li> -<li>inV:目标顶点id,必填</li> -<li>outVLabel:源顶点类型。必填</li> -<li>inVLabel:目标顶点类型。必填</li> +<li>outV:源顶点 id,必填</li> +<li>inV:目标顶点 id,必填</li> +<li>outVLabel:源顶点类型,必填</li> +<li>inVLabel:目标顶点类型,必填</li> <li>properties: 边关联的属性,对象内部结构为: <ol> <li>name:属性名称</li> @@ -11419,60 +11458,69 @@ HugeGraph Toolchain 版本: toolchain-1.0.0</p> </span></span></code></pre></div><h5 id="request-body">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h5 id="response-status">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">201</span> </span></span></code></pre></div><h5 id="response-body">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="222-创建多条边">2.2.2 创建多条边</h4> -<h5 id="params">Params</h5> +<h5 id="params-1">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +</ul> +<p><strong>请求参数说明:</strong></p> <ul> -<li>check_vertex: 是否检查顶点存在(true | false),当设置为 true 而待插入边的源顶点或目标顶点不存在时会报错。</li> +<li>check_vertex:是否检查顶点存在 (true | false),当设置为 true 而待插入边的源顶点或目标顶点不存在时会报错,默认为 true</li> +</ul> +<p><strong>请求体说明:</strong></p> +<ul> +<li>边信息的列表</li> </ul> <h5 id="method--url-1">Method &amp; Url</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>POST http://localhost:8080/graphs/hugegraph/graph/edges/batch </span></span></code></pre></div><h5 id="request-body-1">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160110&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2016-01-10&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130220&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">]</span> @@ -11480,12 +11528,26 @@ HugeGraph Toolchain 版本: toolchain-1.0.0</p> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">201</span> </span></span></code></pre></div><h5 id="response-body-1">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">[</span> -</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S1:vadas&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">]</span> </span></span></code></pre></div><h4 id="223-更新边属性">2.2.3 更新边属性</h4> +<h5 id="params-2">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +<li>id:待操作的边 id</li> +</ul> +<p><strong>请求参数说明:</strong></p> +<ul> +<li>action:append 操作</li> +</ul> +<p><strong>请求体说明:</strong></p> +<ul> +<li>边信息</li> +</ul> <h5 id="method--url-2">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?action=append +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop?action=append </span></span></code></pre></div><h5 id="request-body-2">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> @@ -11493,131 +11555,130 @@ HugeGraph Toolchain 版本: toolchain-1.0.0</p> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><blockquote> -<p>注意:属性的取值是有三种类别的,分别是single、set和list。如果是single,表示增加或更新属性值;如果是set或list,则表示追加属性值。</p> +<p>注意:属性的取值是有三种类别的,分别是 single、set 和 list。如果是 single,表示增加或更新属性值;如果是 set 或 list,则表示追加属性值</p> </blockquote> <h5 id="response-status-2">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-2">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="224-批量更新边属性">2.2.4 批量更新边属性</h4> -<h5 id="功能说明">功能说明</h5> -<p>与批量更新顶点属性类似</p> -<p>假设原边及属性为:</p> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1512835200000</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1361289600000</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> -</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><h5 id="method--url-3">Method &amp; Url</h5> +<h5 id="params-3">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +</ul> +<p><strong>请求体说明:</strong></p> +<ul> +<li>edges:边信息的列表</li> +<li>update_strategies:对于每个属性,可以单独设置其更新策略,包括: +<ul> +<li>SUM:仅支持 number 类型</li> +<li>BIGGER/SMALLER:仅支持 date/number 类型</li> +<li>UNION/INTERSECTION:仅支持 set 类型</li> +<li>APPEND/ELIMINATE:仅支持 collection 类型</li> +<li>OVERRIDE</li> +</ul> +</li> +<li>check_vertex:是否检查顶点存在 (true | false),当设置为 true 而待插入边的源顶点或目标顶点不存在时会报错,默认为 true</li> +<li>create_if_not_exist:目前只支持设定为 true</li> +</ul> +<h5 id="method--url-3">Method &amp; Url</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch </span></span></code></pre></div><h5 id="request-body-3">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">0.1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1522835200000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">0.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1301289600000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;update_strategies&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;SUM&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;BIGGER&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;update_strategies&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;SUM&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;OVERRIDE&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;check_vertex&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">false</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;create_if_not_exist&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#204a87;font-weight:bold">true</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;create_if_not_exist&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">true</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h5 id="response-status-3">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-3">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1.1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1522835200000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1301289600000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="225-删除边属性">2.2.5 删除边属性</h4> +<h5 id="params-4">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +<li>id:待操作的边 id</li> +</ul> +<p><strong>请求参数说明:</strong></p> +<ul> +<li>action:eliminate 操作</li> +</ul> +<p><strong>请求体说明:</strong></p> +<ul> +<li>边信息</li> +</ul> <h5 id="method--url-4">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?action=eliminate +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop?action=eliminate </span></span></code></pre></div><h5 id="request-body-4">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> @@ -11625,46 +11686,35 @@ HugeGraph Toolchain 版本: toolchain-1.0.0</p> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><blockquote> -<p>注意:这里会直接删除属性(删除key和所有value),无论其属性的取值是single、set或list。</p> +<p>注意:这里会直接删除属性(删除 key 和所有 value),无论其属性的取值是 single、set 或 list</p> </blockquote> <h5 id="response-status-4">Response Status</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">400</span> </span></span></code></pre></div><h5 id="response-body-4">Response Body</h5> +<p>无法删除未设置为 nullable 的属性</p> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20170324&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;exception&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;class java.lang.IllegalArgumentException&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;message&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;Can&#39;t remove non-null edge property &#39;p[weight-&gt;1.0]&#39;&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;cause&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="226-获取符合条件的边">2.2.6 获取符合条件的边</h4> -<h5 id="params-1">Params</h5> +<h5 id="params-5">Params</h5> +<p><strong>路径参数说明:</strong></p> <ul> -<li>vertex_id: 顶点id</li> -<li>direction: 边的方向(OUT | IN | BOTH)</li> -<li>label: 边的标签</li> -<li>properties: 属性键值对(根据属性查询的前提是预先建立了索引)</li> -<li>offset:偏移,默认为0</li> -<li>limit: 查询数目,默认为100</li> -<li>page: 页号</li> +<li>graph:待操作的图</li> </ul> -<p>支持的查询有以下几种:</p> -<ul> -<li>提供vertex_id参数时,不可以使用参数page,direction、label、properties可选,offset和limit可以 -限制结果范围</li> -<li>不提供vertex_id参数时,label和properties可选 +<p><strong>请求参数说明:</strong></p> <ul> -<li>如果使用page参数,则:offset参数不可用(不填或者为0),direction不可用,properties最多只能有一个</li> -<li>如果不使用page参数,则:offset和limit可以用来限制结果范围,direction参数忽略</li> -</ul> -</li> +<li>vertex_id: 顶点 id</li> +<li>direction: 边的方向 (OUT | IN | BOTH),默认为 BOTH</li> +<li>label: 边的标签</li> +<li>properties: 属性键值对 (根据属性查询的前提是预先建立了索引)</li> +<li>keep_start_p: 默认为 false,当设置为 true 后,不会自动转义范围匹配输入的表达式,例如此时 <code>properties={&quot;age&quot;:&quot;P.gt(0.8)&quot;}</code> 会被理解为精确匹配,即 age 属性等于 &ldquo;P.gt(0.8)&rdquo;</li> +<li>offset:偏移,默认为 0</li> +<li>limit: 查询数目,默认为 100</li> +<li>page: 页号</li> </ul> -<p>属性键值对由JSON格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如<code>properties={&quot;weight&quot;:0.8}</code>,范围匹配时形如<code>properties={&quot;age&quot;:&quot;P.gt(0.8)&quot;}</code>,范围匹配支持的表达式如下:</p> +<p>属性键值对由 JSON 格式的属性名称和属性值组成,允许多个属性键值对作为查询条件,属性值支持精确匹配和范围匹配,精确匹配时形如 <code>properties={&quot;weight&quot;:0.8}</code>,范围匹配时形如 <code>properties={&quot;age&quot;:&quot;P.gt(0.8)&quot;}</code>,范围匹配支持的表达式如下:</p> <table> <thead> <tr> @@ -11675,216 +11725,188 @@ HugeGraph Toolchain 版本: toolchain-1.0.0</p> <tbody> <tr> <td>P.eq(number)</td> -<td>属性值等于number的边</td> +<td>属性值等于 number 的边</td> </tr> <tr> <td>P.neq(number)</td> -<td>属性值不等于number的边</td> +<td>属性值不等于 number 的边</td> </tr> <tr> <td>P.lt(number)</td> -<td>属性值小于number的边</td> +<td>属性值小于 number 的边</td> </tr> <tr> <td>P.lte(number)</td> -<td>属性值小于等于number的边</td> +<td>属性值小于等于 number 的边</td> </tr> <tr> <td>P.gt(number)</td> -<td>属性值大于number的边</td> +<td>属性值大于 number 的边</td> </tr> <tr> <td>P.gte(number)</td> -<td>属性值大于等于number的边</td> +<td>属性值大于等于 number 的边</td> </tr> <tr> <td>P.between(number1,number2)</td> -<td>属性值大于等于number1且小于number2的边</td> +<td>属性值大于等于 number1 且小于 number2 的边</td> </tr> <tr> <td>P.inside(number1,number2)</td> -<td>属性值大于number1且小于number2的边</td> +<td>属性值大于 number1 且小于 number2 的边</td> </tr> <tr> <td>P.outside(number1,number2)</td> -<td>属性值小于number1且大于number2的边</td> +<td>属性值小于 number1 且大于 number2 的边</td> </tr> <tr> <td>P.within(value1,value2,value3,&hellip;)</td> -<td>属性值等于任何一个给定value的边</td> +<td>属性值等于任何一个给定 value 的边</td> +</tr> +<tr> +<td>P.textcontains(value)</td> +<td>属性值包含给定 value 的边 (string 类型)</td> +</tr> +<tr> +<td>P.contains(value)</td> +<td>属性值包含给定 value 的边 (collection 类型)</td> </tr> </tbody> </table> -<p><strong>查询与顶点 person:josh(vertex_id=&ldquo;1:josh&rdquo;) 相连且 label 为 created 的边</strong></p> +<p><strong>查询与顶点 person:marko(vertex_id=&ldquo;1:marko&rdquo;) 相连且 label 为 knows 的且 date 属性等于 &ldquo;20160111&rdquo; 的边</strong></p> <h5 id="method--url-5">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id=&#34;1:josh&#34;&amp;direction=BOTH&amp;label=created&amp;properties={} +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id=&#34;1:marko&#34;&amp;label=knows&amp;properties={&#34;date&#34;:&#34;P.within(\&#34;20160111\&#34;)&#34;} </span></span></code></pre></div><h5 id="response-status-5">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-5">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20091111&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;1&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p><strong>分页查询所有边,获取第一页(page不带参数值),限定3条</strong></p> +</span></span></code></pre></div><p><strong>分页查询所有边,获取第一页(page 不带参数值),限定 2 条</strong></p> <h5 id="method--url-6">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&amp;limit=3 +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&amp;limit=2 </span></span></code></pre></div><h5 id="response-status-6">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-6">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20170324&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20091111&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p>返回的body里面是带有下一页的页号信息的,<code>&quot;page&quot;: &quot;002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&quot;</code>, -在查询下一页的时候将该值赋给page参数。</p> -<p><strong>分页查询所有边,获取下一页(page带上上一页返回的page值),限定3条</strong></p> +</span></span></code></pre></div><p>返回的 body 里面是带有下一页的页号信息的,<code>&quot;page&quot;: &quot;EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&quot;</code>,在查询下一页的时候将该值赋给 page 参数</p> +<p><strong>分页查询所有边,获取下一页(page 带上上一页返回的 page 值),限定 2 条</strong></p> <h5 id="method--url-7">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&amp;limit=3 +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&amp;limit=2 </span></span></code></pre></div><h5 id="response-status-7">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-7">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;20130220&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130220&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;20160110&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160110&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">null</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p>此时<code>&quot;page&quot;: null</code>表示已经没有下一页了 (注: 后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 <code>page</code> 值可能非空,通过该 <code>page</code> 再请求下一页数据时则返回 <code>空数据</code> 及 <code>page = null</code>,其他情况类似)</p> -<h4 id="227-根据id获取边">2.2.7 根据Id获取边</h4> +</span></span></code></pre></div><p>此时 <code>&quot;page&quot;: null</code> 表示已经没有下一页了</p> +<blockquote> +<p>注:后端为 Cassandra 时,为了性能考虑,返回页恰好为最后一页时,返回 <code>page</code> 值可能非空,通过该 <code>page</code> 再请求下一页数据时则返回 <code>空数据</code> 及 <code>page = null</code>,其他情况类似</p> +</blockquote> +<h4 id="227-根据-id-获取边">2.2.7 根据 id 获取边</h4> +<h5 id="params-6">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +<li>id:待操作的边 id</li> +</ul> <h5 id="method--url-8">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop </span></span></code></pre></div><h5 id="response-status-8">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-8">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><h4 id="228-根据id删除边">2.2.8 根据Id删除边</h4> -<h5 id="params-2">Params</h5> +</span></span></code></pre></div><h4 id="228-根据-id-删除边">2.2.8 根据 id 删除边</h4> +<h5 id="params-7">Params</h5> +<p><strong>路径参数说明:</strong></p> +<ul> +<li>graph:待操作的图</li> +<li>id:待操作的边 id</li> +</ul> +<p><strong>请求参数说明:</strong></p> <ul> -<li>label: 边类型,可选参数</li> +<li>label: 边的标签</li> </ul> -<p><strong>仅根据Id删除边</strong></p> +<p><strong>仅根据 id 删除边</strong></p> <h5 id="method--url-9">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop </span></span></code></pre></div><h5 id="response-status-9">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">204</span> -</span></span></code></pre></div><p><strong>根据Label+Id删除边</strong></p> -<p>通过指定Label参数和Id来删除边时,一般来说其性能比仅根据Id删除会更好。</p> +</span></span></code></pre></div><p><strong>根据 label + id 删除边</strong></p> +<p>通过指定 label 参数和 id 来删除边时,一般来说其性能比仅根据 id 删除会更好</p> <h5 id="method--url-10">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?label=person +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;1&gt;&gt;S1:vadas?label=knows </span></span></code></pre></div><h5 id="response-status-10">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">204</span> </span></span></code></pre></div>Docs: HugeGraph 0.5 Release Notes/cn/docs/changelog/hugegraph-0.5.6-release-notes/Mon, 01 Jan 0001 00:00:00 +0000/cn/docs/changelog/hugegraph-0.5.6-release-notes/ diff --git a/cn/sitemap.xml b/cn/sitemap.xml index 31f4c1262..4bd4cade3 100644 --- a/cn/sitemap.xml +++ b/cn/sitemap.xml @@ -1 +1 @@ -/cn/docs/guides/architectural/2023-06-25T21:06:07+08:00/cn/docs/config/config-guide/2023-06-21T14:48:04+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-06-25T21:06:07+08:00/cn/docs/introduction/readme/2023-06-18T14:57:33+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/2023-05-14T19:35:13+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-06-26T14:59:53+08:00/cn/docs/config/config-option/2023-02-08T20:56:09+08:00/cn/docs/guides/desgin-concept/2022-04-17T11:36:55+08:00/cn/docs/download/download/2023-06-17T14:43:04+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/2023-06-17T14:43:04+08:00/cn/docs/quickstart/hugegraph-loader/2023-05-17T23:12:35+08:00/cn/docs/clients/restful-api/propertykey/2023-05-19T05:15:56-05: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/2023-06-17T14:43:04+08:00/cn/docs/config/config-authentication/2022-04-17T11:36:55+08:00/cn/docs/clients/gremlin-console/2023-06-12T23:52:07+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-05-09T21:27:34+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/clients/restful-api/vertexlabel/2022-04-17T11:36:55+08:00/cn/docs/contribution-guidelines/validate-release/2023-02-15T16:14:21+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/quickstart/hugegraph-hubble/2023-01-01T16:16:43+08:00/cn/docs/contribution-guidelines/hugegraph-server-idea-setup/2023-06-25T21:06:07+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-05-18T11:09:55+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-06-25T21:06:46+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/2023-06-04T23:04:47+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-06-25T21:06:07+08:00/cn/docs/config/config-guide/2023-06-21T14:48:04+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-06-25T21:06:07+08:00/cn/docs/introduction/readme/2023-06-18T14:57:33+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/2023-05-14T19:35:13+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-06-26T14:59:53+08:00/cn/docs/config/config-option/2023-02-08T20:56:09+08:00/cn/docs/guides/desgin-concept/2022-04-17T11:36:55+08:00/cn/docs/download/download/2023-06-17T14:43:04+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/2023-06-17T14:43:04+08:00/cn/docs/quickstart/hugegraph-loader/2023-05-17T23:12:35+08:00/cn/docs/clients/restful-api/propertykey/2023-05-19T05:15:56-05: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/2023-06-17T14:43:04+08:00/cn/docs/config/config-authentication/2022-04-17T11:36:55+08:00/cn/docs/clients/gremlin-console/2023-06-12T23:52:07+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-05-09T21:27:34+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/clients/restful-api/vertexlabel/2022-04-17T11:36:55+08:00/cn/docs/contribution-guidelines/validate-release/2023-02-15T16:14:21+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/quickstart/hugegraph-hubble/2023-01-01T16:16:43+08:00/cn/docs/contribution-guidelines/hugegraph-server-idea-setup/2023-06-25T21:06:07+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-05-18T11:09:55+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-06-25T21:06:46+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/2023-06-04T23:04:47+08:00/cn/docs/clients/restful-api/edge/2023-06-29T10:17:29+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 064f987f7..c1191add6 100644 --- a/docs/_print/index.html +++ b/docs/_print/index.html @@ -2915,337 +2915,283 @@
Response Status
204
 

Delete Vertex by Label+ID

When deleting a vertex by specifying both the Label parameter and the ID, it generally offers better performance compared to deleting by ID alone.

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/vertices/"1:marko"?label=person
 
Response Status
204
-

5.1.8 - Edge API

2.2 Edge

The modification of the vertex ID format also affects the ID of the edge, as well as the formats of the source vertex and target vertex IDs.

The EdgeId is formed by concatenating src-vertex-id + direction + label + sort-values + tgt-vertex-id, but the vertex ID types are not distinguished by quotation marks here. Instead, they are distinguished by prefixes:


The following examples assume that various schemas and vertex information mentioned above have been created.

2.2.1 Creating an Edge

Params Explanation

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
+

5.1.8 - Edge API

2.2 Edge

The modification of the vertex ID format also affects the ID of the edge, as well as the formats of the source vertex and target vertex IDs.

The EdgeId is formed by concatenating src-vertex-id + direction + label + sort-values + tgt-vertex-id, but the vertex ID types are not distinguished by quotation marks here. Instead, they are distinguished by prefixes:


The following example requires creating a graph schema based on the following groovy script:

import org.apache.hugegraph.HugeFactory
+import org.apache.tinkerpop.gremlin.structure.T
+
+conf = "conf/graphs/hugegraph.properties"
+graph = HugeFactory.open(conf)
+schema = graph.schema()
+
+schema.propertyKey("name").asText().ifNotExist().create()
+schema.propertyKey("age").asInt().ifNotExist().create()
+schema.propertyKey("city").asText().ifNotExist().create()
+schema.propertyKey("weight").asDouble().ifNotExist().create()
+schema.propertyKey("lang").asText().ifNotExist().create()
+schema.propertyKey("date").asText().ifNotExist().create()
+schema.propertyKey("price").asInt().ifNotExist().create()
+
+schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create()
+schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create()
+schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create()
+schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create()
+schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create()
+schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create()
+schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create()
+schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create()
+schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create()
+schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create()
+
+marko = graph.addVertex(T.label, "person", "name", "marko", "age", 29, "city", "Beijing")
+vadas = graph.addVertex(T.label, "person", "name", "vadas", "age", 27, "city", "Hongkong")
+lop = graph.addVertex(T.label, "software", "name", "lop", "lang", "java", "price", 328)
+josh = graph.addVertex(T.label, "person", "name", "josh", "age", 32, "city", "Beijing")
+ripple = graph.addVertex(T.label, "software", "name", "ripple", "lang", "java", "price", 199)
+peter = graph.addVertex(T.label, "person", "name", "peter", "age", 35, "city", "Shanghai")
+
+graph.tx().commit()
+g = graph.traversal()
+

2.2.1 Creating an Edge

Params

Path Parameter Description:

Request Body Description:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
 
Request Body
{
     "label": "created",
-    "outV": "1:peter",
+    "outV": "1:marko",
     "inV": "2:lop",
     "outVLabel": "person",
     "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "date": "20171210",
+        "weight": 0.4
     }
 }
 
Response Status
201
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 0.4,
+        "date": "20171210"
     }
 }
-

2.2.2 Creating Multiple Edges

Params
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
+

2.2.2 Creating Multiple Edges

Params

Path Parameter Description:

Request Parameter Description:

Request Body Description:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
[
     {
-        "label": "created",
-        "outV": "1:peter",
-        "inV": "2:lop",
+        "label": "knows",
+        "outV": "1:marko",
+        "inV": "1:vadas",
         "outVLabel": "person",
-        "inVLabel": "software",
+        "inVLabel": "person",
         "properties": {
-            "date": "2017-5-18",
-            "weight": 0.2
+            "date": "20160110",
+            "weight": 0.5
         }
     },
     {
         "label": "knows",
         "outV": "1:marko",
-        "inV": "1:vadas",
+        "inV": "1:josh",
         "outVLabel": "person",
         "inVLabel": "person",
         "properties": {
-            "date": "2016-01-10",
-            "weight": 0.5
+            "date": "20130220",
+            "weight": 1.0
         }
     }
 ]
 
Response Status
201
 
Response Body
[
-    "S1:peter>1>>S2:lop",
-    "S1:marko>2>>S1:vadas"
+    "S1:marko>1>>S1:vadas",
+    "S1:marko>1>>S1:josh"
 ]
-

2.2.3 Updating Edge Properties

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=append
+

2.2.3 Updating Edge Properties

Params

Path Parameter Description:

Request Parameter Description:

Request Body Description:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=append
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

Note: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.

Response Status
200
+

NOTE: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.

Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 1
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.4 Batch Updating Edge Properties

Function Description

Similar to batch updating vertex properties.

Assuming the original edge and its properties are:

{
-    "edges":[
-        {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1,
-                "date":1512835200000
-            }
-        },
-        {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1,
-                "date":1361289600000
-            }
-        }
-    ]
-}
-
Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
+

2.2.4 Batch Updating Edge Properties

Params

Path Parameter Description:

Request Body Description:

Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":0.1,
-                "date":1522835200000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:vadas",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20160111",
+                "weight": 1.0
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":0.2,
-                "date":1301289600000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:josh",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20130221",
+                "weight": 0.5
             }
         }
     ],
-    "update_strategies":{
-        "weight":"SUM",
-        "date":"BIGGER"
+    "update_strategies": {
+        "weight": "SUM",
+        "date": "OVERRIDE"
     },
     "check_vertex": false,
-    "create_if_not_exist":true
+    "create_if_not_exist": true
 }
 
Response Status
200
 
Response Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1.1,
-                "date":1522835200000
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:vadas",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20160111"
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1.2,
-                "date":1301289600000
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         }
     ]
 }
-

2.2.5 Deleting Edge Properties

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=eliminate
+

2.2.5 Deleting Edge Properties

Params

Path Parameter Description:

Request Parameter Description:

Request Body Description:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=eliminate
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

Note: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.

Response Status
200
-
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
-    "label": "created",
-    "type": "edge",
-    "inVLabel": "software",
-    "outVLabel": "person",
-    "inV": "2:lop",
-    "outV": "1:peter",
-    "properties": {
-        "date": "20170324"
-    }
+

NOTE: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.

Response Status
400
+
Response Body

It is not possible to delete an attribute that is not set as nullable.

{
+    "exception": "class java.lang.IllegalArgumentException",
+    "message": "Can't remove non-null edge property 'p[weight->1.0]'",
+    "cause": ""
 }
-

2.2.6 Fetching Edges that Match the Criteria

Params

The supported query options are as follows:

Property key-value pairs consist of the attribute name and attribute value in JSON format. Multiple property key-value pairs are allowed as query conditions. The attribute value supports exact matching, range matching, and fuzzy matching. For exact matching, it is in the form properties={"weight": 0.8}. For range matching, it is in the form properties={"age": "P.gt(0.8)"}. For fuzzy matching, it is in the form properties={"city": "P.textcontains("ChengDu China")}. The supported expressions for range matching are as follows:

ExpressionDescription
P.eq(number)Edges with attribute value equal to number
P.neq(number)Edges with attribute value not equal to number
P.lt(number)Edges with attribute value less than number
P.lte(number)Edges with attribute value less than or equal to number
P.gt(number)Edges with attribute value greater than number
P.gte(number)Edges with attribute value greater than or equal to number
P.between(number1, number2)Edges with attribute value greater than or equal to number1 and less than number2
P.inside(number1, number2)Edges with attribute value greater than number1 and less than number2
P.outside(number1, number2)Edges with attribute value less than number1 and greater than number2
P.within(value1, value2, value3, …)Edges with attribute value equal to any of the given values

Query for edges connected to vertex person:josh (vertex_id=“1:josh”) with label created

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:josh"&direction=BOTH&label=created&properties={}
+

2.2.6 Fetching Edges that Match the Criteria

Params

Path Parameter:

Request Parameters:

Key-value pairs of properties consist of the property name and value in JSON format. Multiple key-value pairs are allowed as query conditions. Property values support exact matching and range matching. For exact matching, it is in the form properties={"weight":0.8}. For range matching, it is in the form properties={"age":"P.gt(0.8)"}. The expressions supported by range matching are as follows:

ExpressionDescription
P.eq(number)Edges with property value equal to number
P.neq(number)Edges with property value not equal to number
P.lt(number)Edges with property value less than number
P.lte(number)Edges with property value less than or equal to number
P.gt(number)Edges with property value greater than number
P.gte(number)Edges with property value greater than or equal to number
P.between(number1,number2)Edges with property value greater than or equal to number1 and less than number2
P.inside(number1,number2)Edges with property value greater than number1 and less than number2
P.outside(number1,number2)Edges with property value less than number1 and greater than number2
P.within(value1,value2,value3,…)Edges with property value equal to any of the given values
P.textcontains(value)Edges with property value containing the given value (string type)
P.contains(value)Edges with property value containing the given value (collection type)

Edges connected to the vertex person:marko(vertex_id=“1:marko”) with label knows and date property equal to “20160111”

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:marko"&label=knows&properties={"date":"P.within(\"20160111\")"}
 
Response Status
200
 
Response Body
{
     "edges": [
         {
-            "id": "S1:josh>1>>S2:lop",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:lop",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20091111",
-                "weight": 0.4
+                "weight": 1.5,
+                "date": "20160111"
+            }
+        }
+    ]
+}
+

Paginate and retrieve all edges, get the first page (page without parameter value), limit to 2 entries

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=2
+
Response Status
200
+
Response Body
{
+    "edges": [
+        {
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         },
         {
-            "id": "S1:josh>1>>S2:ripple",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:ripple",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20171210",
-                "weight": 1
+                "weight": 1.5,
+                "date": "20160111"
             }
         }
-    ]
-}
-

Paginated query for all edges, fetching the first page (page without a parameter value), limited to 3 records

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=3
-
Response Status
200
-
Response Body
{
-	"edges": [{
-			"id": "S1:peter>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:peter",
-			"properties": {
-				"weight": 0.2,
-				"date": "20170324"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 0.4,
-				"date": "20091111"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:ripple",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:ripple",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 1,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004"
+    ],
+    "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC"
 }
-

The returned body contains the information of the next page, "page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004". When querying the next page, assign this value to the page parameter.

Paginated query for all edges, fetching the next page (page with the value returned from the previous page), limited to 3 records

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&limit=3
+

The returned body contains the page number information for the next page, "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC". When querying the next page, assign this value to the page parameter.

Paginate and retrieve all edges, get the next page (include the page value returned from the previous page), limit to 2 entries

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&limit=2
 
Response Status
200
 
Response Body
{
-	"edges": [{
-			"id": "S1:marko>1>20130220>S1:josh",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:josh",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 1,
-				"date": "20130220"
-			}
-		},
-		{
-			"id": "S1:marko>1>20160110>S1:vadas",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:vadas",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.5,
-				"date": "20160110"
-			}
-		},
-		{
-			"id": "S1:marko>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.4,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": null
+    "edges": [
+        {
+            "id": "S1:marko>2>>S2:lop",
+            "label": "created",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "2:lop",
+            "inVLabel": "software",
+            "properties": {
+                "weight": 1.0,
+                "date": "20171210"
+            }
+        }
+    ],
+    "page": null
 }
-

When "page": null is returned, it indicates that there are no more pages available. (Note: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the page value may not be empty. When requesting the next page data using that page value, it will return empty data and page = null. Similar situations apply for other cases.)

2.2.7 Fetching Edge by ID

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

When "page": null is returned, it indicates that there are no more pages available.

NOTE: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the page value may not be empty. When requesting the next page data using that page value, it will return empty data and page = null. Similar situations apply for other cases.

2.2.7 Fetching Edge by ID

Params

Path parameter description:

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.8 Deleting Edge by ID

Params

Deleting Edge by ID only

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

2.2.8 Deleting Edge by ID

Params

Path parameter description:

Request parameter description:

Deleting Edge by ID only

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
204
-

Deleting Edge by Label+ID

In general, specifying the Label parameter along with the ID to delete an edge will provide better performance compared to deleting by ID only.

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?label=person
+

Deleting Edge by Label + ID

In general, specifying the Label parameter along with the ID to delete an edge will provide better performance compared to deleting by ID only.

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>1>>S1:vadas?label=knows
 
Response Status
204
 

5.1.9 - Traverser API

3.1 Overview of Traverser API

HugeGraphServer provides a RESTful API interface for the HugeGraph graph database. In addition to the basic CRUD operations for vertices and edges, it also offers several traversal methods, which we refer to as the traverser API. These traversal methods implement various complex graph algorithms, making it convenient for users to analyze and explore the graph.

The Traverser API supported by HugeGraph includes:

3.2 Detailed Explanation of Traverser API

In the following, we provide a detailed explanation of the Traverser API:

3.2 Detailed Explanation of Traverser API

The usage examples provided in this section are based on the graph presented on the TinkerPop official website:

tinkerpop example graph

The data import program is as follows:

public class Loader {
     public static void main(String[] args) {
diff --git a/docs/clients/_print/index.html b/docs/clients/_print/index.html
index 10ee63a2d..12c5096ef 100644
--- a/docs/clients/_print/index.html
+++ b/docs/clients/_print/index.html
@@ -1181,337 +1181,283 @@
 
Response Status
204
 

Delete Vertex by Label+ID

When deleting a vertex by specifying both the Label parameter and the ID, it generally offers better performance compared to deleting by ID alone.

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/vertices/"1:marko"?label=person
 
Response Status
204
-

1.8 - Edge API

2.2 Edge

The modification of the vertex ID format also affects the ID of the edge, as well as the formats of the source vertex and target vertex IDs.

The EdgeId is formed by concatenating src-vertex-id + direction + label + sort-values + tgt-vertex-id, but the vertex ID types are not distinguished by quotation marks here. Instead, they are distinguished by prefixes:


The following examples assume that various schemas and vertex information mentioned above have been created.

2.2.1 Creating an Edge

Params Explanation

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
+

1.8 - Edge API

2.2 Edge

The modification of the vertex ID format also affects the ID of the edge, as well as the formats of the source vertex and target vertex IDs.

The EdgeId is formed by concatenating src-vertex-id + direction + label + sort-values + tgt-vertex-id, but the vertex ID types are not distinguished by quotation marks here. Instead, they are distinguished by prefixes:


The following example requires creating a graph schema based on the following groovy script:

import org.apache.hugegraph.HugeFactory
+import org.apache.tinkerpop.gremlin.structure.T
+
+conf = "conf/graphs/hugegraph.properties"
+graph = HugeFactory.open(conf)
+schema = graph.schema()
+
+schema.propertyKey("name").asText().ifNotExist().create()
+schema.propertyKey("age").asInt().ifNotExist().create()
+schema.propertyKey("city").asText().ifNotExist().create()
+schema.propertyKey("weight").asDouble().ifNotExist().create()
+schema.propertyKey("lang").asText().ifNotExist().create()
+schema.propertyKey("date").asText().ifNotExist().create()
+schema.propertyKey("price").asInt().ifNotExist().create()
+
+schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create()
+schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create()
+schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create()
+schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create()
+schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create()
+schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create()
+schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create()
+schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create()
+schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create()
+schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create()
+
+marko = graph.addVertex(T.label, "person", "name", "marko", "age", 29, "city", "Beijing")
+vadas = graph.addVertex(T.label, "person", "name", "vadas", "age", 27, "city", "Hongkong")
+lop = graph.addVertex(T.label, "software", "name", "lop", "lang", "java", "price", 328)
+josh = graph.addVertex(T.label, "person", "name", "josh", "age", 32, "city", "Beijing")
+ripple = graph.addVertex(T.label, "software", "name", "ripple", "lang", "java", "price", 199)
+peter = graph.addVertex(T.label, "person", "name", "peter", "age", 35, "city", "Shanghai")
+
+graph.tx().commit()
+g = graph.traversal()
+

2.2.1 Creating an Edge

Params

Path Parameter Description:

Request Body Description:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
 
Request Body
{
     "label": "created",
-    "outV": "1:peter",
+    "outV": "1:marko",
     "inV": "2:lop",
     "outVLabel": "person",
     "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "date": "20171210",
+        "weight": 0.4
     }
 }
 
Response Status
201
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 0.4,
+        "date": "20171210"
     }
 }
-

2.2.2 Creating Multiple Edges

Params
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
+

2.2.2 Creating Multiple Edges

Params

Path Parameter Description:

Request Parameter Description:

Request Body Description:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
[
     {
-        "label": "created",
-        "outV": "1:peter",
-        "inV": "2:lop",
+        "label": "knows",
+        "outV": "1:marko",
+        "inV": "1:vadas",
         "outVLabel": "person",
-        "inVLabel": "software",
+        "inVLabel": "person",
         "properties": {
-            "date": "2017-5-18",
-            "weight": 0.2
+            "date": "20160110",
+            "weight": 0.5
         }
     },
     {
         "label": "knows",
         "outV": "1:marko",
-        "inV": "1:vadas",
+        "inV": "1:josh",
         "outVLabel": "person",
         "inVLabel": "person",
         "properties": {
-            "date": "2016-01-10",
-            "weight": 0.5
+            "date": "20130220",
+            "weight": 1.0
         }
     }
 ]
 
Response Status
201
 
Response Body
[
-    "S1:peter>1>>S2:lop",
-    "S1:marko>2>>S1:vadas"
+    "S1:marko>1>>S1:vadas",
+    "S1:marko>1>>S1:josh"
 ]
-

2.2.3 Updating Edge Properties

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=append
+

2.2.3 Updating Edge Properties

Params

Path Parameter Description:

Request Parameter Description:

Request Body Description:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=append
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

Note: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.

Response Status
200
+

NOTE: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.

Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 1
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.4 Batch Updating Edge Properties

Function Description

Similar to batch updating vertex properties.

Assuming the original edge and its properties are:

{
-    "edges":[
-        {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1,
-                "date":1512835200000
-            }
-        },
-        {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1,
-                "date":1361289600000
-            }
-        }
-    ]
-}
-
Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
+

2.2.4 Batch Updating Edge Properties

Params

Path Parameter Description:

Request Body Description:

Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":0.1,
-                "date":1522835200000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:vadas",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20160111",
+                "weight": 1.0
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":0.2,
-                "date":1301289600000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:josh",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20130221",
+                "weight": 0.5
             }
         }
     ],
-    "update_strategies":{
-        "weight":"SUM",
-        "date":"BIGGER"
+    "update_strategies": {
+        "weight": "SUM",
+        "date": "OVERRIDE"
     },
     "check_vertex": false,
-    "create_if_not_exist":true
+    "create_if_not_exist": true
 }
 
Response Status
200
 
Response Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1.1,
-                "date":1522835200000
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:vadas",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20160111"
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1.2,
-                "date":1301289600000
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         }
     ]
 }
-

2.2.5 Deleting Edge Properties

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=eliminate
+

2.2.5 Deleting Edge Properties

Params

Path Parameter Description:

Request Parameter Description:

Request Body Description:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=eliminate
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

Note: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.

Response Status
200
-
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
-    "label": "created",
-    "type": "edge",
-    "inVLabel": "software",
-    "outVLabel": "person",
-    "inV": "2:lop",
-    "outV": "1:peter",
-    "properties": {
-        "date": "20170324"
-    }
+

NOTE: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.

Response Status
400
+
Response Body

It is not possible to delete an attribute that is not set as nullable.

{
+    "exception": "class java.lang.IllegalArgumentException",
+    "message": "Can't remove non-null edge property 'p[weight->1.0]'",
+    "cause": ""
 }
-

2.2.6 Fetching Edges that Match the Criteria

Params

The supported query options are as follows:

Property key-value pairs consist of the attribute name and attribute value in JSON format. Multiple property key-value pairs are allowed as query conditions. The attribute value supports exact matching, range matching, and fuzzy matching. For exact matching, it is in the form properties={"weight": 0.8}. For range matching, it is in the form properties={"age": "P.gt(0.8)"}. For fuzzy matching, it is in the form properties={"city": "P.textcontains("ChengDu China")}. The supported expressions for range matching are as follows:

ExpressionDescription
P.eq(number)Edges with attribute value equal to number
P.neq(number)Edges with attribute value not equal to number
P.lt(number)Edges with attribute value less than number
P.lte(number)Edges with attribute value less than or equal to number
P.gt(number)Edges with attribute value greater than number
P.gte(number)Edges with attribute value greater than or equal to number
P.between(number1, number2)Edges with attribute value greater than or equal to number1 and less than number2
P.inside(number1, number2)Edges with attribute value greater than number1 and less than number2
P.outside(number1, number2)Edges with attribute value less than number1 and greater than number2
P.within(value1, value2, value3, …)Edges with attribute value equal to any of the given values

Query for edges connected to vertex person:josh (vertex_id=“1:josh”) with label created

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:josh"&direction=BOTH&label=created&properties={}
+

2.2.6 Fetching Edges that Match the Criteria

Params

Path Parameter:

Request Parameters:

Key-value pairs of properties consist of the property name and value in JSON format. Multiple key-value pairs are allowed as query conditions. Property values support exact matching and range matching. For exact matching, it is in the form properties={"weight":0.8}. For range matching, it is in the form properties={"age":"P.gt(0.8)"}. The expressions supported by range matching are as follows:

ExpressionDescription
P.eq(number)Edges with property value equal to number
P.neq(number)Edges with property value not equal to number
P.lt(number)Edges with property value less than number
P.lte(number)Edges with property value less than or equal to number
P.gt(number)Edges with property value greater than number
P.gte(number)Edges with property value greater than or equal to number
P.between(number1,number2)Edges with property value greater than or equal to number1 and less than number2
P.inside(number1,number2)Edges with property value greater than number1 and less than number2
P.outside(number1,number2)Edges with property value less than number1 and greater than number2
P.within(value1,value2,value3,…)Edges with property value equal to any of the given values
P.textcontains(value)Edges with property value containing the given value (string type)
P.contains(value)Edges with property value containing the given value (collection type)

Edges connected to the vertex person:marko(vertex_id=“1:marko”) with label knows and date property equal to “20160111”

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:marko"&label=knows&properties={"date":"P.within(\"20160111\")"}
 
Response Status
200
 
Response Body
{
     "edges": [
         {
-            "id": "S1:josh>1>>S2:lop",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:lop",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20091111",
-                "weight": 0.4
+                "weight": 1.5,
+                "date": "20160111"
+            }
+        }
+    ]
+}
+

Paginate and retrieve all edges, get the first page (page without parameter value), limit to 2 entries

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=2
+
Response Status
200
+
Response Body
{
+    "edges": [
+        {
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         },
         {
-            "id": "S1:josh>1>>S2:ripple",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:ripple",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20171210",
-                "weight": 1
+                "weight": 1.5,
+                "date": "20160111"
             }
         }
-    ]
-}
-

Paginated query for all edges, fetching the first page (page without a parameter value), limited to 3 records

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=3
-
Response Status
200
-
Response Body
{
-	"edges": [{
-			"id": "S1:peter>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:peter",
-			"properties": {
-				"weight": 0.2,
-				"date": "20170324"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 0.4,
-				"date": "20091111"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:ripple",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:ripple",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 1,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004"
+    ],
+    "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC"
 }
-

The returned body contains the information of the next page, "page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004". When querying the next page, assign this value to the page parameter.

Paginated query for all edges, fetching the next page (page with the value returned from the previous page), limited to 3 records

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&limit=3
+

The returned body contains the page number information for the next page, "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC". When querying the next page, assign this value to the page parameter.

Paginate and retrieve all edges, get the next page (include the page value returned from the previous page), limit to 2 entries

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&limit=2
 
Response Status
200
 
Response Body
{
-	"edges": [{
-			"id": "S1:marko>1>20130220>S1:josh",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:josh",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 1,
-				"date": "20130220"
-			}
-		},
-		{
-			"id": "S1:marko>1>20160110>S1:vadas",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:vadas",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.5,
-				"date": "20160110"
-			}
-		},
-		{
-			"id": "S1:marko>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.4,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": null
+    "edges": [
+        {
+            "id": "S1:marko>2>>S2:lop",
+            "label": "created",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "2:lop",
+            "inVLabel": "software",
+            "properties": {
+                "weight": 1.0,
+                "date": "20171210"
+            }
+        }
+    ],
+    "page": null
 }
-

When "page": null is returned, it indicates that there are no more pages available. (Note: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the page value may not be empty. When requesting the next page data using that page value, it will return empty data and page = null. Similar situations apply for other cases.)

2.2.7 Fetching Edge by ID

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

When "page": null is returned, it indicates that there are no more pages available.

NOTE: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the page value may not be empty. When requesting the next page data using that page value, it will return empty data and page = null. Similar situations apply for other cases.

2.2.7 Fetching Edge by ID

Params

Path parameter description:

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.8 Deleting Edge by ID

Params

Deleting Edge by ID only

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

2.2.8 Deleting Edge by ID

Params

Path parameter description:

Request parameter description:

Deleting Edge by ID only

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
204
-

Deleting Edge by Label+ID

In general, specifying the Label parameter along with the ID to delete an edge will provide better performance compared to deleting by ID only.

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?label=person
+

Deleting Edge by Label + ID

In general, specifying the Label parameter along with the ID to delete an edge will provide better performance compared to deleting by ID only.

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>1>>S1:vadas?label=knows
 
Response Status
204
 

1.9 - Traverser API

3.1 Overview of Traverser API

HugeGraphServer provides a RESTful API interface for the HugeGraph graph database. In addition to the basic CRUD operations for vertices and edges, it also offers several traversal methods, which we refer to as the traverser API. These traversal methods implement various complex graph algorithms, making it convenient for users to analyze and explore the graph.

The Traverser API supported by HugeGraph includes:

3.2 Detailed Explanation of Traverser API

In the following, we provide a detailed explanation of the Traverser API:

3.2 Detailed Explanation of Traverser API

The usage examples provided in this section are based on the graph presented on the TinkerPop official website:

tinkerpop example graph

The data import program is as follows:

public class Loader {
     public static void main(String[] args) {
diff --git a/docs/clients/restful-api/_print/index.html b/docs/clients/restful-api/_print/index.html
index a0339d917..18f6231a3 100644
--- a/docs/clients/restful-api/_print/index.html
+++ b/docs/clients/restful-api/_print/index.html
@@ -1181,337 +1181,283 @@
 
Response Status
204
 

Delete Vertex by Label+ID

When deleting a vertex by specifying both the Label parameter and the ID, it generally offers better performance compared to deleting by ID alone.

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/vertices/"1:marko"?label=person
 
Response Status
204
-

8 - Edge API

2.2 Edge

The modification of the vertex ID format also affects the ID of the edge, as well as the formats of the source vertex and target vertex IDs.

The EdgeId is formed by concatenating src-vertex-id + direction + label + sort-values + tgt-vertex-id, but the vertex ID types are not distinguished by quotation marks here. Instead, they are distinguished by prefixes:


The following examples assume that various schemas and vertex information mentioned above have been created.

2.2.1 Creating an Edge

Params Explanation

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
+

8 - Edge API

2.2 Edge

The modification of the vertex ID format also affects the ID of the edge, as well as the formats of the source vertex and target vertex IDs.

The EdgeId is formed by concatenating src-vertex-id + direction + label + sort-values + tgt-vertex-id, but the vertex ID types are not distinguished by quotation marks here. Instead, they are distinguished by prefixes:


The following example requires creating a graph schema based on the following groovy script:

import org.apache.hugegraph.HugeFactory
+import org.apache.tinkerpop.gremlin.structure.T
+
+conf = "conf/graphs/hugegraph.properties"
+graph = HugeFactory.open(conf)
+schema = graph.schema()
+
+schema.propertyKey("name").asText().ifNotExist().create()
+schema.propertyKey("age").asInt().ifNotExist().create()
+schema.propertyKey("city").asText().ifNotExist().create()
+schema.propertyKey("weight").asDouble().ifNotExist().create()
+schema.propertyKey("lang").asText().ifNotExist().create()
+schema.propertyKey("date").asText().ifNotExist().create()
+schema.propertyKey("price").asInt().ifNotExist().create()
+
+schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create()
+schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create()
+schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create()
+schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create()
+schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create()
+schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create()
+schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create()
+schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create()
+schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create()
+schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create()
+
+marko = graph.addVertex(T.label, "person", "name", "marko", "age", 29, "city", "Beijing")
+vadas = graph.addVertex(T.label, "person", "name", "vadas", "age", 27, "city", "Hongkong")
+lop = graph.addVertex(T.label, "software", "name", "lop", "lang", "java", "price", 328)
+josh = graph.addVertex(T.label, "person", "name", "josh", "age", 32, "city", "Beijing")
+ripple = graph.addVertex(T.label, "software", "name", "ripple", "lang", "java", "price", 199)
+peter = graph.addVertex(T.label, "person", "name", "peter", "age", 35, "city", "Shanghai")
+
+graph.tx().commit()
+g = graph.traversal()
+

2.2.1 Creating an Edge

Params

Path Parameter Description:

Request Body Description:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
 
Request Body
{
     "label": "created",
-    "outV": "1:peter",
+    "outV": "1:marko",
     "inV": "2:lop",
     "outVLabel": "person",
     "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "date": "20171210",
+        "weight": 0.4
     }
 }
 
Response Status
201
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 0.4,
+        "date": "20171210"
     }
 }
-

2.2.2 Creating Multiple Edges

Params
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
+

2.2.2 Creating Multiple Edges

Params

Path Parameter Description:

Request Parameter Description:

Request Body Description:

Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
[
     {
-        "label": "created",
-        "outV": "1:peter",
-        "inV": "2:lop",
+        "label": "knows",
+        "outV": "1:marko",
+        "inV": "1:vadas",
         "outVLabel": "person",
-        "inVLabel": "software",
+        "inVLabel": "person",
         "properties": {
-            "date": "2017-5-18",
-            "weight": 0.2
+            "date": "20160110",
+            "weight": 0.5
         }
     },
     {
         "label": "knows",
         "outV": "1:marko",
-        "inV": "1:vadas",
+        "inV": "1:josh",
         "outVLabel": "person",
         "inVLabel": "person",
         "properties": {
-            "date": "2016-01-10",
-            "weight": 0.5
+            "date": "20130220",
+            "weight": 1.0
         }
     }
 ]
 
Response Status
201
 
Response Body
[
-    "S1:peter>1>>S2:lop",
-    "S1:marko>2>>S1:vadas"
+    "S1:marko>1>>S1:vadas",
+    "S1:marko>1>>S1:josh"
 ]
-

2.2.3 Updating Edge Properties

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=append
+

2.2.3 Updating Edge Properties

Params

Path Parameter Description:

Request Parameter Description:

Request Body Description:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=append
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

Note: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.

Response Status
200
+

NOTE: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.

Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 1
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.4 Batch Updating Edge Properties

Function Description

Similar to batch updating vertex properties.

Assuming the original edge and its properties are:

{
-    "edges":[
-        {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1,
-                "date":1512835200000
-            }
-        },
-        {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1,
-                "date":1361289600000
-            }
-        }
-    ]
-}
-
Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
+

2.2.4 Batch Updating Edge Properties

Params

Path Parameter Description:

Request Body Description:

Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":0.1,
-                "date":1522835200000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:vadas",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20160111",
+                "weight": 1.0
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":0.2,
-                "date":1301289600000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:josh",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20130221",
+                "weight": 0.5
             }
         }
     ],
-    "update_strategies":{
-        "weight":"SUM",
-        "date":"BIGGER"
+    "update_strategies": {
+        "weight": "SUM",
+        "date": "OVERRIDE"
     },
     "check_vertex": false,
-    "create_if_not_exist":true
+    "create_if_not_exist": true
 }
 
Response Status
200
 
Response Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1.1,
-                "date":1522835200000
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:vadas",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20160111"
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1.2,
-                "date":1301289600000
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         }
     ]
 }
-

2.2.5 Deleting Edge Properties

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=eliminate
+

2.2.5 Deleting Edge Properties

Params

Path Parameter Description:

Request Parameter Description:

Request Body Description:

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=eliminate
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

Note: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.

Response Status
200
-
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
-    "label": "created",
-    "type": "edge",
-    "inVLabel": "software",
-    "outVLabel": "person",
-    "inV": "2:lop",
-    "outV": "1:peter",
-    "properties": {
-        "date": "20170324"
-    }
+

NOTE: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.

Response Status
400
+
Response Body

It is not possible to delete an attribute that is not set as nullable.

{
+    "exception": "class java.lang.IllegalArgumentException",
+    "message": "Can't remove non-null edge property 'p[weight->1.0]'",
+    "cause": ""
 }
-

2.2.6 Fetching Edges that Match the Criteria

Params

The supported query options are as follows:

Property key-value pairs consist of the attribute name and attribute value in JSON format. Multiple property key-value pairs are allowed as query conditions. The attribute value supports exact matching, range matching, and fuzzy matching. For exact matching, it is in the form properties={"weight": 0.8}. For range matching, it is in the form properties={"age": "P.gt(0.8)"}. For fuzzy matching, it is in the form properties={"city": "P.textcontains("ChengDu China")}. The supported expressions for range matching are as follows:

ExpressionDescription
P.eq(number)Edges with attribute value equal to number
P.neq(number)Edges with attribute value not equal to number
P.lt(number)Edges with attribute value less than number
P.lte(number)Edges with attribute value less than or equal to number
P.gt(number)Edges with attribute value greater than number
P.gte(number)Edges with attribute value greater than or equal to number
P.between(number1, number2)Edges with attribute value greater than or equal to number1 and less than number2
P.inside(number1, number2)Edges with attribute value greater than number1 and less than number2
P.outside(number1, number2)Edges with attribute value less than number1 and greater than number2
P.within(value1, value2, value3, …)Edges with attribute value equal to any of the given values

Query for edges connected to vertex person:josh (vertex_id=“1:josh”) with label created

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:josh"&direction=BOTH&label=created&properties={}
+

2.2.6 Fetching Edges that Match the Criteria

Params

Path Parameter:

Request Parameters:

Key-value pairs of properties consist of the property name and value in JSON format. Multiple key-value pairs are allowed as query conditions. Property values support exact matching and range matching. For exact matching, it is in the form properties={"weight":0.8}. For range matching, it is in the form properties={"age":"P.gt(0.8)"}. The expressions supported by range matching are as follows:

ExpressionDescription
P.eq(number)Edges with property value equal to number
P.neq(number)Edges with property value not equal to number
P.lt(number)Edges with property value less than number
P.lte(number)Edges with property value less than or equal to number
P.gt(number)Edges with property value greater than number
P.gte(number)Edges with property value greater than or equal to number
P.between(number1,number2)Edges with property value greater than or equal to number1 and less than number2
P.inside(number1,number2)Edges with property value greater than number1 and less than number2
P.outside(number1,number2)Edges with property value less than number1 and greater than number2
P.within(value1,value2,value3,…)Edges with property value equal to any of the given values
P.textcontains(value)Edges with property value containing the given value (string type)
P.contains(value)Edges with property value containing the given value (collection type)

Edges connected to the vertex person:marko(vertex_id=“1:marko”) with label knows and date property equal to “20160111”

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:marko"&label=knows&properties={"date":"P.within(\"20160111\")"}
 
Response Status
200
 
Response Body
{
     "edges": [
         {
-            "id": "S1:josh>1>>S2:lop",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:lop",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20091111",
-                "weight": 0.4
+                "weight": 1.5,
+                "date": "20160111"
+            }
+        }
+    ]
+}
+

Paginate and retrieve all edges, get the first page (page without parameter value), limit to 2 entries

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=2
+
Response Status
200
+
Response Body
{
+    "edges": [
+        {
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         },
         {
-            "id": "S1:josh>1>>S2:ripple",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:ripple",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20171210",
-                "weight": 1
+                "weight": 1.5,
+                "date": "20160111"
             }
         }
-    ]
-}
-

Paginated query for all edges, fetching the first page (page without a parameter value), limited to 3 records

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=3
-
Response Status
200
-
Response Body
{
-	"edges": [{
-			"id": "S1:peter>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:peter",
-			"properties": {
-				"weight": 0.2,
-				"date": "20170324"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 0.4,
-				"date": "20091111"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:ripple",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:ripple",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 1,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004"
+    ],
+    "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC"
 }
-

The returned body contains the information of the next page, "page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004". When querying the next page, assign this value to the page parameter.

Paginated query for all edges, fetching the next page (page with the value returned from the previous page), limited to 3 records

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&limit=3
+

The returned body contains the page number information for the next page, "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC". When querying the next page, assign this value to the page parameter.

Paginate and retrieve all edges, get the next page (include the page value returned from the previous page), limit to 2 entries

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&limit=2
 
Response Status
200
 
Response Body
{
-	"edges": [{
-			"id": "S1:marko>1>20130220>S1:josh",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:josh",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 1,
-				"date": "20130220"
-			}
-		},
-		{
-			"id": "S1:marko>1>20160110>S1:vadas",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:vadas",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.5,
-				"date": "20160110"
-			}
-		},
-		{
-			"id": "S1:marko>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.4,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": null
+    "edges": [
+        {
+            "id": "S1:marko>2>>S2:lop",
+            "label": "created",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "2:lop",
+            "inVLabel": "software",
+            "properties": {
+                "weight": 1.0,
+                "date": "20171210"
+            }
+        }
+    ],
+    "page": null
 }
-

When "page": null is returned, it indicates that there are no more pages available. (Note: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the page value may not be empty. When requesting the next page data using that page value, it will return empty data and page = null. Similar situations apply for other cases.)

2.2.7 Fetching Edge by ID

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

When "page": null is returned, it indicates that there are no more pages available.

NOTE: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the page value may not be empty. When requesting the next page data using that page value, it will return empty data and page = null. Similar situations apply for other cases.

2.2.7 Fetching Edge by ID

Params

Path parameter description:

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.8 Deleting Edge by ID

Params

Deleting Edge by ID only

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

2.2.8 Deleting Edge by ID

Params

Path parameter description:

Request parameter description:

Deleting Edge by ID only

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
204
-

Deleting Edge by Label+ID

In general, specifying the Label parameter along with the ID to delete an edge will provide better performance compared to deleting by ID only.

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?label=person
+

Deleting Edge by Label + ID

In general, specifying the Label parameter along with the ID to delete an edge will provide better performance compared to deleting by ID only.

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>1>>S1:vadas?label=knows
 
Response Status
204
 

9 - Traverser API

3.1 Overview of Traverser API

HugeGraphServer provides a RESTful API interface for the HugeGraph graph database. In addition to the basic CRUD operations for vertices and edges, it also offers several traversal methods, which we refer to as the traverser API. These traversal methods implement various complex graph algorithms, making it convenient for users to analyze and explore the graph.

The Traverser API supported by HugeGraph includes:

3.2 Detailed Explanation of Traverser API

In the following, we provide a detailed explanation of the Traverser API:

3.2 Detailed Explanation of Traverser API

The usage examples provided in this section are based on the graph presented on the TinkerPop official website:

tinkerpop example graph

The data import program is as follows:

public class Loader {
     public static void main(String[] args) {
diff --git a/docs/clients/restful-api/edge/index.html b/docs/clients/restful-api/edge/index.html
index 2fd61b729..9ed6cf70c 100644
--- a/docs/clients/restful-api/edge/index.html
+++ b/docs/clients/restful-api/edge/index.html
@@ -1,9 +1,9 @@
 Edge API | HugeGraph
 

Edge API

2.2 Edge

The modification of the vertex ID format also affects the ID of the edge, as well as the formats of the source vertex and target vertex IDs.

The EdgeId is formed by concatenating src-vertex-id + direction + label + sort-values + tgt-vertex-id, but the vertex ID types are not distinguished by quotation marks here. Instead, they are distinguished by prefixes:

  • When the ID type is number, the vertex ID in the EdgeId has a prefix L, like “L123456>1»L987654”.
  • When the ID type is string, the vertex ID in the EdgeId has a prefix S, like “S1:peter>1»S2:lop”.

The following examples assume that various schemas and vertex information mentioned above have been created.

2.2.1 Creating an Edge

Params Explanation

  • label: The name of the edge type, required.
  • outV: The ID of the source vertex, required.
  • inV: The ID of the target vertex, required.
  • outVLabel: The type of the source vertex, required.
  • inVLabel: The type of the target vertex, required.
  • properties: The properties associated with the edge. The internal structure of the object is as follows:
    1. name: The name of the property.
    2. value: The value of the property.
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
+ Print entire section

Edge API

2.2 Edge

The modification of the vertex ID format also affects the ID of the edge, as well as the formats of the source vertex and target vertex IDs.

The EdgeId is formed by concatenating src-vertex-id + direction + label + sort-values + tgt-vertex-id, but the vertex ID types are not distinguished by quotation marks here. Instead, they are distinguished by prefixes:

  • When the ID type is number, the vertex ID in the EdgeId has a prefix L, like “L123456>1»L987654”.
  • When the ID type is string, the vertex ID in the EdgeId has a prefix S, like “S1:peter>1»S2:lop”.

The following example requires creating a graph schema based on the following groovy script:

import org.apache.hugegraph.HugeFactory
+import org.apache.tinkerpop.gremlin.structure.T
+
+conf = "conf/graphs/hugegraph.properties"
+graph = HugeFactory.open(conf)
+schema = graph.schema()
+
+schema.propertyKey("name").asText().ifNotExist().create()
+schema.propertyKey("age").asInt().ifNotExist().create()
+schema.propertyKey("city").asText().ifNotExist().create()
+schema.propertyKey("weight").asDouble().ifNotExist().create()
+schema.propertyKey("lang").asText().ifNotExist().create()
+schema.propertyKey("date").asText().ifNotExist().create()
+schema.propertyKey("price").asInt().ifNotExist().create()
+
+schema.vertexLabel("person").properties("name", "age", "city").primaryKeys("name").ifNotExist().create()
+schema.vertexLabel("software").properties("name", "lang", "price").primaryKeys("name").ifNotExist().create()
+schema.indexLabel("personByCity").onV("person").by("city").secondary().ifNotExist().create()
+schema.indexLabel("personByAgeAndCity").onV("person").by("age", "city").secondary().ifNotExist().create()
+schema.indexLabel("softwareByPrice").onV("software").by("price").range().ifNotExist().create()
+schema.edgeLabel("knows").sourceLabel("person").targetLabel("person").properties("date", "weight").ifNotExist().create()
+schema.edgeLabel("created").sourceLabel("person").targetLabel("software").properties("date", "weight").ifNotExist().create()
+schema.indexLabel("createdByDate").onE("created").by("date").secondary().ifNotExist().create()
+schema.indexLabel("createdByWeight").onE("created").by("weight").range().ifNotExist().create()
+schema.indexLabel("knowsByWeight").onE("knows").by("weight").range().ifNotExist().create()
+
+marko = graph.addVertex(T.label, "person", "name", "marko", "age", 29, "city", "Beijing")
+vadas = graph.addVertex(T.label, "person", "name", "vadas", "age", 27, "city", "Hongkong")
+lop = graph.addVertex(T.label, "software", "name", "lop", "lang", "java", "price", 328)
+josh = graph.addVertex(T.label, "person", "name", "josh", "age", 32, "city", "Beijing")
+ripple = graph.addVertex(T.label, "software", "name", "ripple", "lang", "java", "price", 199)
+peter = graph.addVertex(T.label, "person", "name", "peter", "age", 35, "city", "Shanghai")
+
+graph.tx().commit()
+g = graph.traversal()
+

2.2.1 Creating an Edge

Params

Path Parameter Description:

  • graph: The graph to operate on

Request Body Description:

  • label: The edge type name (required)
  • outV: The source vertex id (required)
  • inV: The target vertex id (required)
  • outVLabel: The source vertex type (required)
  • inVLabel: The target vertex type (required)
  • properties: The properties associated with the edge. The internal structure of the object is as follows:
    1. name: The property name
    2. value: The property value
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges
 
Request Body
{
     "label": "created",
-    "outV": "1:peter",
+    "outV": "1:marko",
     "inV": "2:lop",
     "outVLabel": "person",
     "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "date": "20171210",
+        "weight": 0.4
     }
 }
 
Response Status
201
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 0.4,
+        "date": "20171210"
     }
 }
-

2.2.2 Creating Multiple Edges

Params
  • check_vertex: Whether to check vertex existence (true | false). When set to true and the source or target vertex of the edge being inserted does not exist, an error will be reported.
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
+

2.2.2 Creating Multiple Edges

Params

Path Parameter Description:

  • graph: The graph to operate on

Request Parameter Description:

  • check_vertex: Whether to check the existence of vertices (true | false). When set to true, an error will be thrown if the source or target vertices of the edge to be inserted do not exist. Default is true.

Request Body Description:

  • List of edge information
Method & Url
POST http://localhost:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
[
     {
-        "label": "created",
-        "outV": "1:peter",
-        "inV": "2:lop",
+        "label": "knows",
+        "outV": "1:marko",
+        "inV": "1:vadas",
         "outVLabel": "person",
-        "inVLabel": "software",
+        "inVLabel": "person",
         "properties": {
-            "date": "2017-5-18",
-            "weight": 0.2
+            "date": "20160110",
+            "weight": 0.5
         }
     },
     {
         "label": "knows",
         "outV": "1:marko",
-        "inV": "1:vadas",
+        "inV": "1:josh",
         "outVLabel": "person",
         "inVLabel": "person",
         "properties": {
-            "date": "2016-01-10",
-            "weight": 0.5
+            "date": "20130220",
+            "weight": 1.0
         }
     }
 ]
 
Response Status
201
 
Response Body
[
-    "S1:peter>1>>S2:lop",
-    "S1:marko>2>>S1:vadas"
+    "S1:marko>1>>S1:vadas",
+    "S1:marko>1>>S1:josh"
 ]
-

2.2.3 Updating Edge Properties

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=append
+

2.2.3 Updating Edge Properties

Params

Path Parameter Description:

  • graph: The graph to operate on
  • id: The ID of the edge to be operated on

Request Parameter Description:

  • action: The append action

Request Body Description:

  • Edge information
Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=append
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

Note: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.

Response Status
200
+

NOTE: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.

Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 1
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.4 Batch Updating Edge Properties

Function Description

Similar to batch updating vertex properties.

Assuming the original edge and its properties are:

{
-    "edges":[
-        {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1,
-                "date":1512835200000
-            }
-        },
-        {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1,
-                "date":1361289600000
-            }
-        }
-    ]
-}
-
Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
+

2.2.4 Batch Updating Edge Properties

Params

Path Parameter Description:

  • graph: The graph to operate on

Request Body Description:

  • edges: List of edge information
  • update_strategies: For each property, you can set its update strategy individually, including:
    • SUM: Only supports number type
    • BIGGER/SMALLER: Only supports date/number type
    • UNION/INTERSECTION: Only supports set type
    • APPEND/ELIMINATE: Only supports collection type
    • OVERRIDE
  • check_vertex: Whether to check the existence of vertices (true | false). When set to true, an error will be thrown if the source or target vertices of the edge to be inserted do not exist. Default is true.
  • create_if_not_exist: Currently only supports setting to true
Method & Url
PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch
 
Request Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":0.1,
-                "date":1522835200000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:vadas",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20160111",
+                "weight": 1.0
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":0.2,
-                "date":1301289600000
+            "label": "knows",
+            "outV": "1:marko",
+            "inV": "1:josh",
+            "outVLabel": "person",
+            "inVLabel": "person",
+            "properties": {
+                "date": "20130221",
+                "weight": 0.5
             }
         }
     ],
-    "update_strategies":{
-        "weight":"SUM",
-        "date":"BIGGER"
+    "update_strategies": {
+        "weight": "SUM",
+        "date": "OVERRIDE"
     },
     "check_vertex": false,
-    "create_if_not_exist":true
+    "create_if_not_exist": true
 }
 
Response Status
200
 
Response Body
{
-    "edges":[
+    "edges": [
         {
-            "id":"S1:josh>2>>S2:ripple",
-            "label":"created",
-            "type":"edge",
-            "outV":"1:josh",
-            "outVLabel":"person",
-            "inV":"2:ripple",
-            "inVLabel":"software",
-            "properties":{
-                "weight":1.1,
-                "date":1522835200000
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:vadas",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20160111"
             }
         },
         {
-            "id":"S1:marko>1>7JooBil0>S1:josh",
-            "label":"knows",
-            "type":"edge",
-            "outV":"1:marko",
-            "outVLabel":"person",
-            "inV":"1:josh",
-            "inVLabel":"person",
-            "properties":{
-                "weight":1.2,
-                "date":1301289600000
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20130221"
             }
         }
     ]
 }
-

2.2.5 Deleting Edge Properties

Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?action=eliminate
+

2.2.5 Deleting Edge Properties

Params

Path Parameter Description:

  • graph: The graph to operate on
  • id: The ID of the edge to be operated on

Request Parameter Description:

  • action: The eliminate action

Request Body Description:

  • Edge information
Method & Url
PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop?action=eliminate
 
Request Body
{
     "properties": {
         "weight": 1.0
     }
 }
-

Note: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.

Response Status
200
-
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
-    "label": "created",
-    "type": "edge",
-    "inVLabel": "software",
-    "outVLabel": "person",
-    "inV": "2:lop",
-    "outV": "1:peter",
-    "properties": {
-        "date": "20170324"
-    }
+

NOTE: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.

Response Status
400
+
Response Body

It is not possible to delete an attribute that is not set as nullable.

{
+    "exception": "class java.lang.IllegalArgumentException",
+    "message": "Can't remove non-null edge property 'p[weight->1.0]'",
+    "cause": ""
 }
-

2.2.6 Fetching Edges that Match the Criteria

Params
  • vertex_id: Vertex ID
  • direction: Direction of the edge (OUT | IN | BOTH)
  • label: Edge label
  • properties: Key-value pairs of properties (previously indexed for property-based queries)
  • offset: Offset, default is 0
  • limit: Number of results to query, default is 100
  • page: Page number

The supported query options are as follows:

  • When the vertex_id parameter is provided, the page parameter cannot be used. The direction, label, and properties parameters are optional, while offset and limit can be used to restrict the result range.
  • When the vertex_id parameter is not provided, the label and properties parameters are optional.
    • If the page parameter is used: the offset parameter is not available (either not provided or set to 0), the direction parameter is not available, and at most one property can be specified.
    • If the page parameter is not used: the offset and limit parameters can be used to restrict the result range, and the direction parameter is ignored.

Property key-value pairs consist of the attribute name and attribute value in JSON format. Multiple property key-value pairs are allowed as query conditions. The attribute value supports exact matching, range matching, and fuzzy matching. For exact matching, it is in the form properties={"weight": 0.8}. For range matching, it is in the form properties={"age": "P.gt(0.8)"}. For fuzzy matching, it is in the form properties={"city": "P.textcontains("ChengDu China")}. The supported expressions for range matching are as follows:

ExpressionDescription
P.eq(number)Edges with attribute value equal to number
P.neq(number)Edges with attribute value not equal to number
P.lt(number)Edges with attribute value less than number
P.lte(number)Edges with attribute value less than or equal to number
P.gt(number)Edges with attribute value greater than number
P.gte(number)Edges with attribute value greater than or equal to number
P.between(number1, number2)Edges with attribute value greater than or equal to number1 and less than number2
P.inside(number1, number2)Edges with attribute value greater than number1 and less than number2
P.outside(number1, number2)Edges with attribute value less than number1 and greater than number2
P.within(value1, value2, value3, …)Edges with attribute value equal to any of the given values

Query for edges connected to vertex person:josh (vertex_id=“1:josh”) with label created

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:josh"&direction=BOTH&label=created&properties={}
+

2.2.6 Fetching Edges that Match the Criteria

Params

Path Parameter:

  • graph: The graph to operate on

Request Parameters:

  • vertex_id: Vertex ID
  • direction: Edge direction (OUT | IN | BOTH), default is BOTH
  • label: Edge label
  • properties: Key-value pairs of properties (requires pre-built indexes for property queries)
  • keep_start_p: Default is false. When set to true, the range matching input expression will not be automatically escaped. For example, properties={"age":"P.gt(0.8)"} will be interpreted as an exact match, i.e., the age property is equal to “P.gt(0.8)”
  • offset: Offset, default is 0
  • limit: Number of queries, default is 100
  • page: Page number

Key-value pairs of properties consist of the property name and value in JSON format. Multiple key-value pairs are allowed as query conditions. Property values support exact matching and range matching. For exact matching, it is in the form properties={"weight":0.8}. For range matching, it is in the form properties={"age":"P.gt(0.8)"}. The expressions supported by range matching are as follows:

ExpressionDescription
P.eq(number)Edges with property value equal to number
P.neq(number)Edges with property value not equal to number
P.lt(number)Edges with property value less than number
P.lte(number)Edges with property value less than or equal to number
P.gt(number)Edges with property value greater than number
P.gte(number)Edges with property value greater than or equal to number
P.between(number1,number2)Edges with property value greater than or equal to number1 and less than number2
P.inside(number1,number2)Edges with property value greater than number1 and less than number2
P.outside(number1,number2)Edges with property value less than number1 and greater than number2
P.within(value1,value2,value3,…)Edges with property value equal to any of the given values
P.textcontains(value)Edges with property value containing the given value (string type)
P.contains(value)Edges with property value containing the given value (collection type)

Edges connected to the vertex person:marko(vertex_id=“1:marko”) with label knows and date property equal to “20160111”

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id="1:marko"&label=knows&properties={"date":"P.within(\"20160111\")"}
 
Response Status
200
 
Response Body
{
     "edges": [
         {
-            "id": "S1:josh>1>>S2:lop",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:lop",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
+            "properties": {
+                "weight": 1.5,
+                "date": "20160111"
+            }
+        }
+    ]
+}
+

Paginate and retrieve all edges, get the first page (page without parameter value), limit to 2 entries

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=2
+
Response Status
200
+
Response Body
{
+    "edges": [
+        {
+            "id": "S1:marko>1>>S1:josh",
+            "label": "knows",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "1:josh",
+            "inVLabel": "person",
             "properties": {
-                "date": "20091111",
-                "weight": 0.4
+                "weight": 1.5,
+                "date": "20130221"
             }
         },
         {
-            "id": "S1:josh>1>>S2:ripple",
-            "label": "created",
+            "id": "S1:marko>1>>S1:vadas",
+            "label": "knows",
             "type": "edge",
-            "inVLabel": "software",
+            "outV": "1:marko",
             "outVLabel": "person",
-            "inV": "2:ripple",
-            "outV": "1:josh",
+            "inV": "1:vadas",
+            "inVLabel": "person",
             "properties": {
-                "date": "20171210",
-                "weight": 1
+                "weight": 1.5,
+                "date": "20160111"
             }
         }
-    ]
-}
-

Paginated query for all edges, fetching the first page (page without a parameter value), limited to 3 records

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&limit=3
-
Response Status
200
-
Response Body
{
-	"edges": [{
-			"id": "S1:peter>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:peter",
-			"properties": {
-				"weight": 0.2,
-				"date": "20170324"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 0.4,
-				"date": "20091111"
-			}
-		},
-		{
-			"id": "S1:josh>2>>S2:ripple",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:ripple",
-			"outV": "1:josh",
-			"properties": {
-				"weight": 1,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004"
+    ],
+    "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC"
 }
-

The returned body contains the information of the next page, "page": "002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004". When querying the next page, assign this value to the page parameter.

Paginated query for all edges, fetching the next page (page with the value returned from the previous page), limited to 3 records

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&limit=3
+

The returned body contains the page number information for the next page, "page": "EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC". When querying the next page, assign this value to the page parameter.

Paginate and retrieve all edges, get the next page (include the page value returned from the previous page), limit to 2 entries

Method & Url
GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&limit=2
 
Response Status
200
 
Response Body
{
-	"edges": [{
-			"id": "S1:marko>1>20130220>S1:josh",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:josh",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 1,
-				"date": "20130220"
-			}
-		},
-		{
-			"id": "S1:marko>1>20160110>S1:vadas",
-			"label": "knows",
-			"type": "edge",
-			"inVLabel": "person",
-			"outVLabel": "person",
-			"inV": "1:vadas",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.5,
-				"date": "20160110"
-			}
-		},
-		{
-			"id": "S1:marko>2>>S2:lop",
-			"label": "created",
-			"type": "edge",
-			"inVLabel": "software",
-			"outVLabel": "person",
-			"inV": "2:lop",
-			"outV": "1:marko",
-			"properties": {
-				"weight": 0.4,
-				"date": "20171210"
-			}
-		}
-	],
-	"page": null
+    "edges": [
+        {
+            "id": "S1:marko>2>>S2:lop",
+            "label": "created",
+            "type": "edge",
+            "outV": "1:marko",
+            "outVLabel": "person",
+            "inV": "2:lop",
+            "inVLabel": "software",
+            "properties": {
+                "weight": 1.0,
+                "date": "20171210"
+            }
+        }
+    ],
+    "page": null
 }
-

When "page": null is returned, it indicates that there are no more pages available. (Note: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the page value may not be empty. When requesting the next page data using that page value, it will return empty data and page = null. Similar situations apply for other cases.)

2.2.7 Fetching Edge by ID

Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

When "page": null is returned, it indicates that there are no more pages available.

NOTE: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the page value may not be empty. When requesting the next page data using that page value, it will return empty data and page = null. Similar situations apply for other cases.

2.2.7 Fetching Edge by ID

Params

Path parameter description:

  • graph: The graph to be operated on.
  • id: The ID of the edge to be operated on.
Method & Url
GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
200
 
Response Body
{
-    "id": "S1:peter>1>>S2:lop",
+    "id": "S1:marko>2>>S2:lop",
     "label": "created",
     "type": "edge",
-    "inVLabel": "software",
+    "outV": "1:marko",
     "outVLabel": "person",
     "inV": "2:lop",
-    "outV": "1:peter",
+    "inVLabel": "software",
     "properties": {
-        "date": "2017-5-18",
-        "weight": 0.2
+        "weight": 1.0,
+        "date": "20171210"
     }
 }
-

2.2.8 Deleting Edge by ID

Params
  • label: Edge type, optional parameter

Deleting Edge by ID only

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop
+

2.2.8 Deleting Edge by ID

Params

Path parameter description:

  • graph: The graph to be operated on.
  • id: The ID of the edge to be operated on.

Request parameter description:

  • label: The label of the edge.

Deleting Edge by ID only

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>2>>S2:lop
 
Response Status
204
-

Deleting Edge by Label+ID

In general, specifying the Label parameter along with the ID to delete an edge will provide better performance compared to deleting by ID only.

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter>1>>S2:lop?label=person
+

Deleting Edge by Label + ID

In general, specifying the Label parameter along with the ID to delete an edge will provide better performance compared to deleting by ID only.

Method & Url
DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko>1>>S1:vadas?label=knows
 
Response Status
204
-

Last modified May 19, 2023: Update edge.md (#246) (9452c3d1)
+

diff --git a/docs/clients/restful-api/index.xml b/docs/clients/restful-api/index.xml index bb3a63f05..e5e89a265 100644 --- a/docs/clients/restful-api/index.xml +++ b/docs/clients/restful-api/index.xml @@ -1564,19 +1564,59 @@ <li>When the ID type is string, the vertex ID in the EdgeId has a prefix <code>S</code>, like &ldquo;S1:peter&gt;1&raquo;S2:lop&rdquo;.</li> </ul> <hr> -<p>The following examples assume that various schemas and vertex information mentioned above have been created.</p> -<h4 id="221-creating-an-edge">2.2.1 Creating an Edge</h4> -<p>Params Explanation</p> +<p>The following example requires creating a graph <code>schema</code> based on the following <code>groovy</code> script:</p> +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-groovy" data-lang="groovy"><span style="display:flex;"><span><span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000">org.apache.hugegraph.HugeFactory</span> +</span></span><span style="display:flex;"><span><span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000">org.apache.tinkerpop.gremlin.structure.T</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">conf</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;conf/graphs/hugegraph.properties&#34;</span> +</span></span><span style="display:flex;"><span><span style="color:#000">graph</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">HugeFactory</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">open</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">conf</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">schema</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asInt</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asDouble</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asInt</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">vertexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">primaryKeys</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">vertexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">primaryKeys</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;personByCity&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;personByAgeAndCity&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;softwareByPrice&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">edgeLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">sourceLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">targetLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">edgeLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">sourceLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">targetLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;createdByDate&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;createdByWeight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knowsByWeight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">marko</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;marko&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">29</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Beijing&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">vadas</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;vadas&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">27</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Hongkong&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">lop</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lop&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;java&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">328</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">josh</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;josh&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">32</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Beijing&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">ripple</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;ripple&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;java&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">199</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">peter</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;peter&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">35</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Shanghai&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">tx</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">commit</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">g</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">traversal</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span></code></pre></div><h4 id="221-creating-an-edge">2.2.1 Creating an Edge</h4> +<h5 id="params">Params</h5> +<p><strong>Path Parameter Description:</strong></p> +<ul> +<li>graph: The graph to operate on</li> +</ul> +<p><strong>Request Body Description:</strong></p> <ul> -<li>label: The name of the edge type, required.</li> -<li>outV: The ID of the source vertex, required.</li> -<li>inV: The ID of the target vertex, required.</li> -<li>outVLabel: The type of the source vertex, required.</li> -<li>inVLabel: The type of the target vertex, required.</li> +<li>label: The edge type name (required)</li> +<li>outV: The source vertex id (required)</li> +<li>inV: The target vertex id (required)</li> +<li>outVLabel: The source vertex type (required)</li> +<li>inVLabel: The target vertex type (required)</li> <li>properties: The properties associated with the edge. The internal structure of the object is as follows: <ol> -<li>name: The name of the property.</li> -<li>value: The value of the property.</li> +<li>name: The property name</li> +<li>value: The property value</li> </ol> </li> </ul> @@ -1585,60 +1625,69 @@ </span></span></code></pre></div><h5 id="request-body">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h5 id="response-status">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">201</span> </span></span></code></pre></div><h5 id="response-body">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="222-creating-multiple-edges">2.2.2 Creating Multiple Edges</h4> -<h5 id="params">Params</h5> +<h5 id="params-1">Params</h5> +<p><strong>Path Parameter Description:</strong></p> <ul> -<li>check_vertex: Whether to check vertex existence (true | false). When set to true and the source or target vertex of the edge being inserted does not exist, an error will be reported.</li> +<li>graph: The graph to operate on</li> +</ul> +<p><strong>Request Parameter Description:</strong></p> +<ul> +<li>check_vertex: Whether to check the existence of vertices (true | false). When set to true, an error will be thrown if the source or target vertices of the edge to be inserted do not exist. Default is true.</li> +</ul> +<p><strong>Request Body Description:</strong></p> +<ul> +<li>List of edge information</li> </ul> <h5 id="method--url-1">Method &amp; Url</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>POST http://localhost:8080/graphs/hugegraph/graph/edges/batch </span></span></code></pre></div><h5 id="request-body-1">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160110&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2016-01-10&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130220&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">]</span> @@ -1646,12 +1695,26 @@ <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">201</span> </span></span></code></pre></div><h5 id="response-body-1">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">[</span> -</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S1:vadas&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">]</span> </span></span></code></pre></div><h4 id="223-updating-edge-properties">2.2.3 Updating Edge Properties</h4> +<h5 id="params-2">Params</h5> +<p><strong>Path Parameter Description:</strong></p> +<ul> +<li>graph: The graph to operate on</li> +<li>id: The ID of the edge to be operated on</li> +</ul> +<p><strong>Request Parameter Description:</strong></p> +<ul> +<li>action: The append action</li> +</ul> +<p><strong>Request Body Description:</strong></p> +<ul> +<li>Edge information</li> +</ul> <h5 id="method--url-2">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?action=append +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop?action=append </span></span></code></pre></div><h5 id="request-body-2">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> @@ -1659,131 +1722,130 @@ </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><blockquote> -<p>Note: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.</p> +<p>NOTE: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.</p> </blockquote> <h5 id="response-status-2">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-2">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="224-batch-updating-edge-properties">2.2.4 Batch Updating Edge Properties</h4> -<h5 id="function-description">Function Description</h5> -<p>Similar to batch updating vertex properties.</p> -<p>Assuming the original edge and its properties are:</p> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1512835200000</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1361289600000</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> -</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><h5 id="method--url-3">Method &amp; Url</h5> +<h5 id="params-3">Params</h5> +<p><strong>Path Parameter Description:</strong></p> +<ul> +<li>graph: The graph to operate on</li> +</ul> +<p><strong>Request Body Description:</strong></p> +<ul> +<li>edges: List of edge information</li> +<li>update_strategies: For each property, you can set its update strategy individually, including: +<ul> +<li>SUM: Only supports number type</li> +<li>BIGGER/SMALLER: Only supports date/number type</li> +<li>UNION/INTERSECTION: Only supports set type</li> +<li>APPEND/ELIMINATE: Only supports collection type</li> +<li>OVERRIDE</li> +</ul> +</li> +<li>check_vertex: Whether to check the existence of vertices (true | false). When set to true, an error will be thrown if the source or target vertices of the edge to be inserted do not exist. Default is true.</li> +<li>create_if_not_exist: Currently only supports setting to true</li> +</ul> +<h5 id="method--url-3">Method &amp; Url</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch </span></span></code></pre></div><h5 id="request-body-3">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">0.1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1522835200000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">0.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1301289600000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;update_strategies&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;SUM&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;BIGGER&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;update_strategies&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;SUM&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;OVERRIDE&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;check_vertex&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">false</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;create_if_not_exist&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#204a87;font-weight:bold">true</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;create_if_not_exist&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">true</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h5 id="response-status-3">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-3">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1.1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1522835200000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1301289600000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="225-deleting-edge-properties">2.2.5 Deleting Edge Properties</h4> +<h5 id="params-4">Params</h5> +<p><strong>Path Parameter Description:</strong></p> +<ul> +<li>graph: The graph to operate on</li> +<li>id: The ID of the edge to be operated on</li> +</ul> +<p><strong>Request Parameter Description:</strong></p> +<ul> +<li>action: The eliminate action</li> +</ul> +<p><strong>Request Body Description:</strong></p> +<ul> +<li>Edge information</li> +</ul> <h5 id="method--url-4">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?action=eliminate +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop?action=eliminate </span></span></code></pre></div><h5 id="request-body-4">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> @@ -1791,45 +1853,35 @@ </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><blockquote> -<p>Note: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.</p> +<p>NOTE: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.</p> </blockquote> <h5 id="response-status-4">Response Status</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">400</span> </span></span></code></pre></div><h5 id="response-body-4">Response Body</h5> +<p>It is not possible to delete an attribute that is not set as nullable.</p> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20170324&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;exception&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;class java.lang.IllegalArgumentException&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;message&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;Can&#39;t remove non-null edge property &#39;p[weight-&gt;1.0]&#39;&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;cause&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="226-fetching-edges-that-match-the-criteria">2.2.6 Fetching Edges that Match the Criteria</h4> -<h5 id="params-1">Params</h5> +<h5 id="params-5">Params</h5> +<p><strong>Path Parameter:</strong></p> +<ul> +<li>graph: The graph to operate on</li> +</ul> +<p><strong>Request Parameters:</strong></p> <ul> <li>vertex_id: Vertex ID</li> -<li>direction: Direction of the edge (OUT | IN | BOTH)</li> +<li>direction: Edge direction (OUT | IN | BOTH), default is BOTH</li> <li>label: Edge label</li> -<li>properties: Key-value pairs of properties (previously indexed for property-based queries)</li> +<li>properties: Key-value pairs of properties (requires pre-built indexes for property queries)</li> +<li>keep_start_p: Default is false. When set to true, the range matching input expression will not be automatically escaped. For example, <code>properties={&quot;age&quot;:&quot;P.gt(0.8)&quot;}</code> will be interpreted as an exact match, i.e., the age property is equal to &ldquo;P.gt(0.8)&rdquo;</li> <li>offset: Offset, default is 0</li> -<li>limit: Number of results to query, default is 100</li> +<li>limit: Number of queries, default is 100</li> <li>page: Page number</li> </ul> -<p>The supported query options are as follows:</p> -<ul> -<li>When the vertex_id parameter is provided, the page parameter cannot be used. The direction, label, and properties parameters are optional, while offset and limit can be used to restrict the result range.</li> -<li>When the vertex_id parameter is not provided, the label and properties parameters are optional. -<ul> -<li>If the page parameter is used: the offset parameter is not available (either not provided or set to 0), the direction parameter is not available, and at most one property can be specified.</li> -<li>If the page parameter is not used: the offset and limit parameters can be used to restrict the result range, and the direction parameter is ignored.</li> -</ul> -</li> -</ul> -<p>Property key-value pairs consist of the attribute name and attribute value in JSON format. Multiple property key-value pairs are allowed as query conditions. The attribute value supports exact matching, range matching, and fuzzy matching. For exact matching, it is in the form <code>properties={&quot;weight&quot;: 0.8}</code>. For range matching, it is in the form <code>properties={&quot;age&quot;: &quot;P.gt(0.8)&quot;}</code>. For fuzzy matching, it is in the form <code>properties={&quot;city&quot;: &quot;P.textcontains(&quot;ChengDu China&quot;)}</code>. The supported expressions for range matching are as follows:</p> +<p>Key-value pairs of properties consist of the property name and value in JSON format. Multiple key-value pairs are allowed as query conditions. Property values support exact matching and range matching. For exact matching, it is in the form <code>properties={&quot;weight&quot;:0.8}</code>. For range matching, it is in the form <code>properties={&quot;age&quot;:&quot;P.gt(0.8)&quot;}</code>. The expressions supported by range matching are as follows:</p> <table> <thead> <tr> @@ -1840,215 +1892,188 @@ <tbody> <tr> <td>P.eq(number)</td> -<td>Edges with attribute value equal to <code>number</code></td> +<td>Edges with property value equal to number</td> </tr> <tr> <td>P.neq(number)</td> -<td>Edges with attribute value not equal to <code>number</code></td> +<td>Edges with property value not equal to number</td> </tr> <tr> <td>P.lt(number)</td> -<td>Edges with attribute value less than <code>number</code></td> +<td>Edges with property value less than number</td> </tr> <tr> <td>P.lte(number)</td> -<td>Edges with attribute value less than or equal to <code>number</code></td> +<td>Edges with property value less than or equal to number</td> </tr> <tr> <td>P.gt(number)</td> -<td>Edges with attribute value greater than <code>number</code></td> +<td>Edges with property value greater than number</td> </tr> <tr> <td>P.gte(number)</td> -<td>Edges with attribute value greater than or equal to <code>number</code></td> +<td>Edges with property value greater than or equal to number</td> </tr> <tr> -<td>P.between(number1, number2)</td> -<td>Edges with attribute value greater than or equal to <code>number1</code> and less than <code>number2</code></td> +<td>P.between(number1,number2)</td> +<td>Edges with property value greater than or equal to number1 and less than number2</td> </tr> <tr> -<td>P.inside(number1, number2)</td> -<td>Edges with attribute value greater than <code>number1</code> and less than <code>number2</code></td> +<td>P.inside(number1,number2)</td> +<td>Edges with property value greater than number1 and less than number2</td> </tr> <tr> -<td>P.outside(number1, number2)</td> -<td>Edges with attribute value less than <code>number1</code> and greater than <code>number2</code></td> +<td>P.outside(number1,number2)</td> +<td>Edges with property value less than number1 and greater than number2</td> </tr> <tr> -<td>P.within(value1, value2, value3, &hellip;)</td> -<td>Edges with attribute value equal to any of the given <code>values</code></td> +<td>P.within(value1,value2,value3,&hellip;)</td> +<td>Edges with property value equal to any of the given values</td> +</tr> +<tr> +<td>P.textcontains(value)</td> +<td>Edges with property value containing the given value (string type)</td> +</tr> +<tr> +<td>P.contains(value)</td> +<td>Edges with property value containing the given value (collection type)</td> </tr> </tbody> </table> -<p><strong>Query for edges connected to vertex person:josh (vertex_id=&ldquo;1:josh&rdquo;) with label created</strong></p> +<p><strong>Edges connected to the vertex person:marko(vertex_id=&ldquo;1:marko&rdquo;) with label knows and date property equal to &ldquo;20160111&rdquo;</strong></p> <h5 id="method--url-5">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id=&#34;1:josh&#34;&amp;direction=BOTH&amp;label=created&amp;properties={} +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id=&#34;1:marko&#34;&amp;label=knows&amp;properties={&#34;date&#34;:&#34;P.within(\&#34;20160111\&#34;)&#34;} </span></span></code></pre></div><h5 id="response-status-5">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-5">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20091111&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;1&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p><strong>Paginated query for all edges, fetching the first page (page without a parameter value), limited to 3 records</strong></p> +</span></span></code></pre></div><p><strong>Paginate and retrieve all edges, get the first page (page without parameter value), limit to 2 entries</strong></p> <h5 id="method--url-6">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&amp;limit=3 +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&amp;limit=2 </span></span></code></pre></div><h5 id="response-status-6">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-6">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20170324&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20091111&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p>The returned body contains the information of the next page, <code>&quot;page&quot;: &quot;002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&quot;</code>. When querying the next page, assign this value to the page parameter.</p> -<p><strong>Paginated query for all edges, fetching the next page (page with the value returned from the previous page), limited to 3 records</strong></p> +</span></span></code></pre></div><p>The returned body contains the page number information for the next page, <code>&quot;page&quot;: &quot;EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&quot;</code>. When querying the next page, assign this value to the page parameter.</p> +<p><strong>Paginate and retrieve all edges, get the next page (include the page value returned from the previous page), limit to 2 entries</strong></p> <h5 id="method--url-7">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&amp;limit=3 +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&amp;limit=2 </span></span></code></pre></div><h5 id="response-status-7">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-7">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;20130220&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130220&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;20160110&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160110&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">null</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p>When <code>&quot;page&quot;: null</code> is returned, it indicates that there are no more pages available. (Note: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the <code>page</code> value may not be empty. When requesting the next page data using that <code>page</code> value, it will return <code>empty data</code> and <code>page = null</code>. Similar situations apply for other cases.)</p> +</span></span></code></pre></div><p>When <code>&quot;page&quot;: null</code> is returned, it indicates that there are no more pages available.</p> +<blockquote> +<p>NOTE: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the <code>page</code> value may not be empty. When requesting the next page data using that <code>page</code> value, it will return <code>empty data</code> and <code>page = null</code>. Similar situations apply for other cases.</p> +</blockquote> <h4 id="227-fetching-edge-by-id">2.2.7 Fetching Edge by ID</h4> +<h5 id="params-6">Params</h5> +<p><strong>Path parameter description:</strong></p> +<ul> +<li>graph: The graph to be operated on.</li> +<li>id: The ID of the edge to be operated on.</li> +</ul> <h5 id="method--url-8">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop </span></span></code></pre></div><h5 id="response-status-8">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-8">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="228-deleting-edge-by-id">2.2.8 Deleting Edge by ID</h4> -<h5 id="params-2">Params</h5> +<h5 id="params-7">Params</h5> +<p><strong>Path parameter description:</strong></p> +<ul> +<li>graph: The graph to be operated on.</li> +<li>id: The ID of the edge to be operated on.</li> +</ul> +<p><strong>Request parameter description:</strong></p> <ul> -<li>label: Edge type, optional parameter</li> +<li>label: The label of the edge.</li> </ul> <p><strong>Deleting Edge by ID only</strong></p> <h5 id="method--url-9">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop </span></span></code></pre></div><h5 id="response-status-9">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">204</span> -</span></span></code></pre></div><p><strong>Deleting Edge by Label+ID</strong></p> +</span></span></code></pre></div><p><strong>Deleting Edge by Label + ID</strong></p> <p>In general, specifying the Label parameter along with the ID to delete an edge will provide better performance compared to deleting by ID only.</p> <h5 id="method--url-10">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?label=person +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;1&gt;&gt;S1:vadas?label=knows </span></span></code></pre></div><h5 id="response-status-10">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">204</span> </span></span></code></pre></div>Docs: Traverser API/docs/clients/restful-api/traverser/Mon, 01 Jan 0001 00:00:00 +0000/docs/clients/restful-api/traverser/ diff --git a/docs/index.xml b/docs/index.xml index 054f91c4c..1c64f8d13 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -10742,19 +10742,59 @@ Merging mode as needed, and when the Restore is completed, restore the graph mod <li>When the ID type is string, the vertex ID in the EdgeId has a prefix <code>S</code>, like &ldquo;S1:peter&gt;1&raquo;S2:lop&rdquo;.</li> </ul> <hr> -<p>The following examples assume that various schemas and vertex information mentioned above have been created.</p> -<h4 id="221-creating-an-edge">2.2.1 Creating an Edge</h4> -<p>Params Explanation</p> +<p>The following example requires creating a graph <code>schema</code> based on the following <code>groovy</code> script:</p> +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-groovy" data-lang="groovy"><span style="display:flex;"><span><span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000">org.apache.hugegraph.HugeFactory</span> +</span></span><span style="display:flex;"><span><span style="color:#204a87;font-weight:bold">import</span> <span style="color:#000">org.apache.tinkerpop.gremlin.structure.T</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">conf</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#4e9a06">&#34;conf/graphs/hugegraph.properties&#34;</span> +</span></span><span style="display:flex;"><span><span style="color:#000">graph</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">HugeFactory</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">open</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">conf</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">schema</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asInt</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asDouble</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asText</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">propertyKey</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">asInt</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">vertexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">primaryKeys</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">vertexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">primaryKeys</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;personByCity&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;personByAgeAndCity&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;softwareByPrice&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onV</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">edgeLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">sourceLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">targetLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">edgeLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">sourceLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">targetLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">properties</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;createdByDate&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;date&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">secondary</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;createdByWeight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">schema</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">indexLabel</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knowsByWeight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">onE</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">by</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#4e9a06">&#34;weight&#34;</span><span style="color:#ce5c00;font-weight:bold">).</span><span style="color:#c4a000">range</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">ifNotExist</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">create</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">marko</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;marko&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">29</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Beijing&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">vadas</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;vadas&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">27</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Hongkong&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">lop</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lop&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;java&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">328</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">josh</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;josh&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">32</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Beijing&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">ripple</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;ripple&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;lang&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;java&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;price&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">199</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span><span style="color:#000">peter</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">addVertex</span><span style="color:#ce5c00;font-weight:bold">(</span><span style="color:#000">T</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">label</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;name&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;peter&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;age&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#0000cf;font-weight:bold">35</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;city&#34;</span><span style="color:#ce5c00;font-weight:bold">,</span> <span style="color:#4e9a06">&#34;Shanghai&#34;</span><span style="color:#ce5c00;font-weight:bold">)</span> +</span></span><span style="display:flex;"><span> +</span></span><span style="display:flex;"><span><span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">tx</span><span style="color:#ce5c00;font-weight:bold">().</span><span style="color:#c4a000">commit</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span><span style="display:flex;"><span><span style="color:#000">g</span> <span style="color:#ce5c00;font-weight:bold">=</span> <span style="color:#000">graph</span><span style="color:#ce5c00;font-weight:bold">.</span><span style="color:#c4a000">traversal</span><span style="color:#ce5c00;font-weight:bold">()</span> +</span></span></code></pre></div><h4 id="221-creating-an-edge">2.2.1 Creating an Edge</h4> +<h5 id="params">Params</h5> +<p><strong>Path Parameter Description:</strong></p> +<ul> +<li>graph: The graph to operate on</li> +</ul> +<p><strong>Request Body Description:</strong></p> <ul> -<li>label: The name of the edge type, required.</li> -<li>outV: The ID of the source vertex, required.</li> -<li>inV: The ID of the target vertex, required.</li> -<li>outVLabel: The type of the source vertex, required.</li> -<li>inVLabel: The type of the target vertex, required.</li> +<li>label: The edge type name (required)</li> +<li>outV: The source vertex id (required)</li> +<li>inV: The target vertex id (required)</li> +<li>outVLabel: The source vertex type (required)</li> +<li>inVLabel: The target vertex type (required)</li> <li>properties: The properties associated with the edge. The internal structure of the object is as follows: <ol> -<li>name: The name of the property.</li> -<li>value: The value of the property.</li> +<li>name: The property name</li> +<li>value: The property value</li> </ol> </li> </ul> @@ -10763,60 +10803,69 @@ Merging mode as needed, and when the Restore is completed, restore the graph mod </span></span></code></pre></div><h5 id="request-body">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h5 id="response-status">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">201</span> </span></span></code></pre></div><h5 id="response-body">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="222-creating-multiple-edges">2.2.2 Creating Multiple Edges</h4> -<h5 id="params">Params</h5> +<h5 id="params-1">Params</h5> +<p><strong>Path Parameter Description:</strong></p> +<ul> +<li>graph: The graph to operate on</li> +</ul> +<p><strong>Request Parameter Description:</strong></p> +<ul> +<li>check_vertex: Whether to check the existence of vertices (true | false). When set to true, an error will be thrown if the source or target vertices of the edge to be inserted do not exist. Default is true.</li> +</ul> +<p><strong>Request Body Description:</strong></p> <ul> -<li>check_vertex: Whether to check vertex existence (true | false). When set to true and the source or target vertex of the edge being inserted does not exist, an error will be reported.</li> +<li>List of edge information</li> </ul> <h5 id="method--url-1">Method &amp; Url</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>POST http://localhost:8080/graphs/hugegraph/graph/edges/batch </span></span></code></pre></div><h5 id="request-body-1">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160110&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2016-01-10&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130220&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">]</span> @@ -10824,12 +10873,26 @@ Merging mode as needed, and when the Restore is completed, restore the graph mod <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">201</span> </span></span></code></pre></div><h5 id="response-body-1">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">[</span> -</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S1:vadas&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">]</span> </span></span></code></pre></div><h4 id="223-updating-edge-properties">2.2.3 Updating Edge Properties</h4> +<h5 id="params-2">Params</h5> +<p><strong>Path Parameter Description:</strong></p> +<ul> +<li>graph: The graph to operate on</li> +<li>id: The ID of the edge to be operated on</li> +</ul> +<p><strong>Request Parameter Description:</strong></p> +<ul> +<li>action: The append action</li> +</ul> +<p><strong>Request Body Description:</strong></p> +<ul> +<li>Edge information</li> +</ul> <h5 id="method--url-2">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?action=append +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop?action=append </span></span></code></pre></div><h5 id="request-body-2">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> @@ -10837,131 +10900,130 @@ Merging mode as needed, and when the Restore is completed, restore the graph mod </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><blockquote> -<p>Note: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.</p> +<p>NOTE: There are three categories of property values: single, set, and list. If it is single, it means adding or updating the property value. If it is set or list, it means appending the property value.</p> </blockquote> <h5 id="response-status-2">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-2">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="224-batch-updating-edge-properties">2.2.4 Batch Updating Edge Properties</h4> -<h5 id="function-description">Function Description</h5> -<p>Similar to batch updating vertex properties.</p> -<p>Assuming the original edge and its properties are:</p> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1512835200000</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1361289600000</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> -</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><h5 id="method--url-3">Method &amp; Url</h5> +<h5 id="params-3">Params</h5> +<p><strong>Path Parameter Description:</strong></p> +<ul> +<li>graph: The graph to operate on</li> +</ul> +<p><strong>Request Body Description:</strong></p> +<ul> +<li>edges: List of edge information</li> +<li>update_strategies: For each property, you can set its update strategy individually, including: +<ul> +<li>SUM: Only supports number type</li> +<li>BIGGER/SMALLER: Only supports date/number type</li> +<li>UNION/INTERSECTION: Only supports set type</li> +<li>APPEND/ELIMINATE: Only supports collection type</li> +<li>OVERRIDE</li> +</ul> +</li> +<li>check_vertex: Whether to check the existence of vertices (true | false). When set to true, an error will be thrown if the source or target vertices of the edge to be inserted do not exist. Default is true.</li> +<li>create_if_not_exist: Currently only supports setting to true</li> +</ul> +<h5 id="method--url-3">Method &amp; Url</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://127.0.0.1:8080/graphs/hugegraph/graph/edges/batch </span></span></code></pre></div><h5 id="request-body-3">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">0.1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1522835200000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">0.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1301289600000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;update_strategies&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;SUM&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;BIGGER&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;update_strategies&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;SUM&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;OVERRIDE&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;check_vertex&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">false</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;create_if_not_exist&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#204a87;font-weight:bold">true</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;create_if_not_exist&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">true</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h5 id="response-status-3">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-3">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:[</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1.1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1522835200000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;7JooBil0&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span><span style="color:#0000cf;font-weight:bold">1301289600000</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="225-deleting-edge-properties">2.2.5 Deleting Edge Properties</h4> +<h5 id="params-4">Params</h5> +<p><strong>Path Parameter Description:</strong></p> +<ul> +<li>graph: The graph to operate on</li> +<li>id: The ID of the edge to be operated on</li> +</ul> +<p><strong>Request Parameter Description:</strong></p> +<ul> +<li>action: The eliminate action</li> +</ul> +<p><strong>Request Body Description:</strong></p> +<ul> +<li>Edge information</li> +</ul> <h5 id="method--url-4">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?action=eliminate +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>PUT http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop?action=eliminate </span></span></code></pre></div><h5 id="request-body-4">Request Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> @@ -10969,45 +11031,35 @@ Merging mode as needed, and when the Restore is completed, restore the graph mod </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><blockquote> -<p>Note: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.</p> +<p>NOTE: This will directly delete the properties (removing the key and all values), regardless of whether the property values are single, set, or list.</p> </blockquote> <h5 id="response-status-4">Response Status</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">400</span> </span></span></code></pre></div><h5 id="response-body-4">Response Body</h5> +<p>It is not possible to delete an attribute that is not set as nullable.</p> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20170324&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;exception&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;class java.lang.IllegalArgumentException&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;message&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;Can&#39;t remove non-null edge property &#39;p[weight-&gt;1.0]&#39;&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;cause&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="226-fetching-edges-that-match-the-criteria">2.2.6 Fetching Edges that Match the Criteria</h4> -<h5 id="params-1">Params</h5> +<h5 id="params-5">Params</h5> +<p><strong>Path Parameter:</strong></p> +<ul> +<li>graph: The graph to operate on</li> +</ul> +<p><strong>Request Parameters:</strong></p> <ul> <li>vertex_id: Vertex ID</li> -<li>direction: Direction of the edge (OUT | IN | BOTH)</li> +<li>direction: Edge direction (OUT | IN | BOTH), default is BOTH</li> <li>label: Edge label</li> -<li>properties: Key-value pairs of properties (previously indexed for property-based queries)</li> +<li>properties: Key-value pairs of properties (requires pre-built indexes for property queries)</li> +<li>keep_start_p: Default is false. When set to true, the range matching input expression will not be automatically escaped. For example, <code>properties={&quot;age&quot;:&quot;P.gt(0.8)&quot;}</code> will be interpreted as an exact match, i.e., the age property is equal to &ldquo;P.gt(0.8)&rdquo;</li> <li>offset: Offset, default is 0</li> -<li>limit: Number of results to query, default is 100</li> +<li>limit: Number of queries, default is 100</li> <li>page: Page number</li> </ul> -<p>The supported query options are as follows:</p> -<ul> -<li>When the vertex_id parameter is provided, the page parameter cannot be used. The direction, label, and properties parameters are optional, while offset and limit can be used to restrict the result range.</li> -<li>When the vertex_id parameter is not provided, the label and properties parameters are optional. -<ul> -<li>If the page parameter is used: the offset parameter is not available (either not provided or set to 0), the direction parameter is not available, and at most one property can be specified.</li> -<li>If the page parameter is not used: the offset and limit parameters can be used to restrict the result range, and the direction parameter is ignored.</li> -</ul> -</li> -</ul> -<p>Property key-value pairs consist of the attribute name and attribute value in JSON format. Multiple property key-value pairs are allowed as query conditions. The attribute value supports exact matching, range matching, and fuzzy matching. For exact matching, it is in the form <code>properties={&quot;weight&quot;: 0.8}</code>. For range matching, it is in the form <code>properties={&quot;age&quot;: &quot;P.gt(0.8)&quot;}</code>. For fuzzy matching, it is in the form <code>properties={&quot;city&quot;: &quot;P.textcontains(&quot;ChengDu China&quot;)}</code>. The supported expressions for range matching are as follows:</p> +<p>Key-value pairs of properties consist of the property name and value in JSON format. Multiple key-value pairs are allowed as query conditions. Property values support exact matching and range matching. For exact matching, it is in the form <code>properties={&quot;weight&quot;:0.8}</code>. For range matching, it is in the form <code>properties={&quot;age&quot;:&quot;P.gt(0.8)&quot;}</code>. The expressions supported by range matching are as follows:</p> <table> <thead> <tr> @@ -11018,215 +11070,188 @@ Merging mode as needed, and when the Restore is completed, restore the graph mod <tbody> <tr> <td>P.eq(number)</td> -<td>Edges with attribute value equal to <code>number</code></td> +<td>Edges with property value equal to number</td> </tr> <tr> <td>P.neq(number)</td> -<td>Edges with attribute value not equal to <code>number</code></td> +<td>Edges with property value not equal to number</td> </tr> <tr> <td>P.lt(number)</td> -<td>Edges with attribute value less than <code>number</code></td> +<td>Edges with property value less than number</td> </tr> <tr> <td>P.lte(number)</td> -<td>Edges with attribute value less than or equal to <code>number</code></td> +<td>Edges with property value less than or equal to number</td> </tr> <tr> <td>P.gt(number)</td> -<td>Edges with attribute value greater than <code>number</code></td> +<td>Edges with property value greater than number</td> </tr> <tr> <td>P.gte(number)</td> -<td>Edges with attribute value greater than or equal to <code>number</code></td> +<td>Edges with property value greater than or equal to number</td> +</tr> +<tr> +<td>P.between(number1,number2)</td> +<td>Edges with property value greater than or equal to number1 and less than number2</td> +</tr> +<tr> +<td>P.inside(number1,number2)</td> +<td>Edges with property value greater than number1 and less than number2</td> </tr> <tr> -<td>P.between(number1, number2)</td> -<td>Edges with attribute value greater than or equal to <code>number1</code> and less than <code>number2</code></td> +<td>P.outside(number1,number2)</td> +<td>Edges with property value less than number1 and greater than number2</td> </tr> <tr> -<td>P.inside(number1, number2)</td> -<td>Edges with attribute value greater than <code>number1</code> and less than <code>number2</code></td> +<td>P.within(value1,value2,value3,&hellip;)</td> +<td>Edges with property value equal to any of the given values</td> </tr> <tr> -<td>P.outside(number1, number2)</td> -<td>Edges with attribute value less than <code>number1</code> and greater than <code>number2</code></td> +<td>P.textcontains(value)</td> +<td>Edges with property value containing the given value (string type)</td> </tr> <tr> -<td>P.within(value1, value2, value3, &hellip;)</td> -<td>Edges with attribute value equal to any of the given <code>values</code></td> +<td>P.contains(value)</td> +<td>Edges with property value containing the given value (collection type)</td> </tr> </tbody> </table> -<p><strong>Query for edges connected to vertex person:josh (vertex_id=&ldquo;1:josh&rdquo;) with label created</strong></p> +<p><strong>Edges connected to the vertex person:marko(vertex_id=&ldquo;1:marko&rdquo;) with label knows and date property equal to &ldquo;20160111&rdquo;</strong></p> <h5 id="method--url-5">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id=&#34;1:josh&#34;&amp;direction=BOTH&amp;label=created&amp;properties={} +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?vertex_id=&#34;1:marko&#34;&amp;label=knows&amp;properties={&#34;date&#34;:&#34;P.within(\&#34;20160111\&#34;)&#34;} </span></span></code></pre></div><h5 id="response-status-5">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-5">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20091111&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;1&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">]</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p><strong>Paginated query for all edges, fetching the first page (page without a parameter value), limited to 3 records</strong></p> +</span></span></code></pre></div><p><strong>Paginate and retrieve all edges, get the first page (page without parameter value), limit to 2 entries</strong></p> <h5 id="method--url-6">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&amp;limit=3 +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page&amp;limit=2 </span></span></code></pre></div><h5 id="response-status-6">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-6">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20170324&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20091111&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130221&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:josh&gt;2&gt;&gt;S2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:ripple&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.5</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160111&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&#34;</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&#34;</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p>The returned body contains the information of the next page, <code>&quot;page&quot;: &quot;002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&quot;</code>. When querying the next page, assign this value to the page parameter.</p> -<p><strong>Paginated query for all edges, fetching the next page (page with the value returned from the previous page), limited to 3 records</strong></p> +</span></span></code></pre></div><p>The returned body contains the page number information for the next page, <code>&quot;page&quot;: &quot;EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&quot;</code>. When querying the next page, assign this value to the page parameter.</p> +<p><strong>Paginate and retrieve all edges, get the next page (include the page value returned from the previous page), limit to 2 entries</strong></p> <h5 id="method--url-7">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=002500100753313a6a6f73681210010004000000020953323a726970706c65f07ffffffcf07ffffffd8460d63f4b398dd2721ed4fdb7716b420004&amp;limit=3 +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://127.0.0.1:8080/graphs/hugegraph/graph/edges?page=EoYxOm1hcmtvgggCAIQyOmxvcAAAAAAAAAAC&amp;limit=2 </span></span></code></pre></div><h5 id="response-status-7">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-7">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;20130220&gt;S1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:josh&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20130220&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;1&gt;20160110&gt;S1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;knows&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:vadas&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.5</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20160110&#34;</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> -</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">},</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;edges&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">[</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">{</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.4</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">],</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;page&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#204a87;font-weight:bold">null</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> -</span></span></code></pre></div><p>When <code>&quot;page&quot;: null</code> is returned, it indicates that there are no more pages available. (Note: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the <code>page</code> value may not be empty. When requesting the next page data using that <code>page</code> value, it will return <code>empty data</code> and <code>page = null</code>. Similar situations apply for other cases.)</p> +</span></span></code></pre></div><p>When <code>&quot;page&quot;: null</code> is returned, it indicates that there are no more pages available.</p> +<blockquote> +<p>NOTE: When the backend is Cassandra, for performance considerations, if the returned page happens to be the last page, the <code>page</code> value may not be empty. When requesting the next page data using that <code>page</code> value, it will return <code>empty data</code> and <code>page = null</code>. Similar situations apply for other cases.</p> +</blockquote> <h4 id="227-fetching-edge-by-id">2.2.7 Fetching Edge by ID</h4> +<h5 id="params-6">Params</h5> +<p><strong>Path parameter description:</strong></p> +<ul> +<li>graph: The graph to be operated on.</li> +<li>id: The ID of the edge to be operated on.</li> +</ul> <h5 id="method--url-8">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>GET http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop </span></span></code></pre></div><h5 id="response-status-8">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">200</span> </span></span></code></pre></div><h5 id="response-body-8">Response Body</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:peter&gt;1&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;id&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;S1:marko&gt;2&gt;&gt;S2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;label&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;created&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;type&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;edge&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:marko&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;person&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2:lop&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;outV&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;1:peter&#34;</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;inVLabel&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;software&#34;</span><span style="color:#000;font-weight:bold">,</span> </span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;properties&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#000;font-weight:bold">{</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;2017-5-18&#34;</span><span style="color:#000;font-weight:bold">,</span> -</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">0.2</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;weight&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#0000cf;font-weight:bold">1.0</span><span style="color:#000;font-weight:bold">,</span> +</span></span><span style="display:flex;"><span> <span style="color:#204a87;font-weight:bold">&#34;date&#34;</span><span style="color:#000;font-weight:bold">:</span> <span style="color:#4e9a06">&#34;20171210&#34;</span> </span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">}</span> </span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> </span></span></code></pre></div><h4 id="228-deleting-edge-by-id">2.2.8 Deleting Edge by ID</h4> -<h5 id="params-2">Params</h5> +<h5 id="params-7">Params</h5> +<p><strong>Path parameter description:</strong></p> +<ul> +<li>graph: The graph to be operated on.</li> +<li>id: The ID of the edge to be operated on.</li> +</ul> +<p><strong>Request parameter description:</strong></p> <ul> -<li>label: Edge type, optional parameter</li> +<li>label: The label of the edge.</li> </ul> <p><strong>Deleting Edge by ID only</strong></p> <h5 id="method--url-9">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;2&gt;&gt;S2:lop </span></span></code></pre></div><h5 id="response-status-9">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">204</span> -</span></span></code></pre></div><p><strong>Deleting Edge by Label+ID</strong></p> +</span></span></code></pre></div><p><strong>Deleting Edge by Label + ID</strong></p> <p>In general, specifying the Label parameter along with the ID to delete an edge will provide better performance compared to deleting by ID only.</p> <h5 id="method--url-10">Method &amp; Url</h5> -<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:peter&gt;1&gt;&gt;S2:lop?label=person +<div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>DELETE http://localhost:8080/graphs/hugegraph/graph/edges/S1:marko&gt;1&gt;&gt;S1:vadas?label=knows </span></span></code></pre></div><h5 id="response-status-10">Response Status</h5> <div class="highlight"><pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#0000cf;font-weight:bold">204</span> </span></span></code></pre></div>Docs: Traverser API/docs/clients/restful-api/traverser/Mon, 01 Jan 0001 00:00:00 +0000/docs/clients/restful-api/traverser/ diff --git a/en/sitemap.xml b/en/sitemap.xml index 90c9797b4..9240a5501 100644 --- a/en/sitemap.xml +++ b/en/sitemap.xml @@ -1 +1 @@ -/docs/guides/architectural/2023-06-25T21:06:07+08:00/docs/config/config-guide/2023-06-21T14:48:04+08:00/docs/language/hugegraph-gremlin/2023-05-14T07:29:41-05:00/docs/contribution-guidelines/contribute/2023-06-26T14:59:53+08:00/docs/performance/hugegraph-benchmark-0.5.6/2023-05-14T22:31:02-05:00/docs/quickstart/hugegraph-server/2023-06-25T21:06:07+08:00/docs/introduction/readme/2023-06-18T14:57:33+08:00/docs/changelog/hugegraph-1.0.0-release-notes/2023-01-09T07:41:46+08:00/docs/clients/restful-api/2023-05-22T00:00:33-05:00/docs/clients/restful-api/schema/2023-05-14T19:35:13+08:00/docs/performance/api-preformance/hugegraph-api-0.5.6-rocksdb/2023-05-15T22:47:44-05:00/docs/config/config-option/2023-02-08T20:56:09+08:00/docs/guides/desgin-concept/2023-05-14T07:20:21-05:00/docs/download/download/2023-06-17T14:43:04+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/2023-06-17T14:43:04+08:00/docs/quickstart/hugegraph-loader/2023-05-17T23:12:35+08:00/docs/clients/restful-api/propertykey/2023-05-19T05:15:56-05:00/docs/changelog/hugegraph-0.12.0-release-notes/2023-05-18T06:11:19-05:00/docs/contribution-guidelines/subscribe/2023-06-17T14:43:04+08:00/docs/performance/api-preformance/hugegraph-api-0.5.6-cassandra/2023-05-16T23:30:00-05:00/docs/config/config-authentication/2023-05-19T05:12:35-05:00/docs/clients/gremlin-console/2023-06-12T23:52:07+08:00/docs/guides/custom-plugin/2023-05-14T07:22:46-05:00/docs/performance/hugegraph-loader-performance/2023-05-18T00:34:48-05:00/docs/quickstart/hugegraph-tools/2023-05-09T21:27:34+08:00/docs/quickstart/2022-04-17T11:36:55+08:00/docs/contribution-guidelines/validate-release/2023-02-15T16:14:21+08:00/docs/clients/restful-api/vertexlabel/2023-05-19T04:03:23-05:00/docs/guides/backup-restore/2023-05-14T07:26:12-05:00/docs/config/2022-04-17T11:36:55+08:00/docs/config/config-https/2023-05-19T05:04:16-05:00/docs/clients/restful-api/edgelabel/2023-05-19T05:17:26-05:00/docs/contribution-guidelines/hugegraph-server-idea-setup/2023-06-25T21:06:07+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-05-14T07:28:41-05:00/docs/clients/restful-api/indexlabel/2023-05-19T05:18:17-05:00/docs/quickstart/hugegraph-client/2023-05-14T22:39:27+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-06-25T21:06:46+08:00/docs/language/2022-04-17T11:36:55+08:00/docs/clients/restful-api/vertex/2023-06-04T23:04:47+08:00/docs/clients/restful-api/edge/2023-05-19T22:22:11-05: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/2023-05-20T06:12:55-05: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/2023-05-21T04:38:57-05: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/2023-05-21T04:39:11-05:00/docs/clients/restful-api/auth/2023-05-21T04:40:00-05:00/docs/clients/restful-api/other/2023-05-21T04:39:25-05: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/2023-06-25T21:06:07+08:00/docs/config/config-guide/2023-06-21T14:48:04+08:00/docs/language/hugegraph-gremlin/2023-05-14T07:29:41-05:00/docs/contribution-guidelines/contribute/2023-06-26T14:59:53+08:00/docs/performance/hugegraph-benchmark-0.5.6/2023-05-14T22:31:02-05:00/docs/quickstart/hugegraph-server/2023-06-25T21:06:07+08:00/docs/introduction/readme/2023-06-18T14:57:33+08:00/docs/changelog/hugegraph-1.0.0-release-notes/2023-01-09T07:41:46+08:00/docs/clients/restful-api/2023-05-22T00:00:33-05:00/docs/clients/restful-api/schema/2023-05-14T19:35:13+08:00/docs/performance/api-preformance/hugegraph-api-0.5.6-rocksdb/2023-05-15T22:47:44-05:00/docs/config/config-option/2023-02-08T20:56:09+08:00/docs/guides/desgin-concept/2023-05-14T07:20:21-05:00/docs/download/download/2023-06-17T14:43:04+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/2023-06-17T14:43:04+08:00/docs/quickstart/hugegraph-loader/2023-05-17T23:12:35+08:00/docs/clients/restful-api/propertykey/2023-05-19T05:15:56-05:00/docs/changelog/hugegraph-0.12.0-release-notes/2023-05-18T06:11:19-05:00/docs/contribution-guidelines/subscribe/2023-06-17T14:43:04+08:00/docs/performance/api-preformance/hugegraph-api-0.5.6-cassandra/2023-05-16T23:30:00-05:00/docs/config/config-authentication/2023-05-19T05:12:35-05:00/docs/clients/gremlin-console/2023-06-12T23:52:07+08:00/docs/guides/custom-plugin/2023-05-14T07:22:46-05:00/docs/performance/hugegraph-loader-performance/2023-05-18T00:34:48-05:00/docs/quickstart/hugegraph-tools/2023-05-09T21:27:34+08:00/docs/quickstart/2022-04-17T11:36:55+08:00/docs/contribution-guidelines/validate-release/2023-02-15T16:14:21+08:00/docs/clients/restful-api/vertexlabel/2023-05-19T04:03:23-05:00/docs/guides/backup-restore/2023-05-14T07:26:12-05:00/docs/config/2022-04-17T11:36:55+08:00/docs/config/config-https/2023-05-19T05:04:16-05:00/docs/clients/restful-api/edgelabel/2023-05-19T05:17:26-05:00/docs/contribution-guidelines/hugegraph-server-idea-setup/2023-06-25T21:06:07+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-05-14T07:28:41-05:00/docs/clients/restful-api/indexlabel/2023-05-19T05:18:17-05:00/docs/quickstart/hugegraph-client/2023-05-14T22:39:27+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-06-25T21:06:46+08:00/docs/language/2022-04-17T11:36:55+08:00/docs/clients/restful-api/vertex/2023-06-04T23:04:47+08:00/docs/clients/restful-api/edge/2023-06-29T10:17:29+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/2023-05-20T06:12:55-05: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/2023-05-21T04:38:57-05: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/2023-05-21T04:39:11-05:00/docs/clients/restful-api/auth/2023-05-21T04:40:00-05:00/docs/clients/restful-api/other/2023-05-21T04:39:25-05: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 2bc29d893..a6313f8b3 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -/en/sitemap.xml2023-06-26T14:59:53+08:00/cn/sitemap.xml2023-06-26T14:59:53+08:00 \ No newline at end of file +/en/sitemap.xml2023-06-29T10:17:29+08:00/cn/sitemap.xml2023-06-29T10:17:29+08:00 \ No newline at end of file