MCPcopy Create free account
hub / github.com/codemix/graph / getVertexById

Method getVertexById

packages/y-graph-storage/src/YGraphStorage.ts:77–95  ·  view source on GitHub ↗
(id: ElementId)

Source from the content-addressed store, hash-verified

75 }
76
77 public getVertexById(id: ElementId): StoredVertex | undefined {
78 const [label, uuid] = parseElementId(id);
79 const collection = this.getVertexCollectionMap(label);
80 const data = collection.get(uuid);
81 if (data == null) {
82 return undefined;
83 }
84 const existing = this.#vertexIdentities.get(data);
85 if (existing != null) {
86 return existing;
87 }
88 const vertex: StoredVertex = {
89 "@type": "Vertex",
90 id,
91 properties: this.getVertexProperties(label, uuid, data),
92 };
93 this.#vertexIdentities.set(data, vertex);
94 return vertex;
95 }
96
97 public *getVerticesByIds(ids: ElementId[]): Iterable<StoredVertex> {
98 for (const id of ids) {

Callers 1

getVerticesByIdsMethod · 0.95

Calls 4

getVertexPropertiesMethod · 0.95
parseElementIdFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected