9.17 OPG_APIS.CREATE_SUB_GRAPH

Format

OPG_APIS.CREATE_SUB_GRAPH(
     graph_owner IN VARCHAR2,
     orgGraph    IN VARCHAR2,
     newGraph    IN VARCHAR2,
     nSrc        IN NUMBER,
     depth       IN NUMBER);

Description

Creates a subgraph, which is an expansion from a given vertex. The depth of expansion is customizable.

Parameters

graph_owner

Owner of the property graph.

orgGraph

Name of the original property graph.

newGraph

Name of the subgraph to be created from the original graph.

nSrc

Vertex ID: the subgraph will be created by expansion from this vertex. For example, nSrc = 1 starts the expansion from the vertex with ID 1.

depth

Depth of expansion: the expansion, following outgoing edges, will include all vertices that are within depth hops away from vertex nSrc. For example, depth = 2 causes the to should include all vertices that are within 2 hops away from vertex nSrc (vertex ID 1 in the preceding example).

Usage Notes

The original property graph must exist in the database.

Examples

The following example creates a subgraph mypgsub from the property graph mypg whose owner is SCOTT. The subgraph includes vertex 1 and all vertices that are reachable from the vertex with ID 1 in 2 hops.

EXECUTE OPG_APIS.CREATE_SUB_GRAPH('SCOTT', 'mypg', 'mypgsub', 1, 2);