UltipaDocs
Try Playground
  • Introduction
  • Managing HDC Graphs
  • Managing Distributed Projections
  • Installing Algorithms
  • Running Algorithms
    • Degree Centrality
    • Closeness Centrality
    • Harmonic Centrality
    • Graph Centrality
    • Betweenness Centrality
    • Eigenvector Centrality
    • Katz Centrality
    • CELF
    • PageRank
    • ArticleRank
    • TextRank
    • HITS
    • SybilRank
    • Jaccard Similarity
    • Overlap Similarity
    • Cosine Similarity
    • Pearson Correlation Coefficient
    • Euclidean Distance
    • K-Hop All
    • Bipartite Graph
    • HyperANF
    • Connected Component
    • Triangle Counting
    • Induced Subgraph
    • k-Core
    • k-Truss
    • p-Cohesion
    • k-Edge Connected Components
    • Local Clustering Coefficient
    • Topological Sort
    • Schema Overview
    • Dijkstra's Single-Source Shortest Path
    • Delta-Stepping Single-Source Shortest Path
    • Shortest Path Faster Algorithm (SPFA)
    • Minimum Spanning Tree
    • Breadth-First Search (BFS)
    • Depth-First Search (DFS)
    • Adamic-Adar Index
    • Common Neighbors
    • Preferential Attachment
    • Resource Allocation
    • Total Neighbors
    • Louvain
    • Leiden
    • Label Propagation
    • HANP
    • k-Means
    • kNN (k-Nearest Neighbors)
    • K-1 Coloring
    • Conductance
      • Random Walk
      • Node2Vec Walk
      • Node2Vec
      • Struc2Vec Walk
      • Struc2Vec
      • LINE
      • Fast Random Projection
      • Summary of Graph Embedding
      • Gradient Descent
      • Backpropagation
      • Skip-gram
      • Skip-gram Optimization
  1. Docs
  2. /
  3. Graph Analytics & Algorithms
  4. /
  5. Connectivity & Compactness

Schema Overview

HDC

Overview

The Schema Overview algorithm summarizes the structure of a graph by presenting statistics for source node schemas (labels), edge schemas, end node schemas, and the corresponding edge counts.

Example Graph

Run the following statements on an empty graph to define its structure and insert data:

ALTER GRAPH CURRENT_GRAPH ADD NODE {
  account (), 
  movie (),
  country (),
  director ()
};
ALTER GRAPH CURRENT_GRAPH ADD EDGE {
  follow ()-[]->(),
  like ()-[]->(),
  filmedIn ()-[]->(),
  direct ()-[]->()
};
INSERT (David:account {_id: "David"}),
       (Emily:account {_id: "Emily"}),
       (Alice:account {_id: "Alice"}),
       (Titanic:movie {_id: "Titanic"}),
       (Avatar:movie {_id: "Avatar"}),
       (Mexico:country {_id: "Mexico"}),
       (JC:director {_id: "James Cameron"}),
       (David)-[:follow]->(Alice),
       (Emily)-[:follow]->(Alice),
       (Alice)-[:like]->(Titanic),
       (Titanic)-[:filmedIn]->(Mexico),
       (JC)-[:direct]->(Titanic),
       (JC)-[:direct]->(Avatar);

Creating HDC Graph

To load the entire graph to the HDC server hdc-server-1 as my_hdc_graph:

CREATE HDC GRAPH my_hdc_graph ON "hdc-server-1" OPTIONS {
  nodes: {"*": ["*"]},
  edges: {"*": ["*"]},
  direction: "undirected",
  load_id: true,
  update: "static"
}

Parameters

Algorithm name: schema_overview

Name
Type
Spec
Default
Optional
Description
orderStringasc, desc/YesSorts the results by count.

Full Return

CALL algo.schema_overview.run("my_hdc_graph", {}) YIELD r
RETURN r

Result:

node schema(src)
edge schema
node schema(dest)
count
accountfollowaccount2
accountlikemovie1
moviefilmedIncountry1
directordirectmovie2

Stream Return

CALL algo.schema_overview.stream("my_hdc_graph", {}) YIELD r
FILTER r.`node schema(src)` = "account" 
RETURN r

Result:

node schema(src)
edge schema
node schema(dest)
count
accountfollowaccount2
accountlikemovie1