Hierarchical Data

By augmenting the AST of queries with parent identifiers, the method efficiently identifies ancestor objects in hierarchical data, reducing overhead and enabling efficient query evaluation in systems like JSONata and XPath.

JP7546674B2Active Publication Date: 2024-09-06INTERNATIONAL BUSINESS MACHINE CORPORATION

Patent Information

Application Number
JP2022537263
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-01-17
Filing Date
2021-01-12
Publication Date
2024-09-06
Estimated Expiration
2041-01-12

AI Technical Summary

Technical Problem

Existing query languages for hierarchical data, such as XPath and JSONata, require pre-processing to include relational information, leading to increased CPU overhead and memory consumption, and fail to identify parent nodes without such information.

Method used

A method and system that augment the abstract syntax tree (AST) of queries with parent identifiers, allowing the query processor to identify ancestor objects efficiently without pre-processing the data, by appending metadata to the AST during compilation.

Benefits of technology

This approach reduces computational and storage costs by processing the AST only once, enabling efficient evaluation of queries multiple times without affecting query performance, and supports identifying ancestor nodes in hierarchical data structures like JSON and XML.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007546674000005
    Figure 0007546674000005
  • Figure 0007546674000001
    Figure 0007546674000001
  • Figure 0007546674000004
    Figure 0007546674000004
Patent Text Reader

Abstract

A computer-implemented method, system, and computer program product are provided for identifying ancestor objects in hierarchical data configured for processing using a query having an associated abstract syntax tree. The abstract syntax tree can be processed to generate an augmented abstract syntax tree that includes a parent identifier configured to identify a parent node of the query. In this manner, the need for pre-parsing the data can be eliminated. Instead, the identity of the parent node of the query can be encoded in the abstract syntax tree of the query.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] FIELD OF THE DISCLOSURE Embodiments of the invention relate generally to hierarchical data, and more particularly to ideas for identifying ancestor objects in hierarchical data. Embodiments of the invention also relate to ideas for processing hierarchical data using queries in a query language. Such ideas are computer-implementable.

[0002] Embodiments of the invention also relate to computer program products comprising computer readable program code for enabling a processor of a system, or a plurality of processors of a network, to carry out such methods.

[0003] Additionally, embodiments of the present invention relate to a system for identifying ancestor objects in hierarchical data configured for processing using queries in a query language.Embodiments of the present invention further relate to a system for processing hierarchical data using queries in a query language. [Background technology]

[0004] Structured data query languages ​​such as XPath (Extensible Markup Language (XML) Query Language) contain syntax that allows users to find the "parent" element of any other element in the data structure. This is possible because the input data (e.g., XML when using XPath) has been specially parsed to include the complete interconnected relationship information in the parsed input structure. Thus, when a parent element is required, the query engine need only simply traverse the parsed structure.

[0005] The above approaches rely on data being pre-processed to include relationship information. Pre-processing the input data adds additional CPU overhead to query evaluation. Also, creating a copy of the data with the additional relationship metadata is significantly more memory intensive and needs to be done on every query invocation.

[0006] If the data is not modified to include relationship information, for example a JavaScript® object structure that natively represents JSON (JavaScript® Object Notation) data, the query engine will not be able to identify the "parent" of any data in the data structure (because the relationship information is not available). Summary of the Invention [Problem to be solved by the invention]

[0007] SUMMARY OF THE PRESENT EMBODIMENTS Embodiments of the present invention aim to provide a method for identifying ancestor objects in hierarchical data arranged for processing using queries in a query language.

[0008] An embodiment of the present invention also aims to provide a method for processing hierarchical data using a query in a query language, the query having an associated abstract syntax tree AST.

[0009] An embodiment of the present invention further aims to provide a computer program product comprising computer program code for performing the proposed method when executed by a processing unit, and also aims to provide a processing system adapted to execute this computer program code.

[0010] It is a further object of embodiments of the present invention to provide a system for identifying ancestor data in hierarchical data configured for processing using queries in a query language.It is also an object of embodiments of the present invention to provide a system for processing hierarchical data using queries in a query language. [Means for solving the problem]

