Claims
- 1. A method for managing data in a database system, the method comprising the steps of:
determining, within a database system, an appropriate database representation for storing within said database system documents that conform to an XML schema; generating mapping data that indicates correlations between elements of said XML schema and elements of said appropriate database representation.
- 2. The method of claim 1 wherein:
the step of determining an appropriate database representation includes determining, based on user-specified information, that an element of said XML schema is to be mapped to a single CLOB without generating other object types within said database system for said element; and the step of generating mapping data includes generating data that maps said element to said single CLOB.
- 3. The method of claim 2 further comprising the step of receiving said user-specified information in the form of user-specified annotations to said XML schema.
- 4. The method of claim 1 wherein:
the step of determining an appropriate database representation includes determining, based on user-specified information, that a first set of subelements of an element of said XML schema is to be mapped to a single CLOB; and the step of generating mapping data includes generating data that maps said first set of subelements to said single CLOB, and generating data that maps a second set of subelements of said element to one or more objects other than said CLOB.
- 5. The method of claim 1 wherein the step of determining an appropriate database representation includes mapping datatypes associated with elements in said XML schema to datatypes supported by said database system.
- 6. The method of claim 1 wherein the step of determining an appropriate database representation includes defining an SQL object type that includes attributes that correspond to elements in said XML schema.
- 7. The method of claim 5 wherein the step of mapping datatypes includes the steps of:
if a particular datatype associated with an element in said XML schema is associated with a first length, then mapping said particular datatype to a first database datatype; and if said particular datatype is associated with a second length, then mapping said particular datatype to a second database datatype, wherein the first database datatype is different than said second database datatype.
- 8. The method of claim 5 wherein the step of determining an appropriate database representation includes mapping a particular element of said XML schema to a collection type supported by the database system if the particular element is defined to have a maximum number of occurrences greater than one.
- 9. The method of claim 8 wherein the collection type is an array type, wherein the cardinality of the array type is selected based on the maximum number of occurrences specified for said particular database element.
- 10. The method of claim 1 wherein the step of constraint determining an appropriate database representation includes defining a constraint in said appropriate database representation based upon a constraint specified in said XML schema for an element of said XML schema.
- 11. The method of claim 10 wherein the step of defining a constraint includes defining a constraint from a set consisting of: a uniqueness constraint, a referential constraint, and a not null constraint.
- 12. The method of claim 1 wherein:
a first datatype is associated with an element in the XML schema; the XML schema specifies that said first datatype inherits from a second datatype; and the step of determining an appropriate database representation includes defining within said database system a subtype of an object type, wherein said object type corresponds to said second datatype.
- 13. The method of claim 1 wherein the step of determining appropriate database representation includes:
mapping a first set of elements in said XML schema to database structures that maintain each element separate in the first set separate from the other elements in the first set; and mapping a second set of elements in said XML schema to a database structure in which all elements in said second set of elements are combined as a single undifferentiated database element.
- 14. The method of claim 13 wherein the database system determines membership of said first set and membership of said second set based on directives associated with said XML schema.
- 15. The method of claim 13 wherein elements in the first set of elements are selected to be in said first set based on a likelihood that said elements will be accessed more frequently than the elements selected to be in said second set of elements.
- 16. The method of claim 1 wherein:
the steps of determining an appropriate database representation and generating mapping data are preformed as part of an XML schema registration operation that causes modifications within said database system; and the method further comprises the step of automatically removing all modifications caused by said XML schema registration operation in response to encountering a particular error during said XML schema registration operation.
- 17. The method of claim 1 wherein the step of determining an appropriate database representation includes determining how to break cycles in said XML schema.
- 18. The method of claim 1 wherein:
said XML schema includes a cycle involving a plurality of components; and the step of determining how to break cycles includes causing each component of the cyclic definition to holds pointers to all of its children components.
- 19. The method of claim 1 wherein the step of determining how to break cycles includes causing an entire cyclic definition to be mapped for storage as a single CLOB within the database system.
- 20. The method of claim 1 wherein the step of generating mapping data includes adding annotations to said XML schema, and storing said annotated XML schema within said database system.
- 21. The method of claim 1 further comprising the steps of:
creating structures within a database based on said appropriate database representation; and storing in said structures data from XML documents that conform to said XML schema.
- 22. The method of claim 21 wherein the step of storing data from XML documents includes the steps of:
receiving an XML document at said database system; identifying data, from said XML document, that is associated with individual elements of said XML schema; storing the data associated with individual elements at locations within said structures based on
the elements associated with the data, and the mapping data.
- 23. The method of claim 1 further comprising the step of validating, within said database system, said XML schema to determine whether the XML schema conforms to an XML schema for XML schemas.
- 24. The method of claim 1 wherein the step of determining is performed as part of an XML schema registration operation that is initiated in response to receiving, at said database server, said XML schema.
- 25. The method of claim 1 wherein the step of determining is performed as part of an XML schema registration operation that is initiated in response to receiving, at said database server, an XML document that conforms to said XML schema.
- 26. The method of claim 24 wherein:
the XML schema includes user-specified annotations that indicate how the database system should map at least one element of the XML schema; and at least a portion of the mapping data reflects said user-specified annotations.
- 27. A computer-readable medium carrying instructions for managing data in a database system, the instructions comprising instructions which, when executed by one or more processors, cause the processors to perform the steps of:
determining, within a database system, an appropriate database representation for storing within said database system documents that conform to an XML schema; generating mapping data that indicates correlations between elements of said XML schema and elements of said appropriate database representation.
- 28. The computer-readable medium of claim 27 wherein the step of determining an appropriate database representation includes mapping datatypes associated with elements in said XML schema to datatypes supported by said database system.
- 29. The computer-readable medium of claim 27 wherein the step of determining an appropriate database representation includes defining an SQL object type that includes attributes that correspond to elements in said XML schema.
- 30. The computer-readable medium of claim 28 wherein the step of mapping datatypes includes the steps of:
if a particular datatype associated with an element in said XML schema is associated with a first length, then mapping said particular datatype to a first database datatype; and if said particular datatype is associated with a second length, then mapping said particular datatype to a second database datatype, wherein the first database datatype is different than said second database datatype.
- 31. The computer-readable medium of claim 28 wherein the step of determining an appropriate database representation includes mapping a particular element of said XML schema to a collection type supported by the database system if the particular element is defined to have a maximum number of occurrences greater than one.
- 32. The computer-readable medium of claim 31 wherein the collection type is an array type, wherein the cardinality of the array type is selected based on the maximum number of occurrences specified for said particular database element.
- 33. The computer-readable medium of claim 27 wherein the step of constraint determining an appropriate database representation includes defining a constraint in said appropriate database representation based upon a constraint specified in said XML schema for an element of said XML schema.
- 34. The computer-readable medium of claim 33 wherein the step of defining a constraint includes defining a constraint from a set consisting of: a uniqueness constraint, a referential constraint, and a not null constraint.
- 35. The computer-readable medium of claim 27 wherein:
a first datatype is associated with an element in the XML schema; the XML schema specifies that said first datatype inherits from a second datatype; and the step of determining an appropriate database representation includes defining within said database system a subtype of an object type, wherein said object type corresponds to said second datatype.
- 36. The computer-readable medium of claim 27 wherein the step of determining appropriate database representation includes:
mapping a first set of elements in said XML schema to database structures that maintain each element separate in the first set separate from the other elements in the first set; and mapping a second set of elements in said XML schema to a database structure in which all elements in said second set of elements are combined as a single undifferentiated database element.
- 37. The computer-readable medium of claim 36 wherein the database system determines membership of said first set and membership of said second set based on directives associated with said XML schema.
- 38. The computer-readable medium of claim 36 wherein elements in the first set of elements are selected to be in said first set based on a likelihood that said elements will be accessed more frequently than the elements selected to be in said second set of elements.
- 39. The computer-readable medium of claim 27 wherein:
the steps of determining an appropriate database representation and generating mapping data are preformed as part of an XML schema registration operation that causes modifications within said database system; and the computer-readable medium further comprises instructions for performing the step of automatically removing all modifications caused by said XML schema registration operation in response to encountering a particular error during said XML schema registration operation.
- 40. The computer-readable medium of claim 27 wherein the step of determining an appropriate database representation includes determining how to break cycles in said XML schema.
- 41. The computer-readable medium of claim 27 wherein the step of generating mapping data includes adding annotations to said XML schema, and storing said annotated XML schema within said database system.
- 42. The computer-readable medium of claim 27 further comprising instructions for performing the steps of:
creating structures within a database based on said appropriate database representation; and storing in said structures data from XML documents that conform to said XML schema.
- 43. The computer-readable medium of claim 42 wherein the step of storing data from XML documents includes the steps of:
receiving an XML document at said database system; identifying data, from said XML document, that is associated with individual elements of said XML schema; storing the data associated with individual elements at locations within said structures based on the elements associated with the data, and the mapping data.
- 44. The computer-readable medium of claim 27 further comprising instructions for performing the step of validating, within said database system, said XML schema to determine whether the XML schema conforms to an XML schema for XML schemas.
- 45. The computer-readable medium of claim 27 wherein the step of determining is performed as part of an XML schema registration operation that is initiated in response to receiving, at said database server, said XML schema.
- 46. The computer-readable medium of claim 27 wherein the step of determining is performed as part of an XML schema registration operation that is initiated in response to receiving, at said database server, an XML document that conforms to said XML schema.
- 47. The computer-readable medium of claim 45 wherein:
the XML schema includes user-specified annotations that indicate how the database system should map at least one element of the XML schema; and at least a portion of the mapping data reflects said user-specified annotations.
RELATED APPLICATIONS
[0001] The present application claims priority from the following U.S. Provisional Patent Applications, the entire contents of which are incorporated herein by reference for all purposes:
[0002] U.S. Provisional Patent Application No. 60/326,052, filed on Sep. 28, 2001, entitled File Based Access Provided With a Database System, by Eric Sedlar and Viswanathan Krishnamurthy;
[0003] U.S. Provisional Patent Application No. 60/378,800, filed on May 7, 2002, entitled SQL Access to Data that Provides a File System Abstraction, by Nipun Agarwal, Ravi Murthy, Eric Sedlar, Sivasankaran Chandrasekar, Fei Ge, Syam Pannala, Neema Jalali and Muralidhar Krishnaprasad.
[0004] The present application is also related to the following U.S. patent applications, the entire contents of which are incorporated herein by reference for all purposes:
[0005] U.S. patent application Ser. No.______, filed on the equal day herewith, entitled OPERATORS FOR ACCESSING HIERARCHICAL DATA IN A RELATIONAL SYSTEM, by Nipun Agarwal, Ravi Murthy, Eric Sedlar, Sivasankaran Chandrasekar and Fei Ge (Attorney Docket No. 50277-1975);
[0006] U.S. patent application Ser. No.______, filed on the equal day herewith, entitled PROVIDING A CONSISTENT HIERARCHICAL ABSTRACTION OF RELATIONAL DATA, by Nipun Agarwal, Eric Sedlar, Ravi Murthy and Namit Jain (Attorney Docket No. 50277-1976);
[0007] U.S. patent application Ser. No.______, filed on the equal day herewith, entitled INDEXING TO EFFICIENTLY MANAGE VERSIONED DATA IN A DATABASE SYSTEM, by Nipun Agarwal, Eric Sedlar and Ravi Murthy (Attorney Docket No. 50277-1978);
[0008] U.S. patent application Ser. No.______, filed on the equal day herewith, entitled MECHANISMS FOR STORING CONTENT AND PROPERTIES OF HIERARCHICALLY ORGANIZED RESOURCES, by Ravi Murthy, Eric Sedlar, Nipun Agarwal, and Neema Jalali (Attorney Docket No. 50277-1979);
[0009] U.S. patent application Ser. No.______, filed on the equal day herewith, entitled MECHANISM FOR UNIFORM ACCESS CONTROL IN A DATABASE SYSTEM, by Ravi Murthy, Eric Sedlar, Nipun Agarwal, Sam Idicula, and Nicolas Montoya (Attorney Docket No. 50277-1980);
[0010] U.S. patent application Ser. No.______, filed on the equal day herewith, entitled LOADABLE UNITS FOR LAZY MANIFESTATION OF XML DOCUMENTS by Syam Pannala, Eric Sedlar, Bhushan Khaladkar, Ravi Murthy, Sivasankaran Chandrasekar, and Nipun Agarwal (Attorney Docket No. 50277-1981);
[0011] U.S. patent application Ser. No.______, filed on the equal day herewith, entitled MECHANISM TO EFFICIENTLY INDEX STRUCTURED DATA THAT PROVIDES HIERARCHICAL ACCESS IN A RELATIONAL DATABASE SYSTEM, by Neema Jalali, Eric Sedlar, Nipun Agarwal, and Ravi Murthy (Attorney Docket No. 50277-1982).
Provisional Applications (2)
|
Number |
Date |
Country |
|
60326052 |
Sep 2001 |
US |
|
60378800 |
May 2002 |
US |