Browse Prior Art Database

Method to Write Relational Style (SQL-like) Queries against Hierarchically Structured Data Sources such as JSON and XML

IP.com Disclosure Number: IPCOM000244011D
Publication Date: 2015-Nov-05
Document File: 3 page(s) / 144K

Publishing Venue

The IP.com Prior Art Database

Abstract

Disclosed is a method that defines a simple, generic means to "query" JavaScript Object Notation (JSON), Extensible Markup Language (XML), or other hierarchically structured data to extract subsets of interest in a standard "rows and columns" result set format. In accordance with the method, a Hierarchical Query Language (HQL) is employed to define such queries

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 36% of the total text.

Page 01 of 3

Method to Write Relational Style (SQL-like) Queries against Hierarchically Structured Data Sources such as JSON and XML

Many modern software products, especially Open Source and Big Data ones, provide Representational State Transfer (REST) APIs to obtain various state information about

the operation of a software product in hierarchically structured form such as JavaScript Object Notation (JSON), Extensible Markup Language (XML).

The method disclosed here defines a simple, generic means to "query" JSON, XML, or other hierarchically structured data to extract subsets of interest in a standard "rows and columns" result set format. In accordance with the method, a Hierarchical Query Language (HQL) is employed to define such queries.

There are two types of queries supported by the method: a Simple HQL and a Parameterized HQL.

Simple HQL queries are analogous to simple Structured Query Language (SQL) queries in which all literal values are supplied in the query text itself.

On the other hand, parameterized HQL queries are analogous to parameterized SQL queries, in which one or more literal values are replaced by parameter markers (? in SQL, ^ in HQL) to be substituted at query time. This allows a single query to be written that can be customized by parameter substitution at runtime, for example to query a single, specific record by its ID from a large set of records.

The examples given below assume that the data being queried comes from a REST

API, is in JSON format, and contains monitoring data, but these restrictions are for purposes of illustration only and do not serve to limit the scope of the method to only REST APIs and/or only JSON format data and/or only monitoring data.

Simple HQL Query

The basic elements of a simple HQL query are as follows.


1. (Optional) Data source "connection" string: A string indicating how to connect to

the data source. In the case of a REST API this can be a URL prefix that points to the server hosting the REST API. If authentication is required, then username and password strings can also be included, either in the connection string as parameters, or in separate strings (like configuring a JDBC connection).


2. (Required) Data source locator string: A string indicating how to obtain the data

"document" being queried. In the case of a REST API this can be a URL suffix that points to the specific REST API whose invocation returns the hierarchical data document.


3. (Optional) Parse path. A sequence (such as comma-separated names, an ordered list of names, or an array of names) of node names in the hierarchical source document, starting immediately under the root (or starting at the root if the root is a named node in the given document), that must be traversed in order to reach the subtree of the document containing the data of interest. The parse path elements thus define a specific path from the root of the document tree to the root of the subtree of interest.

1


Page 02 of 3

If the parse path is omitte...