Creating concise and re-useable queries over complex data
AssigneeSemmle Limited
InventorsMathieu Verbaere, Oege De Moor, Elnar Hajiyev
Life of this patent
Estimating the term…
Abstract
A novel system, computer readable storage medium and method for creating re-usable queries over complex data including hierarchies, trees and graphs is described. This is achieved by an object-oriented query language, where a class is a logical property of a data item, and inheritance is implication between such properties. Virtual method calls execute all relevant method implementations in most specific classes. Expressions can be multi-valued, thus avoiding the need for naming intermediate results. All constructs closely follow the syntax of mainstream object-oriented languages like Java.
Claims20
A process for creating re-usable queries over complex data, the process comprising:
- defining a re-usable object-oriented query language with object-oriented classes treated as logical properties, wherein each logical property is defined by one or more specified classes of at least one complex data item;
- relating inheritance, used to form new class with the specified classes, to the logical properties along with a plurality of virtual method calls that execute all applicable method implementations in at least one of the specified classes;
- and
- dispatching on the logical properties to choose at least one most specific implementation of an operation, wherein a most specific implementation is in a class where no subclasses define a same method, wherein the dispatching on the logical properties further includes:
- defining a named predicate p as predicate p(T1x1, . . . , Tnxn) {formula} for each one of the applicable method implementations, wherein the named predicate p has variables x1, . . . , xn. so as to restrict a range of a relation, which contains tuples (x1, . . . xn) where each xi has a type T;
- testing a receiver against each relevant type and choosing the applicable method implementations, wherein testing a type of the receiver is achieved by invoking a named constructor for each class defining a method of a relevant signature, regardless of static types;
- implementing queries by translating actual or possibly recursive object-oriented queries to a query language using for each method and constructor of each class, a first special variable that holds a value that is a member of the class, and for each method that is not a predicate, a second special variable that holds a result of a method;
- and
- rending queries concise by at least using multi-valued operations to avoid naming intermediate results in nested method calls.
A computer program product for creating re-usable queries over complex data, the computer program product comprising:
- a non-transitory computer readable storage medium, the non-transitory computer readable storage medium storing software programming instructions capable of performing with a processor programming code to carry out:
- defining a re-usable object-oriented query language with object-oriented classes treated as logical properties, wherein each logical property is defined by one or more specified classes of at least one complex data item;
- relating inheritance, used to form new class with the specified classes, to the logical properties along with a plurality of virtual method calls that execute all applicable method implementations in at least one of the specified classes;
- and
- dispatching on the logical properties to choose at least one most specific implementation of an operation, wherein a most specific implementation is in a class where no subclasses define a same method, wherein the dispatching on the logical properties further includes:
- defining a named predicate p as predicate p(T1x1, . . . , Tnxn) {formula} for each one of the applicable method implementations, wherein the named predicate p has variables x1, . . . , xn so as to restrict a range of a relation, which contains tuples (x1, . . . , xn) where each xi has a type Ti;
- testing a receiver against each relevant type and choosing the applicable method implementations, wherein testing a type of the receiver is achieved by invoking a named constructor for each class defining a method of a relevant signature, regardless of static types;
- implementing queries by translating actual or possibly recursive object-oriented queries to a query language using for each method and constructor of each class, a first special variable that holds a value that is a member of the class, and for each method that is not a predicate, a second special variable that holds a result of a method;
- and
- rending queries concise by at least using multi-valued operations to avoid naming intermediate results in nested method calls.
An information processing system for creating re-usable queries over complex data, the system comprising:
- a computer memory capable of storing machine instructions;
- and
- a processor in communication with said computer memory, said processor configured to access the memory, the processor performing
- a re-usable object-oriented query language defined with object-oriented classes treated as logical properties, wherein each logical property is defined by one or more specified classes of at least one complex data item;
- a new class formed by relating inheritance with the specified classes, to the logical properties along with a plurality of virtual method calls that execute all applicable method implementations in at least one of the specified classes;
- and
- means for dispatching on the logical properties to choose at least one of a most specific implementation of an operation, wherein a most specific implementation is in class where no subclasses define a same method, wherein the dispatching on the logical properties further includes:
- means for defining a named predicate p as predicate p(T1x1, . . . Tnxn) {formula} for each one of the applicable method implementations, wherein the named predicate p has variables x1, . . . xn. so as to restrict a range of a relation, which contains tuples (x1, . . . , xn) where each x1 has a type Ti;
- means for testing a receiver against each relevant type and choosing the applicable method implementations, wherein testing a type of the receiver is achieved by invoking a named constructor for each class defining a method of a relevant signature, regardless of static types;
- means for implementing queries by translating actual or possibly recursive object-oriented queries to a query language using for each method and constructor of each class, a first special variable that holds a value that is a member of the class, and for each method that is not a predicate, a second special variable that holds a result of a method;
- and
- means for rending queries concise by at least using multi-valued operations to avoid naming intermediate results in nested method calls.
Dependencies are inferred from the claim text.