示例图集
以下示例根据该图集运行:

length()
返回路径中的总边数。
| 语法 | length(<pathAlias>) | ||
| 参数 | 名称 | 类型 | 描述 | 
| <pathAlias> | PATH | 路径别名引用 | |
| 返回类型 | UINT | ||
n().re()[1:3].n() as p
return p{*}, length(p) as length
结果:
| p | length | 
|---|---|
|  | 2 | 
|  | 1 | 
|  | 1 | 
pedges()
将路径中的所有边放入一个列表。
| 语法 | pedges(<pathAlias>) | ||
| 参数 | 名称 | 类型 | 描述 | 
| <pathAlias> | PATH | 路径别名引用 | |
| 返回类型 | LIST | ||
n({_id == "P1"}).re()[1:2].n() as p
return pedges(p)
结果:
| pedges(p) | 
|---|
| [{"from":"P1","to":"P2","uuid":"1","from_uuid":"10448353334522806273","to_uuid":"3098478742654156802","schema":"Cites","values":{}}] | 
| [{"from":"P1","to":"P2","uuid":"1","from_uuid":"10448353334522806273","to_uuid":"3098478742654156802","schema":"Cites","values":{}},{"from":"P2","to":"P3","uuid":"2","from_uuid":"3098478742654156802","to_uuid":"13618887472191635459","schema":"Cites","values":{}}] | 
pedgeUuids()
将路径中所有边的_uuid值放入一个列表。
| 语法 | pedgeUuids(<pathAlias>) | ||
| 参数 | 名称 | 类型 | 描述 | 
| <pathAlias> | PATH | 路径别名引用 | |
| 返回类型 | LIST | ||
n({_id == "P1"}).re()[1:2].n() as p
return pedgeUuids(p)
结果:
| pedgeUuids(p) | 
|---|
| ["1"] | 
| ["1","2"] | 
pnodes()
将路径中的所有点放入一个列表。
| 语法 | pnodes(<pathAlias>) | ||
| 参数 | 名称 | 类型 | 描述 | 
| <pathAlias> | PATH | 路径别名引用 | |
| 返回类型 | LIST | ||
n({_id == "P1"}).re()[1:2].n() as p
return pnodes(p)
结果:
| pnodes(p) | 
|---|
| [{"id":"P1","uuid":"10448353334522806273","schema":"Paper","values":{}},{"id":"P2","uuid":"3098478742654156802","schema":"Paper","values":{}}] | 
| [{"id":"P1","uuid":"10448353334522806273","schema":"Paper","values":{}},{"id":"P2","uuid":"3098478742654156802","schema":"Paper","values":{}},{"id":"P3","uuid":"13618887472191635459","schema":"Paper","values":{}}] | 
pnodeIds()
将路径中所有点的_id值放入一个列表。
| 语法 | pnodeIds(<pathAlias>) | ||
| 参数 | 名称 | 类型 | 描述 | 
| <pathAlias> | PATH | 路径别名引用 | |
| 返回类型 | LIST | ||
n({_id == "P1"}).re()[1:2].n() as p
return pnodeIds(p)
结果:
| pnodeIds(p) | 
|---|
| ["P1","P2"] | 
| ["P1","P2","P3"] | 
