// Named-path assembly (MATCH p = ...): after the pattern binds, each row's// path value is reconstructed from its start node and the hop's bound// relationship position(s); the matchSink then runs the stage WHERE as a// post-path filter so predicates over nodes(p)/rels(p)/length(p) resolve.
package execimport ()// pathRelPositionsOf reads a path hop's bound relationship value: a single// rel (fixed hop) or a list of them (quantified hop).func pathRelPositionsOf( value.Value) []uint32 {if , := .AsRel(); {return []uint32{} }if , := .AsList(); { := make([]uint32, 0, len())for , := range {if , := .AsRel(); { = append(, ) } }return }returnnil}// reconstructPathNodes walks from start through the given relationship// positions -- each physical relationship has one position whichever// endpoint it is walked from, so the matched hop's positions name a valid// walk and each hop resolves O(1) by its endpoints. The result slice is// fresh: it escapes into the row's path value.func reconstructPathNodes( *eval.Ctx, graph.NodeID, []uint32) []graph.NodeID { := make([]graph.NodeID, 0, len()+1) = append(, ) := for , := range { , , := .G.RelEndpoints()if ! {break }vargraph.NodeIDswitch {case : = case : = default:return } = append(, ) = }return}
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.