| 194 | } |
| 195 | |
| 196 | func (g *Graph) getLabel(lblIdx int) string { |
| 197 | if lblIdx >= len(g.labels) { |
| 198 | // Missing label, refresh label mapping table. |
| 199 | g.mutex.Lock() |
| 200 | |
| 201 | // Recheck now that we've got the lock. |
| 202 | if lblIdx >= len(g.labels) { |
| 203 | g.labels = g.Labels() |
| 204 | // Retry. |
| 205 | if lblIdx >= len(g.labels) { |
| 206 | // Error! |
| 207 | panic("Unknown label index.") |
| 208 | } |
| 209 | } |
| 210 | g.mutex.Unlock() |
| 211 | } |
| 212 | |
| 213 | return g.labels[lblIdx] |
| 214 | } |
| 215 | |
| 216 | func (g *Graph) getRelation(relIdx int) string { |
| 217 | if relIdx >= len(g.relationshipTypes) { |