MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/md/admin/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/md/admin/opggraphoph.sql

Rem
Rem $Header: sdo/admin/pg/opggraphoph.sql /main/5 2017/09/29 09:00:19 alwu Exp $
Rem
Rem opggraphoph.sql
Rem
Rem Copyright (c) 2013, 2017, Oracle and/or its affiliates. 
Rem All rights reserved.
Rem
Rem    NAME
Rem      opggraphoph.sql - <one-line expansion of the name>
Rem
Rem    DESCRIPTION
Rem      <short description of component this file declares/defines>
Rem
Rem    NOTES
Rem      <other useful comments, qualifications, etc.>
Rem
Rem    MODIFIED   (MM/DD/YY)
Rem    alwu        09/28/17 - shorten several API names
Rem    alwu        04/07/16 - update create_sub_graph API
Rem    alwu        12/03/15 - add SQL FILE metadata
Rem    alwu        07/23/15 - fix bug 21226251
Rem    alwu        04/22/14 - enhance clone_graph
Rem    alwu        04/03/14 - cleanup find_cc
Rem    alwu        04/02/14 - refactor APIs
Rem    alwu        03/27/14 - cleanup count triangle APIs
Rem    alwu        02/04/14 - add populate_skeleton_tab API
Rem    alwu        01/21/14 - add mdsys to package names
Rem    alwu        01/14/14 - move in graph sparsification
Rem    alwu        01/14/14 - add clone graph
Rem    alwu        01/13/14 - adjust to the new API
Rem    alwu        12/18/13 - start
Rem    alwu        12/18/13 - Created
Rem
Rem    BEGIN SQL_FILE_METADATA 
Rem    SQL_SOURCE_FILE: sdo/admin/pg/opggraphoph.sql 
Rem    SQL_SHIPPED_FILE: md/admin/opggraphoph.sql
Rem    SQL_PHASE: OPGGRAPHOPH
Rem    SQL_STARTUP_MODE: NORMAL 
Rem    SQL_IGNORABLE_ERRORS: NONE 
Rem    SQL_CALLING_FILE: sdo/admin/pg/opgrelod.sql
Rem    END SQL_FILE_METADATA

SET ECHO ON
SET FEEDBACK 1
SET NUMWIDTH 10
SET LINESIZE 80
SET TRIMSPOOL ON
SET TAB OFF
SET PAGESIZE 100

/**
 * Graph Operations
 */
create or replace package mdsys.opg_graphop  authid current_user 
is
  procedure create_sub_graph(
                    graph_owner      varchar2,
                    orgGraph         varchar2,
                    newGraph         varchar2,
                    nSrc             number, 
                    depth            integer,
                    dop              integer   default 4,
                    nPQThreshold     integer   default 10000,
                    tbs              varchar2  default null,
                    options       in varchar2  default null
                    );

  /**
   * This API makes a clone of the original graph
   */
  procedure clone_graph(
                    orgGraph         varchar2,
                    newGraph         varchar2,
                    dop              integer   default 4,
                    num_hash_ptns    integer   default 8,
                    tbs              varchar2  default null,
                    options       in varchar2  default null
                    );

  /**
   * This API sparsifies a graph. The remaining edges will be stored in
   * the wt_out_tab.
   */
  procedure sparsify_graph(
                    edge_tab_name        varchar2,
                    threshold            number    default 0.5,
                    min_keep             integer   default 1,
                    dop                  integer   default 4,
                    wt_out_tab    in out varchar2,
                    wt_und_tab    in out varchar2,
                    wt_hsh_tab    in out varchar2,
                    wt_mch_tab    in out varchar2,
                    tbs                  varchar2  default null,
                    options       in     varchar2  default null
                    );
                    


  /**
   * This procedure populates the skeletop table (GT$).
   * By default, the content in the existing GT$ table will be removed.
   */
  procedure populate_skeleton_tab(
                    graph            varchar2,
                    dop              integer   default 4,
                    tbs              varchar2  default null,
                    options       in varchar2  default null
                    )
  ;


  /**
   * This API finds connected components in the original graph.
   * All connected components will be stored in the given wt_clusters.
   * The wt_clusters is supposed to have these two columns: (vid, cluster_id) 
   * Note that the original graph will be treated as undirected.
   */
  procedure find_cc_mapping_based(
                    edge_tab_name         varchar2,
                    wt_clusters   in out  varchar2,
                    wt_undir      in out  varchar2,
                    wt_cluas      in out  varchar2,
                    wt_newas      in out  varchar2,
                    wt_delta      in out  varchar2,
                    dop                   integer   default 4,
                    rounds                integer   default 0,  -- continue till all CC founds
                    tbs                   varchar2  default null,
                    options       in      varchar2  default null
                    );

  /**
   * This API finds connected components in the original graph.
   * All connected components will be stored in the given wt_clusters.
   * The wt_clusters is supposed to have these two columns: (vid, cluster_id) 
   * Note that the original graph will be treated as undirected.
   *
   * TODO: apply the techniques used in incremental inference to
   * speed up joins.
   */
  procedure find_cc(
                    edge_tab_name         varchar2,
                    wt_clusters   in out  varchar2,
                    wt_undir      in out  varchar2,
                    wt_cluas      in out  varchar2,
                    wt_newas      in out  varchar2,
                    wt_delta      in out  varchar2,
                    dop                   integer   default 4,
                    rounds                integer   default 0,  -- continue till all CC founds
                    tbs                   varchar2  default null,
                    options       in      varchar2  default null
                    );
end;
/


OHA YOOOO