[0011] According to one embodiment of the present invention, there is provided a computer-implemented method for identifying ancestor objects in hierarchical data configured for processing using a query in a query language, the query having an associated abstract syntax tree (AST). The method includes processing an AST associated with the query to determine a parent node of the AST related to the query. The method also includes augmenting the AST with a parent identifier configured to identify the determined parent node to generate an augmented AST.

[0012] The proposed idea is to provide a query language for determining the parent or any higher ancestor of any data item in a hierarchical data structure without the hierarchical information (e.g., parent relationship information) having to be encoded in the data itself. Instead, embodiments propose that the parse tree of the query language itself is post-processed and augmented with appropriate information.

[0013] Thus, the proposed embodiments may provide the advantage that processing of the query AST can be performed as part of the query compilation and therefore only needs to be done once, while evaluation of the compiled query can be done multiple times. The embodiments may also have the advantage that processing of the query is not affected by data size.

[0014] Embodiments may eliminate the need to pre-parse input data by augmenting an AST associated with a query with information identifying parent nodes of the query. In other words, embodiments may alleviate the need to pre-process input data to include relationship information by encoding the identity of one or more parent objects into the AST of the query language.

[0015] In some embodiments, processing the AST associated with a query to determine a parent node in the AST related to the query may include traversing the AST to determine a node in the AST that represents a parent node of the query. In this manner, a simple process of following a path in the AST to identify the parent node in a computationally efficient manner may be employed.

[0016] The parent identifier may be configured to instruct the query processor to save a reference to the parent node. In this manner, an embodiment may be configured to instruct the query processor to save a reference to the requested parent in an appropriate storage mechanism for later use in a query when the ancestor is actually requested.

[0017] In one embodiment, augmenting the AST with a parent identifier configured to identify the determined parent node to generate the augmented AST may include adding an ancestor attribute to the parent node of the AST. Rather than augmenting the data with relationship information, which may incur high computational and / or storage costs (because every value must store a hidden back reference to its parent object), embodiments may preprocess the AST to add metadata to relevant portions.

[0018] For example, adding an ancestor attribute to a parent node of the AST may include setting the value of the ancestor attribute to a predefined value. For example, the predefined value may be based on a counter value, where the counter value is incremented for each parent node identified. Use of the counter value may support, for example, a simple counting method for identifying corresponding parent nodes in a hierarchy with multiple ancestries.

[0019] Some embodiments may further include the preceding step of generating an AST by parsing the query. Thus, it is understood that embodiments may include generating an AST, while other embodiments may be configured to process an existing AST (e.g., an AST that has been pre-generated by a separate system / method).

[0020] The proposed embodiment may further include storing the augmented AST and associating the hierarchical data with the stored augmented AST. In this manner, the embodiment may be configured to provide query resources that are available when the query is subsequently evaluated (possibly multiple times). Thus, although a query needs to be processed only once according to the proposed ideas, the query may be evaluated multiple times.

[0021] The hierarchical data may include JSON data, in which case the query language may be the JSONata query language (a JSON query and transformation language). Thus, embodiments are employable with conventional languages ​​and object structures.

[0022] According to another embodiment of the present invention, there is provided a computer-implemented method for processing hierarchical data using a query in a query language, the query having an associated abstract syntax tree (AST). The method includes, according to one embodiment of the proposal, identifying ancestor objects in the hierarchical data. The method may then include evaluating the query by processing the augmented AST against the hierarchical data.

[0023] According to another embodiment of the present invention there is provided a computer program product, comprising a computer readable storage medium having program instructions embodied therein, the program instructions being executable by a processing unit to cause the processing unit to perform a method according to one embodiment of the proposed method.

[0024] According to another embodiment of the present invention there is provided a computer system including at least one processor and a computer program product according to an embodiment, the at least one processor adapted to execute computer program code of said computer program product.

[0025] According to another embodiment of the invention, there is provided a system for identifying ancestor objects in hierarchical data configured for processing using a query in a query language, the query having an associated AST. The system includes a processing unit configured to process an AST associated with the query to determine a parent node of the AST related to the query. The system also includes an augmentation component configured to augment the AST with a parent identifier configured to identify the determined parent node to generate an augmented AST.

