1. Field of the Invention
The present invention relates to the field of data processing. More specifically, the present invention relates to the storage of semi-structured data.
2. Background Information
Increasingly, because of its richness in functions and extensibility, information pages, such as web pages, are being constructed using the extensible style language (XSL) and semi-structured data, such as extensible markup language (XML) encoded data.
“Semi-structured data” refers to data that has structure, but where the contents of particular structural elements need not be consistent. To facilitate this characteristic, data are “self-describing.” For example, in a “person” application, a person can be validly defined by semi-structured data with only a subset of all possible data associated with a person, e.g., by only a last name and a telephone number, or a first name, last name, and address, or some other combinations. Or, a person may be defined with additional data not previously seen, such as an employer name, an employer address, and an employer telephone number. Thus, each semi-structured “person” definition may vary.
“XML” is one example of a language for representing semi-structured data. XML is a subset of the Standard Generalized Markup Language (SGML), a system promulgated by the International Standards Organization (ISO) for organizing and tagging elements of a document. Interpretation of the XML tags, however, is left to an interpreter. Thus, XML is adaptable to a wide variety of purposes. In particular, since XML is based on plain text, and therefore, XML based documents can be received and processed by many different computing platforms, such as by a platform-independent browser or other networked application programs.
“Structured data,” in contrast, refers to data formats such as those used for databases, spreadsheets, address books, and so forth, where in each case, the data format is well-defined by a schema and essentially inflexible. For example, in the database context, a database can be defined to store data according to some data-storage requirements. The storage requirements, e.g., the schema or nature of valid input, are known in advance, and the database is defined according to the structure of the potential input data. If the database were storing information about person, such as first name, last name, address, telephone number, and employer, every person record in the database would have space allocated for the information being tracked. Hence, the database is structured.
An example of a structured database is the relation database, also referred to as SQL database, where SQL is the name of its query language, Structured Query Language. In addition to being “inflexible,” unlike semi-structured data, SQL databases are also platform dependent. Nevertheless, because of its availability as well as robustness, recent research has turned towards using structured databases, such as a SQL database, to store and retrieve information defined by semi-structured data.
One significant issue, however, is how to convert from semi-structured data, such as XML encoded data, to structured data storage, such as a SQL database. Towards this end, various approaches have been proposed. For example, see Florescu et al., A Performance Evaluation of Alternative Mapping Schemes for Storing XML Data in a Relational Database, Rapport de Recherche No. 3680, INRIA, Rocquencourt, France (May 1999), discusses techniques and issues related to using directed graphs to represent semi-structured data. And, Shanmugasundaram et al, Relational Databases for Querying XML documents: Limitations and Opportunities, Proceedings of the 25th VLDB Conference, Edinburgh, Scotland (1999), discusses using XML document type descriptors (DTDs) to convert XML documents to relational tuples.
A significant limitation of these and other current conversion approaches is that mapping between structured and semi-structured data formats is by way of applying a fixed set of “rules” to perform the mapping. That is, in each of the these techniques, one and only one mapping is possible. For a given semi-structured input, the conversion rules control conversion into corresponding structured database output. The conversion is not flexible.
Thus, a more flexible approach to handling semi-structured data in a structured manner is desired.
In accordance with a first aspect of the present invention, a mapper generates a structured organization to store a collection of semi-structured data. Collaterally, the mapper also generates a description of how the semi-structured data are stored under the structured organization.
In accordance with a second aspect of the present invention, a mapper generates a semi-structured data organization for a collection of structured data. In like manner, the mapper also collaterally generates a description of correspondence between the semi-structured data organization and the structured data.
The present invention will be described by way of exemplary embodiments, but not limitations, illustrated in the accompanying drawings in which like references denote similar elements, and in which:
a-2b illustrate semi-structure data and its logical representation, in accordance with one embodiment;
a-6b illustrate an example semi-structure data and its logical representation;
a-12c illustrate an example pre-processing of an information page;
In the following description, various aspects of the present invention will be described. However, it will be apparent to those skilled in the art that the present invention may be practiced with only some or all aspects of the present invention. For purposes of explanation, specific numbers, materials and configurations are set forth in order to provide a thorough understanding of the present invention. However, it will also be apparent to one skilled in the art that the present invention may be practiced without the specific details. In other instances, well known features are omitted or simplified in order not to obscure the present invention.
Parts of the description will be presented using terms such as tables, keys, identifiers and so forth, commonly employed by those skilled in the art to convey the substance of their work to others skilled in the art. Parts of the description will be presented in terms of operations performed by a computer system, using terms such as parsing, accessing, retrieving, and so forth. As well understood by those skilled in the art, these quantities take the form of electrical, magnetic, or optical signals capable of being stored, transferred, combined, and otherwise manipulated through mechanical and electrical components of a digital system; and the term digital system include general purpose as well as special purpose data processing machines, systems, and the like, that are standalone, adjunct or embedded.
Various operations will be described as multiple discreet steps performed in turn in a manner that is most helpful in understanding the present invention, however, the order of description should not be construed as to imply that these operations are necessarily order dependent, in particular, the order the operations are presented. Furthermore, the phrase “in one embodiment” will be used repeatedly, however the phrase does not necessarily refer to the same embodiment, although it may.
Referring now to
a-2b illustrate semi-structured data and its logical representation, in accordance with one embodiment. As illustrated, semi-structured data 54′ includes a number of entities or data elements, each delineated by a pair of tags, e.g. entity A by tags <entity A> and </entity A>, entity B by tags <entity B> and </entity B>, and so forth. Some entities, like entities F and H have multiple instantiations. The entities/instantiations have an hierarchical relationship to each other; and may be logically represented by tree structure 60, having corresponding number of nodes, one for each entity/instantiation, and edges interconnecting the nodes whose represented entities/instantiations are direct ancestors/descendants of each other, as shown.
Entity A is said to be the parent entity of entities B, E, G and H. Entities B, E, G and H are said to be the children entities of entity A. Similarly, entity B is said to be the parent entities for entities C and D respectively, whereas entities E, G and the two instantiations of entity H are the parent entities for the two instantiations of entity F, and the two instantiations of entity I respectively. The two instantiations of entity F, and the two instantiations of entity I are said to be the children entities of E, G and the two instantiations of entity H respectively.
The two instantiations of entity F are said to be instantiated in two contexts, the context of entity E and the context of entity G. An example is a “phone” entity instantiated in the context of a “home” entity, and in the context of a “work” entity, i.e. in first case, a home phone number, and in the second case, a work phone number. The two instantiations of entities H and I are said to be repeated occurrences of the entities. An example is an “offspring” entity and its descendant “offspring name” entity, where each occurrence represents a son/daughter of a person.
At 86, mapper 50 selects a next node. At 88, mapper 50 determines if a new table should be created to store data associated with the entity. For the illustrated embodiment, a new table is created if the entity is one that has multiple instantiations, and a separate table has not been previously created. In alternate embodiments, other criterion or criteria may be employed to determine whether a new table is to be employed or not. If a new table is to be employed, the new table is created at 90. Otherwise 90 is skipped. At 92, a column is assigned to store the identifier/data associated with the entity. At 94, an entry is added to meta-table 56′ to keep track of where the identifier/data of the entity is stored. As described earlier, the entry includes parent node information, its own node information, the table name/identifier, the column location of the parent, and its own column location. For entity or parent entity with multiple instantiations requiring context differentiation, either an out-context identifier or an in-context identifier is also stored. Context identifiers may be formed in any manner. Where applicable, the entry also includes the applicable flags and annotations.
At 96, mapper 50 determines if it has processed all nodes. If additional nodes are to be processed, operations 86-94 are repeated. The operations are repeated as many times as it is necessary to process all nodes. In due course, all nodes are processed. At such time, the processing terminates.
a-6b illustrate an example semi-structured data 54″ and its logical representation. The example “directory” semi-structured data 54,” delineated by the <directory> and </directory> tags 100 and 150, as illustrated in
Note that in addition to the already mentioned advantage that mapper 50 may employ any one of a number approaches to generate structured organization 52, the present invention also allows a data base administrator (DBA) to manually intervene and adjust the generated structured organization 52. The DBA may easily maintain the correspondence by making like kind adjustments to the collaterally generated meta-table 56. Such adjustments are often desirable as in real life applications, by virtue of the number of entities involved, which is typically much larger than the illustrated examples (as they were kept small for ease of understanding), the generated structured organization 52 may not be as efficient as desired.
Referring now back to
Accordingly, the vast volume of legacy structured data may be employed in modern information pages using semi-structured data.
Thus, pre-processed information pages 302′ are now primed to readily respond to their requests.
Web server 702 and client computers 704 are intended to represent a broad range of server and computers known in the art. Network 706 is intended to represent a broad range of private and public networks, such as the Internet, constituted with networking equipment, such as routers, gateways, switches and the like.
Thus, a method and apparatus for storing semi-structured data in a structured manner, and for generating information pages using semi-structured data so stored have been described.
Tables 1-3 illustrate an example of structured data that is stored in a relational database. The relational database contains three tables: DEPARTMENTS table, EMPLOYEES table, and BUILDINGSDOCS table.
The DEPARTMENTS table contains one row for each department of an organization. As illustrated by Table 1, the organization has a finance and an engineering department. The DEPARTMENTS table contains two columns: name and contact. The name column contains the name of the department, and the contact column contains the employee identifier of the contact person for the department. For example, the first row of the table indicates that the department is “finance” and that the contact employee is “E1247.” The EMPLOYEES table contains a row for each employee in the organization. Each row includes seven columns: ID, Fname, Lname, Dept, Bldg, Office, and Manager. The ID column uniquely identifies the employee, the Fname column contains the first name of the employee, the Lname column contains the last name of the employee, the Dept column identifies the employee's department, the Bldg column identifies the building in which the employee is located, the Office column identifies the employee's office within the building, and the Manager column identifies the employee's manager. The Dept column contains one of the values from the Name column of the DEPARTMENTS table. The BUILDINGSDOCS table contains a row for each office within each building of the organization. The BUILDINGSDOCS table contains four columns: Building, Office, Phone, and MaintContact. The Building column identifies a building, the Office column identifies an office within the building, the Phone column contains the phone number associated with that office, and the MaintContact column identifies the employee who is the maintenance contact for the office. The combination of the Building and Office columns uniquely identifies each row. The Bldg and Office columns of the EMPLOYEES table identifies a row within the BUILDINGSDOCS table.
Table 4 is an example of semi-structured data stored as an XML document.
The XML document includes the root element <deptlist> that has a name attribute and that contains a <dept> element corresponding to each department within an organization. Each <dept> element contains an <employee> element for each employee within the department. Each <employee> element contains a <name> element and optionally an <office> element. The <name> element includes a <first> element and <last> element. The <office> element includes a phone attribute. The schema of an XML document may be represented by an XML data type definition (“DTD”) of the document.
The mapping technique is particularly useful in situations where a legacy database, such as the example database of Tables 1-3, is to be accessed using queries designed for semi-structured data, such as the example of Table 4. The XML schema may be previously defined and many different applications for accessing data based on that XML schema may have also been defined. For example, one such application may be a query of the data. An example query for semi-structured data may be an XML transform that is designed to input data in XML format and output a subset of the data in XML format. For example, a query for the database of Tables 1-3 may be a request to list the ID of each employee in the “Finance” department. The subset of that data that is output corresponds to the results of the query represented by the XSL transform. One skilled in the art would appreciate that queries can be represented in other formats such as XML-QL. When a legacy database is to be accessed, the data is not stored using XML format. Thus, in one embodiment, a query system inputs a semi-structured query and uses a mapping table to generate a structured query, such as an SQL query, that is appropriate for accessing the legacy database. The mapping technique for generating that mapping table is described in the following.
Table 5 is a portion of the mapping table generated in accordance with the mapping technique that maps the XML schema of Table 4 to the legacy database of Tables 1-3.
The mapping table contains one row for each parent-child relationship of the XML schema. As shown in
The query system maps the selections within the semi-structured query to selections within a structured query. The following illustrates the basic format of that mapping when the structured query is an SQL format.
The TABLE, CKEY, and PKEY parameters are replaced by the corresponding values from the row in the mapping table for the parent-child relationships specified by the selection. In other words, this query will find all the children given the key for the parent. The following illustrates the format of the
mapping when the query represents the identification of the idea of all employees within the finance department.
The query system also allows chaining of keys to effectively navigate through the hierarchy defined by the semi-structured data. The query system uses the joint concept of relationship databases to effect this chaining of keys. The following illustrates chaining:
The TABLE1, PKEY1, and CKEY1 parameters are derived from the first parent-child relationship in the chain, and the TABLE2, PKEY2, and CKEY2 parameters are derived from the second parent-child relationship in the chain. The child key associated with the first parent-child relationship matches the parent key associated with the second parent-child relationship. The following is an example of the chaining to identify the building for the employees of the finance department.
In one embodiment, the mapping table also contains the value rows corresponding to each leaf node, that is a node that is not a parent node. The leaf nodes of
The “A/E” column identifies whether the row is an attribute or element; the “Name” column identifies the name of the element and attributes; the “Table” column identifies the legacy table; the “Key” column identifies the key for that table; and the “Value” column identifies the name of the column where the value is stored.
Epilogue
While the present invention has been described in terms of the above-illustrated embodiments, those skilled in the art will recognize that the invention is not limited to the embodiments described. The present invention can be practiced with modification and alteration within the spirit and scope of the appended claims. The description is thus to be regarded as illustrative instead of restrictive on the present invention.
This application is a divisional of U.S. patent application Ser. No. 09/921,010, entitled “METHOD AND APPARATUS FOR STORING SEMI-STRUCTURED DATA IN A STRUCTURED MANNER,” filed on Aug. 1, 2001, now U.S. Pat. No. 7,124,144, which is a continuation-in-part of U.S. patent application Ser. No. 09/517,131, entitled “METHOD AND APPARATUS FOR STORING SEMI-STRUCTURED DATA IN A STRUCTURED MANNER” filed on Mar. 2, 2000, now U.S. Pat. No. 6,581,062; This application is also related to International Application No. PCT/US01/06755, entitled “METHOD AND APPARATUS FOR STORING SEMI-STRUCTURED DATA IN A STRUCTURED MANNER” filed on Mar. 2, 2001; U.S. patent application Ser. No. 09/517,468, entitled “METHOD AND APPARATUS FOR GENERATING INFORMATION PAGES USING SEMI-STRUCTURED DATA STORED IN A STRUCTURED MANNER” filed on Mar. 2, 2000, now U.S. Pat. No. 6,449,620; U.S. patent application Ser. No. 09/718,228, entitled “TECHNIQUES FOR ENCAPSULATING A QUERY DEFINITION” filed Nov. 21, 2000, now U.S. Pat. No. 7,152,062; and U.S. patent application Ser. No. 09/921,446, entitled “NESTED CONDITIONAL RELATIONS (NCR) MODEL AND ALGEBRA” filed Aug. 1, 2001, which are hereby incorporated by reference in their entirety.
Number | Name | Date | Kind |
---|---|---|---|
4014004 | Fuller | Mar 1977 | A |
4947320 | Crus et al. | Aug 1990 | A |
5421001 | Methe | May 1995 | A |
5572583 | Wheeler et al. | Nov 1996 | A |
5826258 | Gupta et al. | Oct 1998 | A |
5852825 | Winslow | Dec 1998 | A |
5900870 | Malone et al. | May 1999 | A |
5909225 | Schinnerer et al. | Jun 1999 | A |
5913214 | Madnick et al. | Jun 1999 | A |
5956720 | Fernandez et al. | Sep 1999 | A |
5970490 | Morgenstern | Oct 1999 | A |
5983232 | Zhang | Nov 1999 | A |
6012098 | Bayeh et al. | Jan 2000 | A |
6016497 | Suver | Jan 2000 | A |
6052693 | Smith et al. | Apr 2000 | A |
6076087 | Suciu | Jun 2000 | A |
6094649 | Bowen et al. | Jul 2000 | A |
6154738 | Call | Nov 2000 | A |
6263332 | Nasr et al. | Jul 2001 | B1 |
6269368 | Diamond | Jul 2001 | B1 |
6279006 | Shigemi et al. | Aug 2001 | B1 |
6308179 | Petersen et al. | Oct 2001 | B1 |
6339776 | Dayani-Fard et al. | Jan 2002 | B2 |
6343287 | Kumar et al. | Jan 2002 | B1 |
6356906 | Lippert et al. | Mar 2002 | B1 |
6356920 | Vandersluis | Mar 2002 | B1 |
6389429 | Kane et al. | May 2002 | B1 |
6418448 | Sarkar | Jul 2002 | B1 |
6449620 | Draper et al. | Sep 2002 | B1 |
6487566 | Sundaresan | Nov 2002 | B1 |
6507856 | Chen et al. | Jan 2003 | B1 |
6507857 | Yalcinalp | Jan 2003 | B1 |
6516321 | De La Huerga | Feb 2003 | B1 |
6535896 | Britton et al. | Mar 2003 | B2 |
6539378 | Rajaraman et al. | Mar 2003 | B2 |
6581062 | Draper et al. | Jun 2003 | B1 |
6594653 | Colby et al. | Jul 2003 | B2 |
6601071 | Bowker et al. | Jul 2003 | B1 |
6604100 | Fernandez et al. | Aug 2003 | B1 |
6678269 | Michels et al. | Jan 2004 | B1 |
6697818 | Li et al. | Feb 2004 | B2 |
6714939 | Saldanha et al. | Mar 2004 | B2 |
6754648 | Fittges et al. | Jun 2004 | B1 |
6799184 | Bhatt et al. | Sep 2004 | B2 |
6826553 | DaCosta et al. | Nov 2004 | B1 |
7031956 | Lee et al. | Apr 2006 | B1 |
7124144 | Christianson et al. | Oct 2006 | B2 |
7152062 | Draper et al. | Dec 2006 | B1 |
7174327 | Chau et al. | Feb 2007 | B2 |
20020120630 | Christianson et al. | Aug 2002 | A1 |
20020133497 | Draper | Sep 2002 | A1 |
20050091188 | Pal et al. | Apr 2005 | A1 |
Number | Date | Country |
---|---|---|
WO 0117286 | Mar 2001 | WO |
Number | Date | Country | |
---|---|---|---|
20060265410 A1 | Nov 2006 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 09921010 | Aug 2001 | US |
Child | 11493786 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 09517131 | Mar 2000 | US |
Child | 09921010 | US |