graph_quality

Generic Description

nexyron.graph_quality computes a bundled structural quality assessment for either the observed LPG graph or the materialized abstraction knowledge graph.

Simple example:

CALL nexyron.graph_quality({graph: 'observed'})
YIELD summary, cleanup, communities, centrality, weak_nodes, runtime
RETURN summary, cleanup, communities, centrality, weak_nodes, runtime

Knowledge-graph example:

CALL nexyron.graph_quality({graph: 'knowledge'})
YIELD graph, summary, communities
RETURN graph, summary, communities

Community detection procedures partition or group nodes by structural affinity. They are useful for segmentation, fraud-ring analysis, recommendation features, and exploratory graph profiling.

Consumer-Level Explanation

Use this when you want one structured diagnostic snapshot instead of running many separate algorithms and manually joining their outputs. The procedure reports how large the usable graph is, how much cleanup was needed, which topic-like groups are present, which items are central, and which items look weakly connected.

The result is data, not prose. It is meant to feed dashboards, assistants, reports, and follow-up analysis. A separate LLM step can turn these fields into a human narrative, but this procedure itself does not call a model.

Conceptual Explanation

The procedure projects the chosen graph once, cleans that projected graph, then computes related metrics over the same in-memory analytical shape. This avoids the repeated scan/project/execute pattern that would happen if a client issued PageRank, community detection, degree checks, and cleanup queries separately.

For graph: 'observed', Nexyron analyzes normal user LPG data and excludes internal labels that begin with __. For graph: 'knowledge', Nexyron analyzes active abstraction materialization nodes and active abstraction materialized relationships. The procedure is read-only: it does not refresh or mutate the abstraction graph before reading it.

More Detailed Explanation

The observed graph mode removes isolated nodes and connected components smaller than five nodes before calculating the final assessment. It returns cleanup counts so callers can distinguish a genuinely small graph from a graph that became small because most of the data was fragmented.

The knowledge graph mode keeps isolated nodes and small components in the analysis because those nodes are part of the semantic signal. A disconnected concept, lens, actor, stage, society, or environment is often exactly the quality issue the caller needs to see. The procedure reports summary.isolated_node_count and small-component counts, but it does not remove them from the knowledge-graph centrality, community, or degree summaries.

If the selected graph has no analyzable structure, the procedure still returns one row. In that case summary.status is insufficient_graph, the final node and edge counts in cleanup are zero, and the community/centrality lists are empty. This is common for a knowledge graph before abstraction has materialized enough active relationships.

For materialized knowledge graphs, cleanup.semantic_node_status_counts and cleanup.semantic_edge_status_counts report projection state such as active, stale, or unknown. Analysis uses the active/current materialized surface; stale materialized artifacts are reported as projection state, not mixed into the active graph metrics.

The summary includes density, connected-component counts, largest component size, average and maximum degree, average edge weight, relationship type counts, isolate count, and degree buckets. The community section uses a fast weighted label-propagation pass to group nearby items and reports each group’s size, sampled names, top keywords, internal connection rate, external connection rate, and strongest links to other groups. The community object also includes global top_keywords across the analyzed graph. The centrality section includes PageRank, degree centrality, and betweenness centrality. Betweenness is intentionally skipped on large graphs because exact all-source betweenness can dominate runtime.

Advanced Example

CALL nexyron.graph_quality({graph: 'observed'})
YIELD summary, communities, centrality, weak_nodes, runtime
RETURN
  summary.graph_density AS density,
  summary.average_node_degree AS average_degree,
  summary.isolated_node_count AS isolates,
  communities.number_of_communities_after_cleanup AS groups,
  communities.top_keywords AS top_keywords,
  centrality.top_10_nodes_by_pagerank AS important_items,
  weak_nodes.weak_node_count AS weak_items,
  runtime.large_graph_downgrades AS downgraded

Real Use Cases

Real Limitations And Tradeoffs