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

Managing Distributed Projections

Overview

A distributed projection resides in the memory of the corresponding shard servers where the data is persistently stored. It can hold either full or partial data from a graph. The term "distributed projection" indicates that data within it can be distributed across the memory of multiple shards.

NOTE

All distributed projections of a graph are lost when the data in the graph is migrated to different shards.

Showing Distributed Projections

Retrieves information about all distributed projections of the current graph:

SHOW PROJECTION

It returns a table _projectionList with the following fields:

Field
Description
nameName of the projection.
graph_nameName of the current graphset from which the data was loaded.
statusCurrent state of the projection, which can be DONE or CREATING, FAILED or UNKNOWN.
statsNode and edge statistics per shard, including address of the leader replica of the current graphset, edge_in_count, edge_out_count and node_count.
configConfigurations for the distributed projection.

Creating a Distributed Projection

The projection creation is executed as a job, you may run SHOW JOB <id?> (GQL) or show().job(<id?>) (UQL) afterward to verify the success of the creation.

Syntax

CREATE PROJECTION <projectionName> OPTIONS {
  nodes: {
    "<schema1>": ["<property1>", "<property2>", ...],
    "<schema2>": ["<property1>", "<property2>", ...],
    ...
  },
  edges: {
    "<schema1>": ["<property1>", "<property2>", ...],
    "<schema2>": ["<property1>", "<property2>", ...],
    ...
  },
  direction: "<edgeDirection>",
  load_id: <boolean>
}
ParamDescriptionOptional
<projectionName>Name of the projection. Projections of the same graph cannot have duplicate names. Projections and HDC graphs of the same graph cannot have duplicate names.No
nodesSpecifies nodes to project based on schemas and properties. The _uuid is loaded by default, while _id is configurable with load_id. Sets to "*": ["*"] to load all nodes. Yes
edgesSpecifies edges to project based on schemas and properties. All system properties are loaded by default. Sets to "*": ["*"] to load all edges.Yes
directionSince each edge is physically stored twice - as an incoming edge along its destination node and an outgoing edge with its source node - you can choose to project only incoming edges with in, only outgoing edges with out, or both with undirected (the default setting). Please note that in or out restricts graph traversal during computation to the specified direction.No
load_idSets to false to project nodes without _id values to save the memory space; it defaults to true.Yes

Examples

To project the entire current graphset to its shard servers as distGraph:

CREATE PROJECTION distGraph OPTIONS {
  nodes: {"*": ["*"]}, 
  edges: {"*": ["*"]},
  direction: "undirected",
  load_id: true
}

To project account and movie nodes with selected properties and incoming rate edges in the current graph to its shard servers as distGraph_1, while omitting nodes' _id values:

CREATE PROJECTION distGraph_1 OPTIONS {
  nodes: {
    "account": ["name", "gender"],
    "movie": ["name", "year"]
  },
  edges: {"rate": ["*"]},
  direction: "in",
  load_id: false
}

Dropping a Distributed Projection

Deletes the distributed projection named distGraph_1:

DROP PROJECTION distGraph_1