[0026] According to another embodiment of the present invention, there is provided a system for processing hierarchical data using a query in a query language, the query having an AST associated with it. The system includes a system for identifying ancestor objects in the hierarchical data according to one embodiment of the proposal. The system also includes a processor arrangement configured to evaluate the query by processing the augmented AST against the hierarchical data.

[0027] The foregoing has outlined rather generally the features and technical advantages of one or more embodiments of the present invention in order that the detailed description of the invention that follows may be better understood. Additional features and advantages of the invention that may form the subject of the claims of the invention will be described hereinafter.

[0028] The invention can be better understood from the following detailed description when considered in conjunction with the following drawings. [Brief description of the drawings]

[0029] [Figure 1] FIG. 1 illustrates an exemplary distributed system in which aspects of the exemplary embodiments may be implemented, in accordance with one embodiment of the present invention. [Diagram 2] FIG. 1 is a schematic diagram illustrating a proposed system for identifying ancestor objects in hierarchical data, according to an embodiment of the present invention. [Diagram 3]3 is a flow diagram illustrating a computer-implemented method for identifying ancestor objects in hierarchical data according to one embodiment of the present invention. [Figure 4] 2 is a flow diagram illustrating a computer-implemented method of processing hierarchical data using queries according to one embodiment of the present invention. [Diagram 5] FIG. 2 illustrates a system according to another embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0030] It should be understood that the drawings are only schematic and are not drawn to scale, and that the same reference numbers are used throughout the drawings to indicate the same or similar parts.

[0031] In the context of the present application, where an embodiment of the invention constitutes a method, it will be understood that such a method may be a process for execution by a computer, i.e. a computer-implemented method, and thus the various steps of the method may reflect various portions of a computer program, e.g. various portions of one or more algorithms.

[0032] Also, in the context of this application, a system may be a single device or a collection of distributed devices adapted to execute one or more embodiments of the method of the present invention. For example, a system may be a personal computer (PC), a server, or a collection of PCs and / or servers connected via a network, such as a local area network, the Internet, etc., to cooperatively execute at least one embodiment of the method of the present invention. Furthermore, a component may be an integrated flow executed by one or more processing units.

[0033] Ideas are proposed for identifying ancestor (e.g., parent) objects in hierarchical data configured for processing using a query. Such ideas can process an AST associated with a query to generate an augmented AST that includes a parent identifier configured to identify the parent node of the query. In this manner, the need to pre-parse the data can be alleviated. Instead, the identity of the parent node of the query can be encoded into the AST of the query.

[0034] For example, rather than augmenting the data with information about hierarchical relationships (which can be computationally expensive since every value would have to remember hidden backreferences to its parent objects and / or require large amounts of data storage), proposed embodiments can preprocess the AST of a data query to append metadata (that identifies the parent nodes of the query) to relevant parts of the AST.

[0035] "Parent" should be taken to mean the object of the query that contains the property whose value currently has a reference in the query.

[0036] Therefore, the embodiments can provide an idea for finding ancestor objects in hierarchical data.

[0037] 1 illustrates a diagram of an example distributed system in which aspects of the example embodiments may be implemented. Distributed system 100 may include a network of computers in which aspects of the example embodiments may be implemented. Distributed system 100 includes at least one network 102, which is the medium used to provide communications links between the various devices and computers connected to each other within distributed data processing system 100. Network 102 may include connections such as wires, wireless communication links, or fiber optic cables.

[0038] In the illustrated embodiment, a first server 104 and a second server 106 are connected to the network 102 along with a storage unit 108. Additionally, clients 110, 112, and 114 are also connected to the network 102. Clients 110, 112, and 114 may be edge devices, such as personal computers, network computers, IoT devices, and the like. In the illustrated embodiment, the first server 104 provides data, such as boot files, operating system images, and applications, to clients 110, 112, and 114. Clients 110, 112, and 114 are clients of the first server 104 in the illustrated embodiment. Distributed data processing system 100 may include additional servers, clients, and other devices not shown.

