← Back to the previous page

Analytics Workload

Queries that run global graph analytics algorithms.

Queries

Select a query type below to view its template and description.

T5.1 Degree Centrality

Generic Intent: Compute the most connected nodes.

This query counts how many neighbors each node has through a selected edge type, then returns the top nodes by degree. It is useful for testing adjacency scans, aggregation, ordering, and top-K result materialization on a full graph or filtered subgraph.

Undirected Edge GQL Template:

gql
MATCH (n:<NodeLabel>)-[:<EdgeType>]-(m:<NodeLabel>)
RETURN n, COUNT(m) AS degree
ORDER BY degree DESC
LIMIT $limit;

Outgoing Edge GQL Template:

gql
MATCH (n:<NodeLabel>)-[:<EdgeType>]->(m:<NodeLabel>)
RETURN n, COUNT(m) AS outDegree
ORDER BY outDegree DESC
LIMIT $limit;

Incoming Edge GQL Template:

gql
MATCH (n:<NodeLabel>)<-[:<EdgeType>]-(m:<NodeLabel>)
RETURN n, COUNT(m) AS inDegree
ORDER BY inDegree DESC
LIMIT $limit;

Parameters:

  • Direction: outgoing / incoming / undirected
  • Scope: full graph vs filtered subgraph
  • top-K size: value of $limit
  • Aggregation: implementation and ordering strategy

T5.2 PageRank

Generic Intent: Rank nodes by graph importance using iterative link analysis.

PageRank repeatedly propagates score through the graph until the scores converge or the iteration limit is reached. This workload stresses iterative execution, memory layout, convergence checks, and top-K result extraction.

Abstract Algorithm Template:

text
PageRank(
  nodeLabel = <NodeLabel>,
  edgeType = <EdgeType>,
  dampingFactor = $dampingFactor,
  maxIterations = $maxIterations,
  tolerance = $tolerance
)
RETURN node, score
ORDER BY score DESC
LIMIT $limit;

Note: PageRank is not supported in current GQL standard; the Cypher procedure-style example is kept for now.

Procedure-Style Cypher Example:

cypher
// Not supported in standard GQL; Cypher procedure-style placeholder.
CALL graph.pageRank.stream({
  nodeLabel: '<NodeLabel>',
  relationshipType: '<EdgeType>',
  dampingFactor: $dampingFactor,
  maxIterations: $maxIterations,
  tolerance: $tolerance
})
YIELD node, score
RETURN node, score
ORDER BY score DESC
LIMIT $limit;

Parameters:

  • Iterations: maximum number of algorithm iterations
  • Convergence: tolerance and damping factor
  • Direction: directedness of the graph projection
  • Weighting: weighted vs unweighted PageRank
  • Graph size: number of nodes and edges in the projection

T5.3 Connected Components / Weakly Connected Components

Generic Intent: Find groups of nodes connected by the edge relation.

This workload identifies connected regions of the graph and reports their sizes. For directed graphs, the weakly connected version treats edges as undirected, making it useful for finding disconnected clusters or isolated graph regions.

Abstract Algorithm Template:

text
ConnectedComponents(
  nodeLabel = <NodeLabel>,
  edgeType = <EdgeType>
)
RETURN componentId, COUNT(*) AS componentSize
ORDER BY componentSize DESC;

Note: Connected-components algorithms are not supported in current GQL standard; the Cypher procedure-style example is kept for now.

Procedure-Style Cypher Example:

cypher
// Not supported in standard GQL; Cypher procedure-style placeholder.
CALL graph.wcc.stream({
  nodeLabel: '<NodeLabel>',
  relationshipType: '<EdgeType>'
})
YIELD node, componentId
RETURN componentId, COUNT(node) AS componentSize
ORDER BY componentSize DESC;

Parameters:

  • Components: number of connected components
  • Skew: giant component size vs smaller component sizes
  • Direction: directed vs undirected interpretation
  • Output mode: materialize component labels or stream results only

T5.4 Strongly Connected Components

Generic Intent: Find maximal groups where every node can reach every other node through directed edges.

This workload is designed for directed graphs. It finds mutually reachable node sets and is useful for measuring cycle-heavy structures, directed traversal state, and component-size aggregation.

Abstract Algorithm Template:

text
StronglyConnectedComponents(
  nodeLabel = <NodeLabel>,
  edgeType = <EdgeType>
)
RETURN componentId, COUNT(*) AS componentSize
ORDER BY componentSize DESC;

Note: Strongly connected components are not supported in current GQL standard; the Cypher procedure-style example is kept for now.

Procedure-Style Cypher Example:

cypher
// Not supported in standard GQL; Cypher procedure-style placeholder.
CALL graph.scc.stream({
  nodeLabel: '<NodeLabel>',
  relationshipType: '<EdgeType>'
})
YIELD node, componentId
RETURN componentId, COUNT(node) AS componentSize
ORDER BY componentSize DESC;

Parameters:

  • Density: directed graph density
  • Cycles: cycle frequency in the graph
  • Components: number of SCCs
  • Largest SCC: size of the largest strongly connected component

T5.5 Community Detection

Generic Intent: Partition the graph into densely connected communities.

This workload runs a community-detection algorithm such as Louvain, Label Propagation, or Leiden. It reports the largest communities and stresses iterative clustering, graph projection, memory usage, and result materialization.

Abstract Algorithm Template:

text
CommunityDetection(
  nodeLabel = <NodeLabel>,
  edgeType = <EdgeType>,
  algorithm = Louvain / LabelPropagation / Leiden
)
RETURN communityId, COUNT(*) AS communitySize
ORDER BY communitySize DESC;

Note: Community-detection algorithms are not supported in current GQL standard; the Cypher procedure-style example is kept for now.

Procedure-Style Cypher Example:

cypher
// Not supported in standard GQL; Cypher procedure-style placeholder.
CALL graph.louvain.stream({
  nodeLabel: '<NodeLabel>',
  relationshipType: '<EdgeType>'
})
YIELD node, communityId
RETURN communityId, COUNT(node) AS communitySize
ORDER BY communitySize DESC;

Parameters:

  • Algorithm: Louvain, Label Propagation, or Leiden
  • Output mode: write-back vs stream-only result