A method of retrieving data from a graph data structure (112, 220), the method comprising, by a control unit: traversing a discrete finite automaton, DFA (126, 238, 304), in conjunction with the graph data structure (112, 220), beginning at an initial state of the DFA and an entry-point node of the graph data structure, to reach a result node of the graph data structure and a triggering state of the DFA, wherein the triggering state is a state associated with or reached concurrently with the result node; and in response to traversing the DFA, retrieving first data associated with at least one of the result node or an edge of the graph data structure connected with the result node; wherein the DFA is associated with a query; wherein the query specifies a condition and an assignment statement that is associated with the condition; and wherein the traversing comprises: reaching a first state of the DFA and an associated first node of the graph data structure; subsequently, executing the assignment statement to store first information associated with the first node into a computer-readable memory communicatively connected with the control unit, wherein the stored first information corresponds to information of the first node associated with the condition; subsequently, testing the condition with respect to the first information, wherein the testing comprises using the stored first information associated with the first node, wherein a node which matches the condition with respect to the first information is a result node; after the testing, unwinding the traversal to the first state and a second node of the graph data structure different from the first node; and after the testing, discarding the first information from the computer-readable memory. traversing a discrete finite automaton, DFA (126, 238, 304), in conjunction with the graph data structure (112, 220), beginning at an initial state of the DFA and an entry-point node of the graph data structure, to reach a result node of the graph data structure and a triggering state of the DFA, wherein the triggering state is a state associated with or reached concurrently with the result node; and in response to traversing the DFA, retrieving first data associated with at least one of the result node or an edge of the graph data structure connected with the result node; wherein the DFA is associated with a query; wherein the query specifies a condition and an assignment statement that is associated with the condition; and wherein the traversing comprises: reaching a first state of the DFA and an associated first node of the graph data structure; subsequently, executing the assignment statement to store first information associated with the first node into a computer-readable memory communicatively connected with the control unit, wherein the stored first information corresponds to information of the first node associated with the condition; subsequently, testing the condition with respect to the first information, wherein the testing comprises using the stored first information associated with the first node, wherein a node which matches the condition with respect to the first information is a result node; after the testing, unwinding the traversal to the first state and a second node of the graph data structure different from the first node; and after the testing, discarding the first information from the computer-readable memory. reaching a first state of the DFA and an associated first node of the graph data structure; subsequently, executing the assignment statement to store first information associated with the first node into a computer-readable memory communicatively connected with the control unit, wherein the stored first information corresponds to information of the first node associated with the condition; subsequently, testing the condition with respect to the first information, wherein the testing comprises using the stored first information associated with the first node, wherein a node which matches the condition with respect to the first information is a result node; after the testing, unwinding the traversal to the first state and a second node of the graph data structure different from the first node; and after the testing, discarding the first information from the computer-readable memory.