[0039] In the depicted example, distributed system 100 is the Internet, where network 102 represents a worldwide collection of networks and gateways that use the Transmission Control Protocol / Internet Protocol (TCP / IP) suite of protocols to communicate with one another. At the heart of the Internet is a backbone of high-speed data communication lines between major nodes or host computers, consisting of thousands of commercial, governmental, educational and other computer systems that route data and messages. Of course, distributed system 100 may be implemented to include a number of different types of networks, such as, for example, intranets, local area networks (LANs), wide area networks (WANs), etc. As noted above, FIG. 1 is intended as an illustration, and not an architectural limitation for various embodiments of the present invention, and thus the specific elements illustrated in FIG. 1 should not be construed as limitations with respect to the environments in which example embodiments of the present invention may be implemented.

[0040] Those skilled in the art will appreciate that the hardware in Figure 1 may vary depending on the implementation, and the processes of the illustrative embodiments may be applied to multi-processor data processing systems other than those described above without departing from the scope of the present invention.

[0041] Additionally, embodiments may take the form of any of a number of different data processing systems, including client computing devices, server computing devices, tablet computers, laptop computers, telephones or other communications devices, personal digital assistants (PDAs), etc. In some illustrative examples, a system according to an embodiment may be a portable computing device configured with, for example, flash memory to provide non-volatile memory for storing operating system files and / or user generated data. Thus, a system according to the proposed embodiments may essentially be any known or later developed data processing system without architectural limitations.

[0042] As described above, the proposed embodiments provide a method and system for identifying ancestor objects in hierarchical data configured for processing using queries in a query language, the queries having an abstract syntax tree (AST) associated therewith.

[0043] By way of further explanation, one embodiment of a proposed such system will now be described with reference to FIG.

[0044] 2, a schematic diagram of a proposed system 200 for identifying ancestor objects in hierarchical data is shown, according to one embodiment. The hierarchical data is stored in a database 210 (e.g., a remote data store accessible via the Internet) and configured for processing using queries 215 in a query language. Specifically, in this example, the hierarchical data includes JSON (JavaScript® Object Notation) data, and the query language is the JSONata query language (JSON Query and Transformation Language).

[0045] The system 200 includes a query parser 220 configured to generate an abstract syntax tree AST 225 by parsing the query 210. In this manner, the system 200 is configured to generate the AST 225 associated with the query 210.

[0046] The system 200 also includes a processing unit 230 configured to process the AST 225 associated with the query 210 to determine a parent node of the AST 225. Here, the processing unit 230 includes a traversal component 235 configured to traverse the AST 225 to determine a node of the AST 225 that represents a parent node of the query 215.

[0047] An augmentation component 240 of system 200 is configured to augment AST 225 with a parent identifier that identifies the determined parent node. The parent identifier is configured to instruct the query processor to store a reference to the parent node. In this example embodiment, augmentation component 240 generates an augmented AST 245 (denoted by "*" in FIG. 2). Specifically, augmentation component 240 includes an attribute editor 250 configured to add an ancestor attribute to the parent node of AST 225. Attribute editor 250 sets the value of the ancestor attribute to a predetermined value that is based on a count value that is incremented for each parent node identified in this example.

[0048] System 200 further includes a storage component 260 configured to store the augmented AST (e.g., for later access / use via an input / output (I / O) interface of system 200). System 200 also includes an association component 270 configured to associate the stored augmented AST 245 with hierarchical data 210.

[0049] As a further example, a query may have the expression Account.Order.Product.!OrderID.

[0050] The above query expression is parsed into the following abstract syntax tree (AST): _path_ Account Order Product ! (parent) OrderID

[0051] A traditional expression evaluator follows a path step by step, applying each step to the input document. The first step selects the value associated with the "Account" property in the input data. It then proceeds to the next step and selects the value associated with the "Order" property using the result of the previous step as the input (context) data. This continues step by step until it reaches the "!" token, which represents a "select parent" action. Now a problem arises because the input (context) data (i.e. the value associated with the Product property) does not contain a back-reference to the "Order" value.

