API Schema: Supported Graph Operations

Introduction

The API schema offers an insight into the computational and layout capabilities available within our system. By fetching this schema, users can ascertain which graph algorithms and layouts are supported, aiding in the creation of tailored and complex visualizations.

Fetching the API Schema

Endpoint: /api/v1/datasets/

Method: GET

Description: Retrieve the API schema detailing compute and layout functions available in cugraph and igraph graph libraries.

Example Request

GET /web/api/v1/datasets/

Example Response

{
    "compute": {
        "cugraph": [
            "betweenness_centrality",
                "katz_centrality",
                "ecg",
                "leiden",
                "louvain",
                "spectralBalancedCutClustering",
                "spectralModularityMaximizationClustering",
                "connected_components",
                "strongly_connected_components",
                "weakly_connected_components",
                "core_number",
                "hits",
                "pagerank",
                "bfs",
                "bfs_edges",
                "sssp",
                "shortest_path",
                "shortest_path_length",
                "batched_ego_graphs",
                "edge_betweenness_centrality",
                "jaccard",
                "jaccard_w",
                "overlap",
                "overlap_coefficient",
                "overlap_w",
                "sorensen",
                "sorensen_coefficient",
                "sorensen_w",
                "ego_graph",
                "k_core",
                "minimum_spanning_tree"
            ],
            "igraph": ["authority_score",
                "betweenness",
                "bibcoupling",
                "harmonic_centrality",
                "closeness",
                "clusters",
                "cocitation",
                "community_edge_betweenness",
                "community_fastgreedy",
                "community_infomap",
                "community_label_propagation",
                "community_leading_eigenvector",
                "community_leiden",
                "community_multilevel",
                "community_spinglass",
                "community_walktrap",
                "constraint",
                "gomory_hu_tree",
                "hub_score",
                "eccentricity",
                "eigenvector_centrality",
                "k_core",
                "pagerank",
                "spanning_tree"
            ]
        },
    "layout": {
        "cugraph": [
            "force_atlas2"
        ],
        "igraph": [
            "auto",
            "automatic",
            "bipartite",
            "circle",
            "circular",
            "dh",
            "davidson_harel",
            "drl",
            "drl_3d",
            "fr",
            "fruchterman_reingold",
            "fr_3d",
            "fr3d",
            "fruchterman_reingold_3d",
            "grid",
            "grid_3d",
            "graphopt",
            "kk",
            "kamada_kawai",
            "kk_3d",
            "kk3d",
            "kamada_kawai_3d",
            "lgl",
            "large",
            "large_graph",
            "mds",
            "random",
            "random_3d",
            "rt",
            "tree",
            "reingold_tilford",
            "rt_circular",
            "reingold_tilford_circular",
            "sphere",
            "spherical",
            "circle_3d",
            "circular_3d",
            "star",
            "sugiyama"
        ]
    },
},
    "types": {
        "CuGraphKind": [
            "Graph",
            "MultiGraph",
            "BiPartiteGraph"
        ]
    }

Understanding the Schema

The schema is structured into three main components:

  1. Compute: Lists the graph algorithms supported by the cugraph and igraph graph libraries.
  2. Layout: Describes the various graph layout methods available for visual presentation.
  3. Types: Outlines the types or kinds of graphs that can be handled, such as Graph, MultiGraph, or BiPartiteGraph.

Remote Examples

Using igraph with PageRank Algorithm:

curl -X POST "http://nexus:8000/api/v1/datasets/" \
     -H "Authorization: " \
     -H "Content-Type: application/json" \
     -d '{
         "agent_name": "test_agent",
         "description": "Test dataset using igraph with pagerank",
         "edge_encodings": "sample_edge_encodings",
         "metadata": "sample_metadata",
         "node_encodings": "sample_node_encodings",
         "compute": {
             "pagerank": {
                 "libraries": ["igraph"],
                 "alg": "pagerank"
             }
         },
         "name": "Test Dataset 1",
         "org_name": "sample_org"
     }'

Using cugraph with Community Detection Algorithm:

curl -X POST "http://nexus:8000/api/v1/datasets/" \
     -H "Authorization: " \
     -H "Content-Type: application/json" \
     -d '{
         "agent_name": "test_agent",
         "description": "Test dataset using cugraph with community detection",
         "edge_encodings": "sample_edge_encodings",
         "metadata": "sample_metadata",
         "node_encodings": "sample_node_encodings",
         "compute": {
             "community": {
                 "libraries": ["cugraph"],
                 "alg": "louvain"
             }
         },
         "name": "Test Dataset 2",
         "org_name": "sample_org"
     }'