# US 11,907,296 B2 · Method and system for traversing an object graph using traversal context objects

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,907,296 B2
- Document ID: US11907296B2
- Status: Granted
- Kind: B2
- Application number: 18/157,687
- Filed: 2023-01-20
- Published: 2023-05-25
- Granted: 2024-02-20
- Earliest claimed: 2020-05-21
- Assignees: Intuit Inc.
- Applicants: Intuit Inc.
- Inventors: Aleksandr Matiushkin; Ajay Gupta; Grigoriy Kesler
- Web page: https://patentgrep.com/patent/US11907296B2

## CPC

- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06F 9/546: {Message passing systems or structures, e.g. queues}
- G06F 16/289: {Object oriented databases}
- G06F 16/90335: {Query processing}
- G06F 16/9038: Presentation of query results
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Certain aspects of the present disclosure provide techniques for enumerating relationships in an object graph using traversal context objects that are decoupled from the implementation details of an object graph and the objects stored therein. An example method generally includes receiving a request to traverse an object graph, the object graph including a plurality of objects. A root context object is generated, and a traversal context object associated with a root node of the object graph is generated. The traversal context object is linked to the root context object and added to a traversal data structure. The graph is traversed by adding and removing traversal context objects to and from the traversal data structure until a terminating event occurs.

## Claims

### Claim 1

A method for enumerating relationships between objects in an object graph, comprising:
receiving a request to traverse an object graph, the object graph including a plurality of objects;
generating a root context object;
generating a particular traversal context object associated with a root node of the object graph;
linking the particular traversal context object to the root context object;
adding the particular traversal context object to a traversal data structure; and
traversing the object graph by adding and removing additional traversal context objects to and from the traversal data structure until a terminating event occurs, wherein:
each of the particular traversal context objects comprises:
an object from the object graph;
information about local variables associated with the object; and
a reference to a parent traversal context object;
adding a given additional traversal context object occurs when a given object in the object graph is traversed; and
removing a respective additional traversal context object occurs when a respective object corresponding to the respective additional traversal context object and any child objects of the respective object in the object graph have been traversed.

### Claim 2 (depends on 1)

The method of claim 1, wherein the request to traverse the object graph includes an initial set of context variables that can be modified by additional traversal context objects associated with objects in the object graph during traversal of the graph.

### Claim 3 (depends on 1)

The method of claim 1, wherein the request includes a discovery mechanism having instructions for processing objects discovered in the object graph.

### Claim 4 (depends on 3)

The method of claim 3, wherein the discovery mechanism comprises code for modifying one or more variables in the root context object based on properties of an object in the object graph.

### Claim 5 (depends on 3)

The method of claim 3, wherein traversing the object graph comprises:
removing the particular traversal context object from the traversal data structure;
determining a traversal context of the particular traversal context object; and
executing one or more actions to process the particular traversal context object based on the determined traversal context.

### Claim 6 (depends on 5)

The method of claim 5, wherein:
the traversal context comprises a post-order context; and
executing the one or more actions to process the particular traversal context object comprises:
executing one or more actions defined in the discovery mechanism for processing objects using the post-order context; and
removing a first removable object from the traversal data structure for further analysis.

### Claim 7 (depends on 5)

The method of claim 5, wherein:
determining the traversal context of the particular traversal context object comprises determining that the traversal context corresponds to a back-reference context based on determining that the particular traversal context object has previously been removed from the traversal data structure; and
executing the one or more actions comprises:
executing one or more actions defined in the discovery mechanism for processing objects using the back-reference context; and
removing a first removable object from the traversal data structure for further analysis.

### Claim 8 (depends on 5)

The method of claim 5, wherein:
the traversal context comprises a pre-order context; and
executing the one or more actions to process the particular traversal context object comprises:
discovering, in the object graph, children objects of an object from the object graph associated with the particular traversal context object;
generating additional traversal context objects for the discovered children objects; and
adding the generated additional traversal context objects to the traversal data structure.

### Claim 9 (depends on 8)

The method of claim 8, further comprising:
adding the removed particular traversal context object to the traversal data structure; and
setting a traversal context of the removed particular traversal context to a post-order context.

### Claim 10 (depends on 1)