[0052] For example, rather than augmenting the input data with such relationship information, which would be computationally expensive, we propose the idea of ​​pre-processing the AST to add additional information (e.g., metadata) to identify parent nodes. In the above example, when the parent operator "!" is encountered, a uniquely named label is created, counting back one step, and the next "Product" step is labeled with that label. The resulting augmented AST for this example is: _path_ Account Order Product (ancestor #0) ! (parent #0) OrderID where #0 is the generated label (the number is incremented for other occurrences of "!").

[0053] In this case, the query evaluator is configured to be aware of this additional information, such that when it processes the "Product" step it first stores a reference to its input context value (which is an Order value) in an appropriate storage mechanism (i.e. a hash table) keyed by the label "#0". When the query evaluator processes the parent "!" step, the result of that step will be the value previously stored against label "#0".

[0054] It should be understood that the above example is simple and may not necessarily represent the real-world needs of a parent operator. A more realistic example is as follows, which creates an object with two properties ("Name" and "Order") for each Product. Account.Order.Product.{ 'Name': ProductName, 'Order': !.OrderID }

[0055] The value of the output "Name" property will be the value of the "ProductName" property of the input "Product" (context) value. The value of the output "Order" property will depend on finding the parent of the current Product to get its "OrderID" value.

[0056] According to the idea of ​​the proposal, the following augmented AST is generated for the above expression: _path_ Account Order Product (ancestor #0) _object_ { 'Name' _path_ Product Name Order' _path_ ! (parent #0) OrderID }

[0057] The problem in this example is that the parent '!' operator is the first step in its subpath, so it's not as simple as labeling the previous step. Because functions that process the AST are recursive, when the function recurses (and unwinds the stack), if the first step is still seeking its parent, the search is moved up the stack by attaching a property 'seekingParent:label' to the containing node in the AST (in this case the object constructor). After advancing this property down to a node that is a step in the containing path, it finds the previous step to label with the 'ancestor' property.

[0058] The proposed implementation may be configured to accommodate any level of ancestry. For example, consider a query expression such as: Account.Order.Product.{ 'Name': ProductName, 'Order': !.OrderID, 'Account':!.!.AccountID }

[0059] The expression in the previous paragraph contains a sub-expression !.!.AccountID constructed to select the grandfather of Product. It is also proposed to associate a "seekingParent" property with a "level" counter that is decremented with each step back in the count, but incremented if that step is a parent "!" operator. When the counter reaches zero, the correct ancestor has been found.

[0060] From the above description, it can be seen that the proposed embodiments can be configured to provide enhanced capabilities in hierarchical data storage and processing systems. Such capabilities can be facilitated by utilizing the idea of ​​pre-processing an AST associated with a query to generate an augmented AST that includes information for identifying parent nodes of the query.

[0061] By way of further explanation, one embodiment of a proposed method for identifying ancestor objects in hierarchical data is described below with reference to FIG.

[0062] Referring to Figure 3, there is shown a flow diagram of a computer-implemented method for identifying ancestor objects in hierarchical data arranged for processing using a query in a query language. In this example, the query language is the XPath query language. XPath has the ability to query parent nodes (and other nodes preceding the current context node). To this end, XPath assumes that the XML document has been parsed by a DOM parser that creates an interconnected tree of nodes (infoset) where each node has a link to its parent node.

[0063] The method begins with step 310 of generating an AST by parsing the query. Such generation of an AST is well known, and one of many different AST generation processes may be employed in step 310. By way of example only, the AST for a query may be generated using a known parser called the Pratt parser. A parser generation tool may be used that creates parser code given a formal grammar for a language.

[0064] The generated AST is then processed based on the query to determine a parent node of the AST associated with the query, at step 320. Specifically, such processing to determine a parent node of the AST associated with the query includes step 325 of traversing the AST to determine a node of the AST that represents a parent node of the query.

[0065] The AST is then augmented with the parent identifier at step 330. Here, augmenting the AST with the parent identifier includes step 335 of adding an ancestor attribute to the determined parent node of the AST. This includes setting the value of the ancestor attribute to a value based on a counter value. The counter value may, for example, be incremented for each parent node that is identified, thereby providing a means of distinguishing between multiple determined parent nodes. In this manner, the parent identifier may be used to instruct the query processor to store a reference to the corresponding parent node.

[0066] The augmented AST is then stored in a data storage component in step 340. Such a data storage component processes the AST and may be located remotely (e.g., via the Internet or a distributed communications network) from the augmented component / system. Finally, in step 350, the stored augmented AST is associated with the hierarchical data.

[0067] In addition to the above, embodiments may be applied to ASTs that represent XPath expressions. This allows an XPath processor to query ancestor nodes in an XML document parsed by a SAX parser (SAX is a more performant API for parsing XML documents that emit events because the document is scanned from beginning to end without storing any data), while not having to store additional structural information for the data itself. Such techniques can also be extended to apply to all other backward axes in XPath (ancestor, ancestor-or-self, parent, preceding, preceding-sibling).

[0068] As a further illustration, we now explain how the proposed method can be implemented using the JSONata query language as an example. JSONata is a JavaScript® library designed for querying and transforming JSON data. It has a location path syntax for navigating JSON structures that is similar in nature to the XPath syntax for XML data. The following example can be considered: Input data: { "Account": { "Account Name":"Firefly", "Order": [ { "OrderID":"order103", "Product": [ { "ProductName": "Bowler Hat", "SKU":"0406654608", "Price": 34.45, "Quantity": 2 }, { "ProductName": "Trilby hat", "SKU":"0406634348", "Price": 21.67, "Quantity": 1 } ] }, { "OrderID":"order104", "Product": [ { "ProductName": "Bowler Hat", "SKU":"040657863", "Price": 34.45, "Quantity": 4 }, { "ProductName":"Cloak", "SKU":"0406654603", "Price": 107.99, "Quantity": 1 } ] } ] } }

[0069] Next, an example JSONata query expression might look like this: Account.Order.Product.{ 'Name': ProductName, 'Order': !.OrderID }

[0070] Here, the dot operator "." specifies that for each item that matches the left side (the context), select all items that match the right side (a function mapping operation). The "!" symbol represents a request to select the parent object of this context. In this case, the subpath "!.OrderID" asks for the OrderID property of the "Order" object, which is the parent (containing object) of the Product context object.

[0071] The desired result of evaluating this expression on the example input data above is: [ { "Name": "Bowler Hat", "Order": "order103"}, { "Name": "Trilby hat", "Order": "order103"}, { "Name": "Bowler Hat", "Order": "order104"}, { "Name": "Cloak","Order": "order104"} ]

[0072] To achieve this without modifying the input data to include parent references, the AST of the parsed query expression is traversed to identify AST nodes that represent parts of the query that match parent objects.

[0073] According to the idea of ​​the proposal, the augmented AST for the above JASONata query expression is as follows: type: path steps: - value: Account type: name - value: Order type: name - value: Product <- AST node decorated with "ancestor" attribute. type: name ancestor: 0 tuple: true - type: unary value: "{" seekingParent: 0 <- A temporary attribute used when walking the AST upwards lhs: - - value: Name type: string - type: path steps: - value: ProductName type: name - - value: Order type: string - type: path steps: - type: parent <- AST node representing the '!' token slot: 0 - value: OrderID type: name seekingParent: 0 <- A temporary attribute used when walking the AST upwards.

[0074] When the query evaluation engine processes this augmented AST against the input data, it identifies AST nodes decorated with the "ancestor" attribute and stores their input context items (i.e., the current "Order" value) as a tuple stream containing the accumulated query results and any temporary numeric variable bindings. This stored value is then available later when the AST node representing the "!" token is processed, and is looked up using the unique "slot" number.

[0075] The algorithm used to find the parent AST node is as follows: (i) A parent operator is a "parent" type step in a path array. (ii) If it is the first step, the path has "seekingParent" = <number>Then we label the node as "seekingParent" and traverse up the AST until we get to the path. (iii) If the step index is >= 1 (i.e., not the first step), then examine the previous step. (iv) Is the type of the previous step "name" or "wildcard"? (v) If yes: This step has parent= <number>and label it as Abort(Complete). (vi) Is the previous step of type “block”? (vii) If yes, check the last expression in the block. Repeat from the beginning. (viii) Otherwise, throw an error. The parent cannot be determined.

[0076] From the above description it will be seen that the embodiment of Fig. 3 can be used to process hierarchical data using queries. As an example, a proposed embodiment for processing hierarchical data using queries in a query language is described below with reference to Fig. 4.

[0077] Referring to Figure 4, a flow diagram of a computer-implemented method 400 for processing hierarchical data using a query in a query language is shown. The method 400 first involves performing the method 300 for identifying ancestor objects in the hierarchical data according to the embodiment of Figure 3. Next, in step 410, the query is evaluated by processing the augmented AST against the hierarchical data.

[0078] An embodiment may include a computer system 70 that may form part of the network system 7 shown in Figure 5. For example, an augmentation component according to an embodiment may be implemented in the computer system 70 (e.g., as a processing unit 71). The components of the computer system / server 70 may include one or more processing mechanisms including, for example, but not limited to, a processor or processing unit 71, a system memory 74, and a bus 90 that couples various system components including the system memory 74 to the processing unit 71.

[0079] The system memory 74 may include computer system readable media in the form of volatile memory such as random access memory (RAM) 75 and / or cache memory 76. The computer system / server 70 may further include other removable / non-removable, volatile / non-volatile computer system storage media. In such a case, each may be connected to the bus 90 by one or more data media interfaces. The memory 74 may include at least one program product having a set (e.g., at least one) program module configured to implement the functionality of the proposed embodiments. For example, the memory 74 may include a computer program product having a program executable by the processing unit 71 to cause the input / output (I / O) interface 72 to perform a method for a pub / sub messaging system middleware system according to one proposed embodiment. A program / utility 78 having a set (at least one) program module 79 may be stored in the memory 74. The program module 79 generally implements the functionality and / or method of the proposed embodiments for a pub / sub messaging system.

[0080] The computer system / server 70 may also communicate with one or more external devices 80, such as a keyboard, pointing device, display 85, one or more devices that allow a user to interact with the computer system / server 70, or any device that allows the computer system / server 70 to communicate with one or more other computing devices (e.g., network cards, modems, etc.), or combinations thereof. Such communication may occur via an input / output (I / O) interface 72. Additionally, the computer system / server 70 may communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), or a public network (e.g., the Internet), or combinations thereof, via a network adapter 73 (e.g., to communicate the determined optimal value of the DFWF to edge devices of the distributed network).

[0081] In the context of this application, where an embodiment of the invention constitutes a method, it is to be understood that such method is a process for execution by a computer, i.e. a computer-implemented method, and thus the steps of the method reflect various portions of a computer program, e.g. portions of one or more algorithms.

[0082] The present invention may be a system, method, or computer program product, or combination thereof, of any possible level of technical detail of integration. The computer program product may include a computer-readable storage medium (or media) having computer-readable program instructions stored thereon for causing a processor to implement aspects of the present invention.

[0083] A computer readable storage medium may be a tangible device capable of holding and storing instructions for use by an instruction execution device. A computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. A non-exhaustive list of more specific examples of computer readable storage media includes portable computer diskettes, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically encoded devices such as punch cards or ridge structures in grooves with instructions recorded thereon, and any suitable combination thereof. As used herein, a computer-readable storage medium should not be construed as a transitory signal per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., light pulses through a fiber optic cable), or electrical signals transmitted over wires.

