(id: ElementId)
| 127 | } |
| 128 | |
| 129 | public getEdgeById(id: ElementId): StoredEdge | undefined { |
| 130 | const [label, uuid] = parseElementId(id); |
| 131 | const collection = this.getEdgeCollectionMap(label); |
| 132 | const data = collection.get(uuid); |
| 133 | if (data == null) { |
| 134 | return undefined; |
| 135 | } |
| 136 | const existing = this.#edgeIdentities.get(data); |
| 137 | if (existing != null) { |
| 138 | return existing; |
| 139 | } |
| 140 | const inV = data.get($InVKey) as ElementId | undefined; |
| 141 | if (inV == null) { |
| 142 | return undefined; |
| 143 | } |
| 144 | const outV = data.get($OutVKey) as ElementId | undefined; |
| 145 | if (outV == null) { |
| 146 | return undefined; |
| 147 | } |
| 148 | const properties = this.getEdgeProperties(label, uuid, data); |
| 149 | const edge: StoredEdge = { "@type": "Edge", id, properties, inV, outV }; |
| 150 | this.#edgeIdentities.set(data, edge); |
| 151 | return edge; |
| 152 | } |
| 153 | |
| 154 | public *getEdgesByIds(ids: ElementId[]): Iterable<StoredEdge> { |
| 155 | for (const id of ids) { |
no test coverage detected