UltipaDocs
Try Playground
  • Introduction
  • Terminologies
    • Graphset
    • Schema
    • Property
    • Constraints
    • Insert
    • Overwrite or Insert
    • Upsert
    • Update
    • Delete
    • Find Nodes
    • Find Edges
      • AB
      • Autonet
      • Spread
      • Path Template
      • K-Hop
      • K-Hop Template
    • GROUP BY
    • ORDER BY
    • SKIP
    • LIMIT
    • WHERE
    • RETURN
    • WITH
    • UNCOLLECT
    • UNION
    • UNION ALL
    • CALL
    • All Functions
    • Path Functions
    • Aggregate Functions
    • Mathematical Functions
    • Trigonometric Functions
    • String Functions
    • List Functions
    • Datetime Functions
    • Spatial Functions
    • Table Functions
    • Null Functions
    • Type Conversion Functions
  • Operators
  • Expressions
    • Index
    • Full-text Index
    • Vector Index
    • Cache
    • Overview
    • Managing HDC Graphs
    • HDC Graph Queries
    • Process
    • Job
    • Execution Plan
    • Alias
    • Filter
    • Values and Types
    • Data Flow in Queries
    • Comments
    • Reserved Words
  • Access Control
  1. Docs
  2. /
  3. UQL
  4. /
  5. Functions

Path Functions

Example Graph

The following examples run against this graph:

length()

Returns the number of edges in a path.

Syntaxlength(<pathAlias>)
ArgumentsNameTypeDescription
<pathAlias>PATHPath alias reference
Return TypeUINT
UQL
n().re()[1:3].n() as p
return p{*}, length(p) as length

Result:

p
length
2
1
1

pedges()

Collects edges in a path into a list.

Syntaxpedges(<pathAlias>)
ArgumentsNameTypeDescription
<pathAlias>PATHPath alias reference
Return TypeLIST
UQL
n({_id == "P1"}).re()[1:2].n() as p
return pedges(p)

Result:

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()

Collects the _uuid values of edges in a path into a list.

SyntaxpedgeUuids(<pathAlias>)
ArgumentsNameTypeDescription
<pathAlias>PATHPath alias reference
Return TypeLIST
UQL
n({_id == "P1"}).re()[1:2].n() as p
return pedgeUuids(p)

Result:

pedgeUuids(p)
["1"]
["1","2"]

pnodes()

Collects nodes in a path into a list.

Syntaxpnodes(<pathAlias>)
ArgumentsNameTypeDescription
<pathAlias>PATHPath alias reference
Return TypeLIST
UQL
n({_id == "P1"}).re()[1:2].n() as p
return pnodes(p)

Result:

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()

Collects the _id values of nodes in a path into a list.

SyntaxpnodeIds(<pathAlias>)
ArgumentsNameTypeDescription
<pathAlias>PATHPath alias reference
Return TypeLIST
UQL
n({_id == "P1"}).re()[1:2].n() as p
return pnodeIds(p)

Result:

pnodeIds(p)
["P1","P2"]
["P1","P2","P3"]