[0084] The computer readable program instructions described herein may be downloaded from a computer readable storage medium to the respective computing / processing device or to an external computer or storage device via a network, such as the Internet, a local area network, a wide area network, or a wireless network, or a combination thereof. The network may include copper transmission cables, optical transmission fiber, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer readable program instructions from the network and forwards the computer readable program instructions to a computer readable storage medium within the respective computing / processing device for storage.

[0085] The computer readable program instructions for carrying out the operations of the present invention may be source or object code written in any combination of one or more programming languages, including assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state setting data, configuration data for an integrated circuit, or procedural programming languages, such as object oriented programming languages, such as Smalltalk, C++, and the "C" programming language, or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer as a stand-alone software package, partially on the user's computer, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be to an external computer (e.g., via the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA) may execute computer readable program instructions to carry out aspects of the invention by personalizing the electronic circuitry using state information of the computer readable program instructions.

[0086] Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams that illustrate methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer readable program instructions.

[0087] These computer readable program instructions may be provided to a processor of a computer or other programmable data processing apparatus to implement a machine such that the instructions, executed by the processor of the computer or other programmable data processing apparatus, form means for implementing the functions / operations specified in the blocks of the flowcharts and / or block diagrams. These computer readable program instructions may be stored in a computer readable storage medium capable of instructing a computer, programmable data processing apparatus, or other device, or combination thereof, to function in a particular manner, such that the computer readable storage medium on which the instructions are stored comprises an article of manufacture including instructions that implement aspects of the functions / operations specified in the blocks of the flowcharts and / or block diagrams.