The method of claim 1, wherein:
the request comprises a request received at one of a plurality of services in a distributed computing environment to process a message; and
traversing the object graph comprises:
for each respective object added to the traversal data structure:
generating a message to instruct a service associated with the respective object to process a command with respect to the respective object, and
routing the message to the service associated with the respective object for processing.

### Claim 11

A system, comprising:
a processor; and
a memory having instructions stored thereon which, when executed by the processor, performs an operation for enumerating relationships between objects in an object graph, the operation comprising:
receiving a request to traverse an object graph, the object graph including a plurality of objects,
generating a root context object,
generating a particular traversal context object associated with a root node of the object graph,
linking the particular traversal context object to the root context object,
adding the particular traversal context object to a traversal data structure, and
traversing the object graph by adding and removing additional traversal context objects to and from the traversal data structure until a terminating event occurs, wherein:
each of the particular traversal context objects comprises:
an object from the object graph;
information about local variables associated with the object; and
a reference to a parent traversal context object;
adding a given additional traversal context object occurs when a given object in the object graph is traversed; and
removing a respective additional traversal context objects occurs when a respective object corresponding to the respective additional traversal context object and any child objects of the respective object in the object graph have been traversed.

### Claim 12 (depends on 11)

The system of claim 11, wherein the request to traverse the object graph includes an initial set of context variables that can be modified by additional traversal context objects associated with objects in the object graph during traversal of the graph.

### Claim 13 (depends on 11)

The system of claim 11, wherein the request includes a discovery mechanism having instructions for processing objects discovered in the object graph.

### Claim 14 (depends on 13)

The system of claim 13, wherein the discovery mechanism comprises code for modifying one or more variables in the root context object based on properties of an object in the object graph.

### Claim 15 (depends on 13)

The system of claim 13, wherein traversing the object graph comprises:
removing the particular traversal context object from the traversal data structure;
determining a traversal context of the particular traversal context object; and
executing one or more actions to process the particular traversal context object based on the determined traversal context.

### Claim 16 (depends on 15)

The system of claim 15, wherein:
the traversal context comprises a post-order context; and
executing the one or more actions to process the particular traversal context object comprises:
executing one or more actions defined in the discovery mechanism for processing objects using the post-order context; and
removing a first removable object from the traversal data structure for further analysis.

### Claim 17 (depends on 15)

The system of claim 15, wherein:
determining the traversal context of the particular traversal context object comprises determining that the traversal context corresponds to a back-reference context based on determining that the particular traversal context object has previously been removed from the traversal data structure; and
executing the one or more actions comprises:
executing one or more actions defined in the discovery mechanism for processing objects using the back-reference context; and
removing a first removable object from the traversal data structure for further analysis.

### Claim 18 (depends on 15)

The system of claim 15, wherein:
the traversal context comprises a pre-order context; and
executing the one or more actions to process the particular traversal context object comprises:
discovering, in the object graph, children objects of an object from the object graph associated with the particular traversal context object;
generating additional traversal context objects for the discovered children objects; and
adding the generated additional traversal context objects to the traversal data structure.

### Claim 19 (depends on 18)

The system of claim 18, further comprising:
adding the removed particular traversal context object to the traversal data structure; and
setting a traversal context of the removed particular traversal context to a post-order context.

### Claim 20

A method for enumerating relationships between objects in an object graph, comprising:
receiving a request to traverse an object graph, wherein:
the object graph includes a plurality of objects, and
the request includes a specification of a discovery mechanism defining functions for processing objects discovered in the object graph based on a context of the discovered objects and initial set of context variables for traversing the object graph;
generating a root context object;
generating a particular traversal context object associated with a root node of the object graph;
linking the particular traversal context object to the root context object;
adding the particular traversal context object to a traversal data structure; and
traversing the object graph by adding and removing additional traversal context objects to and from the traversal data structure until a terminating event occurs, wherein traversing the graph comprises:
for each respective object in the traversal data structure, performing one or more of the defined functions in the discovery mechanism with respect to the respective object, and
upon determining that the respective object has a pre-order traversal context:
discovering one or more children objects in the object graph,
generating additional traversal context objects for the discovered children objects, and
adding the generated additional traversal context objects to the traversal data structure.
