Hierarchical script database and database applications
View Patent ↗A tree database includes nodes organized as one or more tree data structures. The nodes contain both function and data properties in the form of script files in an interpreter environment. The database is event-driven. Responsive to an event, a node can spawn a new child node in the tree, which contains a data item associated with the event, enabling the tree database to grow as events and data arrive. Query events, initialization, and purging are also supported. Example applications of a communication appliance, an educational quiz, and a music database are provided.
1 . A method comprising:
executing a first script, by a first interpreter, of a first function property of a parent vertex in a tree data structure, wherein executing the first script of the first function property comprises:
receiving a first event from an interface indicating insertion of a data item identified by the first event into the tree data structure;
instantiating a child vertex of the tree data structure to hold the data item;
incorporating the data item as a data property in the child vertex; and
passing identifiers of the child vertex and the parent vertex to a kernel function;
wherein the tree data structure has one root vertex, and every other vertex of the tree data structure has a corresponding unique parent vertex traceable to the root vertex;
using the kernel function:
adding metadata to the parent vertex and the child vertex to link the parent vertex and the child vertex within the tree data structure; and
executing a second script, by a second interpreter, of a second function property of the parent vertex, distinct from the first function property, wherein executing the second script of the second function property comprises:
receiving a second event from the interface indicating a query on the tree data structure;
reading the data item from the linked child vertex; and
responding to the query.
2 . The method of claim 1 , further comprising:
incorporating a child script in the child vertex.
3 . The method of claim 2 , further comprising:
storing the data item and the child script in distinct files.
4 . The method of claim 1 , further comprising:
maintaining data of a communication appliance in the tree data structure.
5 . The method of claim 4 , wherein the receiving of the event comprises receiving an incoming communication or a request to initiate an outgoing communication.
6 . The method of claim 4 , further comprising:
receiving a third event corresponding to a search function; and
responsive to the second event:
traversing the tree data structure to obtain a search result; and
transmitting the search result.
7 . The method of claim 1 , wherein the tree data structure maintains data of a document.
8 . The method of claim 7 , wherein:
the tree data structure is a first tree data structure; and
the method further comprises:
receiving a third event corresponding to a query on the first tree data structure; and
responsive to the third event, following a link from the first tree data structure to a second tree data structure representing a reference linked to the document.
9 . The method of claim 7 , wherein the first or second event comprises a notification of a first external occurrence to which the document is applicable, and the method further comprises:
responsive to the notification, initiating a second external occurrence.
10 . A method of updating a tree database comprising a tree data structure comprising a plurality of vertices, in which portions of a document having associated entities are stored at respective ones of the vertices, the method comprising:
receiving a first event at a first event handler vertex among the vertices in the tree data structure, wherein the first event handler vertex comprises a first script, and the first event is accompanied by a data item which is one or more of: a definition of a term in the document, an identification of a new entity to be added to the associated entities, or a notification of an external occurrence to be logged with the document;
adding a new vertex to the tree database as a child of the first event handler vertex, the new vertex comprising a second script in which the data item is defined as a data property, wherein adding the new vertex comprises executing the first script by a first interpreter; and
updating metadata of the event handler vertex to link the first event handler vertex to the new vertex;
receiving a second event at a second event handler vertex comprising a third script, wherein the first and second event handler vertices are in different branches of the tree data structure; and
responsive to the received second event, executing the third script by a second interpreter.
11 . One or more non-transitory computer-readable storage media storing:
a first script, comprising first instructions, of a first function property of a parent vertex in a tree data structure; wherein execution of the first script of the first function property, by a first interpreter on one or more hardware processors, causes the one or more hardware processors to:
receive a first event from an interface indicating insertion of a data item identified by the first event into the tree data structure;
instantiate a child vertex of the tree data structure to hold the data item;
incorporate the data item as a data property in the child vertex; and
pass identifiers of the child vertex and the parent vertex to a kernel function;
wherein the tree data structure has one root vertex, and every other vertex of the tree data structure has a corresponding unique parent vertex traceable to the root vertex;
a kernel function comprising second instructions, wherein execution of the second instructions on the one or more hardware processors causes the one or more hardware processors to:
add metadata to the parent vertex and the child vertex to link the parent vertex and the child vertex within the tree data structure; and
a second script, comprising third instructions, of a second function property of the parent vertex, distinct from the first function property; wherein execution of the second script of the second function property, by a second interpreter on the one or more hardware processors, causes the one or more hardware processors to:
receive a second event from the interface indicating a query on the tree data structure;
read the data item from the linked child vertex; and
respond to the query.
12 . The one or more non-transitory computer-readable storage media of claim 11 , further storing fourth instructions which, when executed, cause maintenance of data of a communication appliance in the tree data structure.
13 . The one or more non-transitory computer-readable storage media of claim 12 , wherein the receiving of the first event comprises receiving an incoming communication or a request to initiate an outgoing communication.
14 . The one or more non-transitory computer-readable storage media of claim 11 , further storing fifth instructions, wherein the tree data structure is a first tree data structure maintaining data of a document, and wherein execution of the fifth instructions causes:
a third event to be received, the third event corresponding to a query on the tree data structure; and
responsive to the third event, a link to be followed from the tree data structure to another tree data structure representing a reference linked to the document.