[0088] The computer readable program instructions may be loaded into a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus, or other device to achieve a computer-implemented process, such that the instructions, which execute on the computer, other programmable apparatus, or other device, implement the functions / acts specified in the flowchart and / or block diagram blocks.

[0089] The flowcharts and block diagrams in the figures illustrate the architecture, functionality and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowcharts or block diagrams may represent a module, segment or portion of instructions, including one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the figures. For example, two blocks shown in succession may in fact be performed as one step, may be partially or fully executed in parallel with overlapping in time, may be executed substantially in parallel, or the blocks may be executed in reverse order, depending on the functionality involved. It should also be understood that each block of the block diagrams and / or flowchart illustrations, and combinations of blocks in the block diagrams and / or flowchart illustrations, may be implemented by a dedicated hardware-based system that executes the specified functions or operations, or may embody a combination of dedicated hardware and computer instructions.

[0090] The description of various embodiments of the present invention is provided for illustrative purposes and is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terms used in this specification are selected to best explain the principles of the embodiments, practical applications, or technical improvements to the technology found in the market, or to enable those skilled in the art to understand the embodiments disclosed herein.< / number> < / number>

Claims

1. 1. A computer-implemented method for identifying ancestor objects in hierarchical data configured for processing a query in a query language, the query having an associated abstract syntax tree (AST), the method comprising: processing the AST associated with the query to determine a parent node of the AST related to the query; and augmenting the AST with a parent identifier configured to identify the determined parent node to generate an augmented AST.

