<br> <img src="images/poster-logo-small.png" alt="G* ICDE Poster Logo" width="600"> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <div id="nav" class="brand" style="float:left; vertical-align:middle; line-height:36px;"> The G* Research Group </div> <div id="nav" class="brand" style="float:right;"> <a href="http://www.cs.albany.edu/~gstar/" class="btn btn-small" style="width:110px;">Home</a> <a href="http://www.cs.albany.edu/~gstar/publications" class="btn btn-small" style="width:110px;">Publications</a> <a href="http://www.cs.albany.edu/~gstar/quick-start-guide" class="btn btn-small" style="width:110px;">Quick Start Guide</a> <a href="http://www.cs.albany.edu/~gstar/operator-reference" class="btn btn-small" style="width:110px;">Operator Reference</a> <a href="http://www.cs.albany.edu/~gstar/request-form" class="btn btn-small" style="width:110px;">Request Form</a> </div> </div> </div> </div> # Operator Reference All of the operators here can be classified into two categories: 1. Graph operators - directly process graphs specified by `<graph_id_exp>` (see below). 2. Non-graph operators - aggregates, joins, projections, and the like. ## Graph Operators One of the most important and common constructs in graph operators is the graph ID expression, or `<graph_id_exp>`. This is used to specify the graphs to process. `<graph_id_exp>` is defined by the following BNF: ``` <graph_id_exp> ::= <graph_id_term> , <graph_id_exp> ::= <graph_id_term> <graph_id_term> ::= <graph_id> ::= <start_id> : <step_size> : <stop_id> <graph_id> ::= double <start_id> ::= double <stop_id> ::= double <step_size> ::= double ``` Here are some examples of various valid `<graph_id_exp>` instances: * `0` - graph ID 0 * `0,1` - graph IDs 0 and 1. * `0:3:18` - a range of graph IDs starting at 0 and stepping ahead in increments of 3, stopping at graph ID 18. * `0:1:4, 10:2:14` - a range of graph IDs starting at 0 and stepping ahead in increments of 1, and stopping at graph ID 4, then starting again at graph ID 10 and stepping forward by 2 each time, finally stopping at graph ID 14. Other common constructs include the following: ``` <source_vertex_id> ::= string <vertex_output_attribute> ::= string ``` <!-- In all of the non-graph operators, the first parameter `[]` is used for specifying input sources, which are output from other operators. Since `VertexOperator` is a "base" operator, it has no input sources, so the first parameter will always be `[]`. Why even have it, you ask? What's the point of having parameters that are never used?. For syntactical consistency with the other operators. --> For examples of various operators in use in queries, please see the [The G&#42; Quick Start Guide](http://www.cs.albany.edu/~gstar/quick-start-guide#query_examples "Query Examples in the G* Quick Start Guide") <br> #### Vertex Operator _Usage:_ `VertexOperator([], [<graph_id_exp>])` Retrieves all of the vertices from the graphs specified by `<graph_id_exp>`. <br> #### Clustering Coefficient Operator _Usage:_ `ClusteringCoefficientOperator([], [<graph_id_exp>], <vertex_output_attribute>)` Computes the clustering coefficient of each vertex contained in the graphs specified by `<graph_id_exp>` and stores the result in an attribute of each vertex called `<vertex_output_attribute>`, which is created if necessary. <br> #### Single Source Shortest Distance Operator _Usage:_ `SingleSourceShortestDistanceOperator([], [<graph_id_exp>], <source_vertex_id>, <vertex_output_attribute>)` Computes the geodesic distance from the vertex specified by `<source_vertex_id>` to each vertex for vertices contained in graphs specified by `<graph_id_exp>`. The results are stored in a new attribute of each vertex called `<vertex_output_attribute>`, which is created if necessary. <br> #### PageRank Operator _Usage:_ `PageRank([], [<graph_id_exp>], <vertex_output_attribute>)` Computes the PageRank of each vertex contained in the graphs specified by `<graph_id_exp>` and stores the result in an attribute of each vertex called `<vertex_output_attribute>`, which is created if necessary. <br> #### Weak Component ID Operator _Usage:_ `WeakComponentIDOperator([], [graph_id_exp], <vertex_output_attribute>)` Finds, for each weakly-connected component, a component ID, and stores that component ID in a new attribute called `<vertex_output_attribute>` for every vertex contained in the component. <br> ## Non-graph Operators Non-graph operators consume and process data objects (which include attributes) from other operators, including graph operators. For this reason, every non-graph operator requires input from other operators. In this regard, these operators are not used only by themselves. #### Union Operator _Usage:_ `Union([<input_op_names>])` Retrieves data from all of the operators specified by `<input_op_names>`. Examples: * `Union([vertex@0])` retrieves data from the previously-defined `VertexOperator` on worker 0. * `Union([vertex@local])` retrieves data from the previously-defined `VertexOperator` on the same worker. * `Union([vertex@0, vertex@1])` retrieves data from the previously-defined `VertexOperator` instances on workers 0 and 1. * `Union([vertex@*])` retrieves data from the previously-defined `VertexOperator` instances on all workers. <br> #### Projection Operator _Usage:_ `ProjectionOperator([<input_op_names>], [<arithmetic_exp_1>, <arithmetic_exp_2>, ...], [<output_attribute_1>, <output_attribute_2>, . . .])` Evaluates the expressions specified by `<arithmetic_exp_i>` and stores them in the attributes specified by `<output_attribute_i>`. `<arithmetic_exp>` is defined as follows: ``` <arithmetic_exp> ::= <term> + <term> ::= <term> - <term> ::= <term> <term> ::= <factor> * <factor> ::= <factor> / <factor> ::= <factor> <factor> ::= attribute ::= int ::= double ::= ( <arithmetic_exp> ) ::= cardinality ( attribute ) ``` The following example obtains the vertex ID, graph ID, and number of outgoing edges from each vertex object from the `vertex` operator at worker 0 and saves these results in the attributes specified by `id`, `graph.id`, and `out_degree`: * `ProjectionOperator([vertex@0], [id, graph.id, cardinality(outgoing_edges)], [id, graph.id, out_degree])` <br> #### Aggregate Operator _Usage:_ `AggregateOperator([<input_op_names>], [<func_1>, <func_2>, ...], [<input_attribute_1>, <input_attribute_2>, ...], [<output_attribute_1>, <output_attribute_2>, ...], [<group_attribute_1>, <group_attribute_2>, ...])` Applies the aggregate functions `<func_i>` to the input attributes `<input_attribute_i>` storing the results in `<output_attribute_i>`, with grouping by `<group_attribute_i>`. Currently supported aggregate functions are `count`, `sum`, `min`, `max`, and `average`. Example: `AggregateOperator([vertex_degree@local], [count, sum], [*, degree], [count, degree], [graph.id])` Given data objects representing vertices and their degrees, group these data objects based on their graph ID while, for each group, counting the number of vertices and summing their degrees. <br> #### Join Operator _Usage:_ `JoinOperator([<input_op_name_left>, <input_op_name_right>], [<attr_left_1>, <attr_left_2>, ...], [<attr_right_1>, <attr_right_2>, ...])` Produces, for each pair of data objects from `<input_op_name_left>` and `<input_op_name_right>` such that `<attr_left_i>` == `<attr_right_i>`, the composition of all of the attributes contained in those objects. In the composite output objects, attributes are fully qualified with "left." and "right." prefixes. (E.g., `left.id` and `right.id` refer to the ID values from `<input_op_name_left>` and `<input_op_name_right>`, respectively.) Example: `JoinOperator([input1@local, input2@local], [id, graph.id], [id, graph_id])` Joins data objects from `input1@local` and `input2@local` that have the same vertex and graph IDs. <br> #### Sort Operator _Usage:_ `SortOperator([<input_op_names>], [<sort_attribute_1>, <sort_attribute_2>, ...])` Sorts data objects in the lexicographical order specified by `<sort_attribute_i>`. Example: `SortOperator([vertex@local], [graph.id:asc, id:desc])` Sorts the vertices in memory in ascending order of graph ID and descending order of vertex ID. <br> #### Top-K Operator _Usage:_ `TopKOperator([<input_op_names>], <count>, [<sort_attribute_1>, <sort_attribute_2>, ...], [<group_attribute_1>, <group_attribute_2>, ...])` Groups data objects according to `<group__attribute_i>` and then, for each group, retrieves the top-`<count>` data objects with the highest `<sort_attribute_i>` values. Example: `TopKOperator([vertex_degree@local], 10, [degree:desc], [graph.id])` For each graph, retrieve the 10 vertices with the highest degree values. <br> For examples of various operators in use in queries, please see the [The G&#42; Quick Start Guide](http://www.cs.albany.edu/~gstar/quick-start-guide#query_examples "Query Examples in the G* Quick Start Guide")

Copyright © 2013-2014 The Research Foundation for The State University of New York.
All rights reserved.   Unauthorized reproduction is prohibited.