Die direkten Beziehungen eines Symbols nach Richtung und Art, als Wahrheit fuer K13.
(name)
| 81 | |
| 82 | /** Die direkten Beziehungen eines Symbols nach Richtung und Art, als Wahrheit fuer K13. */ |
| 83 | async function relationCounts(name) { |
| 84 | const count = async (pattern) => { |
| 85 | const answer = await tool('query_graph', { project: PROJECT, format: 'json', query: `MATCH ${pattern} WHERE n.name = "${name}" RETURN type(r) AS type, count(r) AS edges ORDER BY type` }); |
| 86 | return Object.fromEntries((answer?.rows ?? []).map(([type, edges]) => [type, Number(edges)])); |
| 87 | }; |
| 88 | return { incoming: await count('(a)-[r]->(n)'), outgoing: await count('(n)-[r]->(b)') }; |
| 89 | } |
| 90 | |
| 91 | /* ------------------------------------------------------------------ */ |
| 92 | /* In jede Seite */ |