validateGraph: Validate graph data in Aster for consistency.

Description Usage Arguments Examples

Description

Aster uses the following pair of tables to store graph data: - vertices table with unique key and optional attributes - Edges table with source, target and optional attributes Also see toaGraph Graph validation checks for the following:

Usage

1
2
3
validateGraph(channel, graph, weight = NULL,
  vertexWhere = graph$vertexWhere, edgeWhere = graph$edgeWhere,
  allTables = NULL, test = FALSE)

Arguments

channel

connection object as returned by odbcConnect

graph

an object of class 'toagraph' referencing graph tables in Aster database.

weight

logical or character: if logical then TRUE indicates using 'weight' edge attribute, otherwise no weight used. If character then use as a name for the edge weight attribute. The edge weight may apply with types 'clustering', 'shortestpath' and centrality measures.

vertexWhere

SQL WHERE clause limiting data from the vertex table. This value when not null overrides corresponding value vertexWhere from graph (use SQL as if in WHERE clause but omit keyword WHERE).

edgeWhere

SQL WHERE clause limiting data from the edge table. This value when not null overrides corresponding value edgeWhere from graph (use SQL as if in WHERE clause but omit keyword WHERE).

allTables

pre-built information about existing tables.

test

logical: if TRUE show what would be done, only (similar to parameter test in RODBC functions: sqlQuery and sqlSave).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
if(interactive()) {

# initialize connection to Lahman baseball database in Aster 
conn = odbcDriverConnect(connection="driver={Aster ODBC Driver};
                         server=<dbhost>;port=2406;database=<dbname>;uid=<user>;pwd=<pw>")

# undirected graph
policeGraphUn = toaGraph(vertices="dallaspolice_officer_vertices", 
                         edges="dallaspolice_officer_edges_un", 
                         directed=FALSE, key="officer", 
                         source="officer1", target="officer2", 
                         vertexAttrnames = c("offense_count"),
                         edgeAttrnames = c("weight"))
validateGraph(conn, policeGraphUn)

# directed graph
policeGraphDi = toaGraph(edges="dallaspolice_officer_vertices", 
                         vertices="dallaspolice_officer_edges_di", 
                         directed=TRUE, key="officer", 
                         source="officer1", target="officer2", 
                         vertexAttrnames = c("offense_count"),
                         edgeAttrnames = c("weight"))
validateGraph(conn, policeGraphDi, weight=TRUE)

}

teradata-aster-field/toaster documentation built on May 31, 2019, 8:36 a.m.