same_community
Generic Description
Checks whether two community ids are equal. It is documented separately because similarity orientation, vector dimensions, and set semantics directly affect ranking and interpretation.
Simple example:
RETURN same_community(7, 7) AS value
Consumer-Level Explanation
Use it after community detection when later query stages need a readable same-group predicate. Prefer this function when symbolic graph filters and similarity evidence should remain in one auditable Cypher pipeline.
More Detailed Explanation
same_community keeps similarity scoring in the same Cypher pipeline as symbolic graph filters and document metadata checks. That lets a query combine labels, relationships, time filters, and embedding or set overlap scores without asking a client to reconcile separate result sets.
Advanced Example
This example applies same_community after symbolic graph filtering, which keeps hybrid retrieval constraints and similarity scoring in one visible pipeline.
WITH [{left: 'acct-1', right: 'acct-2', left_community: 4, right_community: 4}, {left: 'acct-1', right: 'acct-9', left_community: 4, right_community: 8}] AS pairs
UNWIND pairs AS pair
RETURN pair.left AS left_entity, pair.right AS right_entity, same_community(pair.left_community, pair.right_community) AS same_group
ORDER BY left_entity, right_entity
Real Use Cases
- semantic ranking over embedded documents after graph/time filtering
- link-prediction features based on shared neighbors or metadata overlap
- hybrid retrieval where symbolic constraints and vector scores are both visible
Real Limitations And Tradeoffs
- vector functions require compatible dimensions and meaningful embedding spaces
- set-similarity functions treat lists as sets and may ignore duplicate frequency
- a high similarity score is evidence, not proof of domain equivalence