Patent Document ID: 8150866
Application ID: 12349761

Base Claim:
1. 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(T 1 x 1 , . . . , T n x n ) {formula} for each one of the applicable method implementations, wherein the named predicate p has variables x 1 , . . . , x n so as to restrict a range of a relation, which contains tuples (x 1 , . . . , x n ) where each x i has a type T i ; and 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 pure Datalog 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 at least one of: mapping each constructor to a named characteristic predicate of its class, which tests whether a value belongs to the class, by taking a logical conjunction of characteristic predicates of all superclasses and a property specified in the constructor; mapping instance of tests and cast expressions to calls of such characteristic predicates; and mapping expressions including nested method calls to a conjunction of predicate calls, with a new named variable denoting an intermediate result of each method call.

---

Claim 5:
5. The process as set forth in claim 1 , wherein at least one complex data item is at least one of: a data item in a hierarchy; a tree; and a graph.