Recent Changes for "State Alternative: Ranges" - Graph Exploration System (GUESS)http://guess.wikispot.org/State_Alternative:_RangesRecent Changes of the page "State Alternative: Ranges" on Graph Exploration System (GUESS).en-us State Alternative: Rangeshttp://guess.wikispot.org/State_Alternative:_Ranges2007-08-11 00:26:07EytanAdar <div id="content" class="wikipage content"> Differences for State Alternative: Ranges<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 45: </td> <td> Line 45: </td> </tr> <tr> <td> <span>- </span> Note that if you change the field GUESS will not change the index automatically (e.g. if you say v0.range = ’20-25’ the range will not get updated). In order to force an update, use one of the following commands: </td> <td> <span>+</span> Note that if you change the field GUESS will not change the index automatically (e.g. if you say v0.range = ’20-25’ the range will not get updated). In order to force an update, use one of the following commands: </td> </tr> </table> </div> State Alternative: Rangeshttp://guess.wikispot.org/State_Alternative:_Ranges2007-08-11 00:25:52EytanAdar <div id="content" class="wikipage content"> Differences for State Alternative: Ranges<p><strong></strong></p><table> <tr> <td> <span> Deletions are marked with - . </span> </td> <td> <span> Additions are marked with +. </span> </td> </tr> <tr> <td> Line 1: </td> <td> Line 1: </td> </tr> <tr> <td> </td> <td> <span>+ = State Alternative: Ranges =<br> + <br> + Frequently we have graphs where nodes and edges simply exist or not in different time periods. We are not interesting in varying any other dynamic property except for existence. For example, a node is active at time 0-5 and 8-12. We do not want to create a state for every time period. A new (.6+) feature of GUESS is a special range index. You may not specify a field for nodes and edges that functions to define these ranges.<br> + <br> + <br> + The valid syntax for this textual field is a comma delimited set of ranges or individual times. For example: “1-2,5,10-12” indicates that the range of this object is between time periods 1 and 2, at time period 5, and between period 10 and 12. Using an interval tree, GUESS will create an index that can be used to select nodes and edges that are contained in, overlap, contain, or match a range exactly. The operators for this are roverlaps, rcontains, rcontained, and rexact and may be applied to the “Node” and “Edge” objects in the form of:<br> + <br> + <br> + object operator range<br> + <br> + where object is Node or Edge, operator is one of roverlaps, rcontains, rcontained, and rexeact, and the range is either a single number (e.g. 1 which implies a range of 1 to 1), a pair of numbers (e.g. (1,2) which implies a range of 1 to 2), or a string range (e.g. “5-8” which implies a range of 5 to 8).<br> + <br> + An example may help. Let’s say we have a simple GDF file:<br> + <br> + {{{<br> + nodedef&gt; name, range VARCHAR(32)<br> + v0,"1-2,6-9"<br> + v1,"1-3,8-15"<br> + v2,"1-1"<br> + v3,"5-12"<br> + v4,"20-20"<br> + edgedef&gt; node1,node2,directed<br> + v0,v1,true<br> + v0,v2,true<br> + v0,v3,true<br> + v3,v4,true<br> + v2,v4,true<br> + v1,v4,true<br> + }}}<br> + <br> + <br> + We can do the following:<br> + <br> + * Node roverlaps (2,5) which returns v0 and v1<br> + * Node rcontains 5 which returns v3<br> + * Node rcontained (19,21) which returns v4<br> + * Node rexact (5,12) which returns v3<br> + <br> + <br> + By default, GUESS will try and find a “range” field as soon as you invoke one of the range operations. You may also specify an alternative field using the following command (with a field as an argument):<br> + <br> + * Node.setRangeField(…)<br> + * Edge.setRangeField(…)<br> + <br> + Note that if you change the field GUESS will not change the index automatically (e.g. if you say v0.range = ’20-25’ the range will not get updated). In order to force an update, use one of the following commands:<br> + <br> + * Node.rebuildRangeIndex()<br> + * Edge.rebuildRangeIndex()</span> </td> </tr> </table> </div>