Pattern Matching Query System for Relational Data
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current query languages for relational databases, such as SQL, require a special interface and lack transparency, especially for recursive queries, and do not support pattern matching, which is desirable for querying relational data in a tabular format without dependencies on SQL or other query languages.
Innovation Solution
A system and methods for querying relational data collections by matching records to query patterns using PredicateExpressions, executed as JavaScript objects, allowing for the implementation of fundamental queries in GenericTabularRepresentation, including chained self-joins and relationship primitives, without relying on SQL or other query languages.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If SQL is used to query relational databases, then query capability is provided, but a special interface is required and transparency is reduced
Solution Approach 1:
The patent extracts the query capability from the SQL language framework and relocates it into the JavaScript language itself through pattern matching. This eliminates the need for a separate SQL interface and brings query functionality directly into the application code, improving transparency while reducing interface complexity.
Solution Approach 2:
The patent introduces pattern matching as an intermediary mechanism between JavaScript code and relational database queries. Instead of requiring SQL syntax as an intermediary language, pattern matching serves as the bridge, allowing direct querying within JavaScript while maintaining compatibility with relational data structures.
2Adaptability or versatility
If pattern matching is used to query data, then transparency and simplicity are improved, but dependency on SQL or special query languages is eliminated
Solution Approach 1:
The patent makes JavaScript objects universal by enabling them to serve both as application logic containers and as query expressions. The same JavaScript language features (objects, patterns, matching) are used for both business logic and data querying, eliminating the need for separate query languages and improving adaptability.
Solution Approach 2:
Instead of making data conform to SQL query syntax, the patent inverts the approach by making SQL-like queries conform to JavaScript object patterns. This reversal allows pattern matching to work with relational data structures without requiring the data to be transformed into SQL format, achieving query language independence.
3Productivity
If recursive queries are implemented in SQL, then complex data relationships can be queried, but transparency is reduced and complexity increases
Solution Approach 1:
The patent enables JavaScript objects to serve themselves in recursive queries by allowing an object to contain and execute its own query patterns. This self-service capability allows complex recursive relationships to be expressed naturally within the JavaScript language structure, improving query expressiveness while maintaining transparency through familiar syntax.
Data Source
AI summary
Disclosed is a method for querying by pattern matching a relational data store, including a collection of records having a preset number of attributes, wherein the representation of the content of a structured or unstructured data source also encodes the structure of the data source, and including these steps:providing at least one query comprising at least a find- and a where-clause, wherein the where-clause comprises one or more query patterns, and the find-clause specifies a subset of attributes optionally including aliases thereof; executing the query by:applying predicates in the one or more query patterns to identify a subset of matching or non-matching records;forming the intersection of the two or more subsets of records for two or more patterns;in accordance with the find-clause, selecting specified attributes and applying any aliases; andthereby identifying the subset of records satisfying constraints expressed in the query patterns.