2. The processing of the AST associated with the query to determine the parent node of the AST related to the query, comprising:

2. The method of claim 1, comprising traversing the AST to determine a node in the AST that represents a parent node of the query.

3. The method of claim 1 , wherein the parent identifier is configured to instruct a query processor to store a reference to the parent node.

4. augmenting the AST with the parent identifier configured to identify the determined parent node to generate the augmented AST, The method of claim 1 , further comprising adding an ancestor attribute to the parent node of the AST.

5. The addition of the ancestor attribute to the parent node of the AST comprises: The method of claim 4 , further comprising setting the value of the ancestor attribute to a predetermined value.

6. The method of claim 5 , wherein the predetermined value is based on a counter value, the counter value being incremented for each parent node identified.

7. The method of claim 1 , further comprising generating the abstract syntax tree by parsing the query.

8. storing the augmented AST; and The method of claim 1 , further comprising associating the stored augmented AST with the hierarchical data.

9. The method of claim 1 , wherein the hierarchical data comprises JSON data and the query language is the JSONata query language.

10. A program for causing a processor to carry out the method according to any one of claims 1 to 9.

11. A memory storing a program for causing a processor to carry out the method according to any one of claims 1 to 9; A system comprising the processor.

Citation Information

Patent Citations

  • Database retrieval system and database retrieving method

    JP2008084028A

  • Query conversion method and retrieving device

    JP2009230569A

  • System and method for querying XML streams

    US20040205082A1

  • XML Update Facility for an XQuery Processor

    US20090089268A1

Cited By

  • Hierarchical data

    US12361025B2