Hierarchical Data Queries with Augmented AST Parent Identifiers
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing query languages for hierarchical data, such as XPath and JSON, require pre-preparation of data to include relationship information, leading to increased CPU overhead and memory consumption, and are unable to identify parent nodes without this information.
Innovation Solution
Augmenting the abstract syntax tree (AST) of a query with parent identifiers to identify ancestor objects, eliminating the need for pre-parsing the input data and allowing efficient query evaluation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If data is pre-prepared to include relationship information, then parent element identification is enabled, but CPU overhead increases and memory consumption increases
Solution Approach 1:
The patent applies preliminary action by pre-processing the query's abstract syntax tree (AST) to augment it with parent identifiers before query execution. This shifts the computational workload from data preprocessing to query preprocessing, which is performed only once during query compilation rather than repeatedly during query evaluation, thereby reducing overall CPU overhead while enabling parent element identification.
Solution Approach 2:
The patent uses copying by creating an augmented version of the AST that includes parent identifier information. Instead of modifying the original data structure or creating a fully interconnected parsed input structure, the system creates a copy of the query representation (the AST) and augments this copy with additional metadata (parent identifiers), thus enabling parent identification without duplicating the entire data structure.
2Reliability
If data is pre-prepared to include relationship information, then parent element identification is enabled, but memory consumption increases
Solution Approach 1:
The patent applies preliminary action by pre-processing the query's abstract syntax tree (AST) to augment it with parent identifiers before query execution. This shifts the computational workload from data preprocessing to query preprocessing, which is performed only once during query compilation rather than repeatedly during query evaluation, thereby reducing overall CPU overhead while enabling parent element identification.
Solution Approach 2:
The patent uses copying by creating an augmented version of the AST that includes parent identifier information. Instead of modifying the original data structure or creating a fully interconnected parsed input structure, the system creates a copy of the query representation (the AST) and augments this copy with additional metadata (parent identifiers), thus enabling parent identification without duplicating the entire data structure.
3Quantity of substance
If data is not modified to include relationship information, then memory consumption is reduced, but parent element identification is not possible
Solution Approach 1:
The patent applies inversion by reversing the conventional approach: instead of augmenting the data structure with parent relationship information, the system augments the query representation (AST) with parent identifiers. This inversion allows parent element identification to work with unmodified data structures while maintaining low memory consumption, as the augmentation is applied to the query side rather than the data side.
4Productivity
If query AST is processed to augment with parent identifiers, then query compilation overhead is incurred, but query evaluation becomes more efficient
Solution Approach 1:
The patent applies preliminary action by performing AST augmentation during query compilation rather than during query evaluation. The computationally intensive task of traversing the AST and adding parent identifiers is done once when the query is first parsed and compiled. The augmented AST is then cached and reused for subsequent evaluations of the same query, making the evaluation phase much more efficient while accepting a one-time compilation overhead.
Data Source
AI summary
A computer-implemented method, system and computer program product for identifying ancestor objects in hierarchical data configured for processing with a query, the query having an associated abstract syntax tree. The abstract syntax tree may be processed so as to generate an augmented abstract syntax tree which includes parent identifiers configured to identify the parent nodes of the query. In this way, a need to pre-parse the data may be alleviated. Instead, the identification of a parent node of a query may be encoded into the abstract syntax tree of the query.


