Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
AU2007229358B2 - Apparatus and method for mapping relational data and metadata to XML - Google Patents
[go: Go Back, main page]

AU2007229358B2 - Apparatus and method for mapping relational data and metadata to XML - Google Patents

Apparatus and method for mapping relational data and metadata to XML Download PDF

Info

Publication number
AU2007229358B2
AU2007229358B2 AU2007229358A AU2007229358A AU2007229358B2 AU 2007229358 B2 AU2007229358 B2 AU 2007229358B2 AU 2007229358 A AU2007229358 A AU 2007229358A AU 2007229358 A AU2007229358 A AU 2007229358A AU 2007229358 B2 AU2007229358 B2 AU 2007229358B2
Authority
AU
Australia
Prior art keywords
relational database
xml documents
xml
query
content
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired
Application number
AU2007229358A
Other versions
AU2007229358A1 (en
Inventor
Viswanathan Krishnamurthy
Muralidhar Krishnaprasad
Ravi Murthy
Visar Nimani
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oracle International Corp
Original Assignee
Oracle International Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from AU2001290693A external-priority patent/AU2001290693B2/en
Application filed by Oracle International Corp filed Critical Oracle International Corp
Priority to AU2007229358A priority Critical patent/AU2007229358B2/en
Publication of AU2007229358A1 publication Critical patent/AU2007229358A1/en
Application granted granted Critical
Publication of AU2007229358B2 publication Critical patent/AU2007229358B2/en
Anticipated expiration legal-status Critical
Expired legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

APPARATUS AND METHOD FOR MAPPING RELATIONAL DATA AND METADATA TO XML c,) O RELATED APPLICATIONS; PRIORITY CLAIM This application is related to and claims domestic priority under 35 U.S.C. 119(e) 00 from prior U.S. Provisional Patent Application Ser. No. 60/230,878 filed on Sep. 7, 2000 C entitled "XML DATA STORAGE, QUERY REWRITES, VISUALIZATION, MAPPING C'1 AND REFERENCING", by inventors Muralidhar Krishnaprasad, Viswanathan Krishnamurthy, and Ravi Murthy, the entire disclosure of which is hereby incorporated by 0 reference as if fully set forth herein.
This application is related to U.S. patent application Ser. No. 09/949,020, filed together herewith, entitled "METHOD AND APPARATUS FOR XML VISUALIZATION OF A RELATIONAL DATABASE ANT) UNIVERSAL RESOURCE IDENTIFIERS TO DATABASE DATA AND METADATA," naming as inventors Muralidhar Krishnaprasad, Viswanathan Krishnamurthy, Ravi Murthy, the entire disclosure of which is hereby incorporated by reference as if fully set forth herein; and This application is related to U.S. patent application Ser. No. 09/948,998, filed together herewith, entitled "METHOD AND APPARATUS FOR FLEXIBLE STORAGE AND UNIFORM MANIPULATION OF XML DATA IN A RELATIONAL DATABASE SYSTEM", naming as inventors Muralidhar Krishnaprasad, Viswanathan Krishnamurthy, and Ravi Murthy, the entire disclosure of which is hereby incorporated by reference as if fully set forth herein.
FIELD OF THE INVENTION The present invention relates generally to relational databases and, more specifically, to mapping relational database data and metadata to XML data, and to providing XML data in response to XML queries.
BACKGROUND OF THE INVENTION Data within relational databases are typically accessed by sending commands to O database servers that manage the databases. Such commands must conform to a database r language supported by the database server. Structured Query Language (SQL) is a database language supported by many database systems.
00 5 Extensible Markup Language (XML) is a World Wide Web Consortium (W3C) aC< standard for representing data. Many applications are now being designed to expect input CN data in the form of XML documents. When the data provided to the applications comes r- from a relational database, the data typically has to be reformatted into an XML
O
0document.
When data is presented as an XML document, the recipient of the document must understand the structure of the XML document. When the XML document is generated from the result of a relational database query, the structure of resulting XML document will typically vary based on the nature of the query. Consequently, the process of transforming the relational data to an XML document, and generating data that indicates the structure of the XML document thus produced, can be cumbersome and inflexible.
Based on the foregoing, it is desirable to provide techniques for transforming relational data into XML in an intelligent, flexible and efficient manner.
SUMMARY OF THE INVENTION Techniques are provided for mapping metadata and data in relational databases to XML data. The XML data may then be provided in response to relational queries that access the underlying relational data.
According to certain embodiments of the invention, a mechanism is provided to allow the user to use a database query to retrieve data from a relational database in the form of XML documents by canonically mapping object relational data to XML data and canonically mapping object relational schemas to XML-Schemas. The mechanism causes the generation of XML-schema information for the XML documents.
XML Namespaces are used to augment the schema information, by mapping database metadata objects in different database schemas to different XML namespaces.
According to a feature of the invention, multiple XML documents are generated and URI references are used between the documents to link them together.
,l
C.)
O BRIEF DESCRIPTION OF THE DRAWINGS The present invention is illustrated by way of example, and not by way of 00 limitation, in the figures of the accompanying drawings and in which like reference Cc numerals refer to similar elements and in which: C FIG. 1A is a block diagram that illustrates a table; r- 10 FIG. 1B is a block diagram that illustrates a view that contains a SQL result set; and FIG. 2 depicts a computer upon which embodiments of the invention may be implemented.
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT Techniques are provided for mapping data and metadata from relational databases to XML. In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the present invention.
It will be apparent, however, to one skilled in the art that the present invention may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to avoid unnecessarily obscuring the present invention.
FUNCTIONAL OVERVIEW The results of a database query is herein referred to as a "SQL result set". When the SQL result set is converted into one or more XML documents, the converted result set is herein referred to as an "XML result set". The data in the relational database is herein referred to as "object relational data" and metadata that is associated with the object relational data is herein referred to as relational database schemas. A relational database schema is a collection of objects, herein referred to as "schema objects". Schema objects are logical structures that directly refer to the data in the relational database. Thus, schema objects include structures such as tables, views, clusters, indexes, etc.
In order that users may submit a query using relational database query language 0and receive a result set in the form of XML documents, a mechanism is provided for: 1) Mapping of object relational data from the relational database to XML form; 2) Mapping O of the relational database schemas to XML form; 3) Generating XML documents from the 5 object relational data and the relational database schemas.
The mechanism for generating XML documents as the result set from object 0o relational data and relational database schemas is based on a set of rules stored in the Cn relational database. Object relational data, either pre-defined or dynamically defined N during the processing of the database query, are mapped to corresponding XML data S 10 based on the set of rules. Such a mapping is herein referred to as "canonical mapping of 0 object relational data to XML form".
Similarly, relational database schemas are mapped to XML form by mapping the relational database schemas to their corresponding XML-Schemas. Such a mapping is based on a set of rules that are herein referred to as "canonical mapping of relational database schemas to XML-schemas." The canonical mapping of relational database schemas to XML-schemas is described in greater detail herein.
Further, generating an XML result set, generating XML documents from the SQL result set is based on a set of rules, as described in greater detail herein.
XML RESULT SET FROM SQL RESULT SET FIG. 1A is a block diagram that illustrates a table that is stored in a relational database. Table EMP has 3 columns, EMPNO, ENAME and SALARY. Each column of EMP contains a value for each of a plurality of rows of table EMP. However, for simplicity, FIG. 1A shows only 2 rows, namely, row 102 and row 104. In column EMPNO, row 102 contains the value "2100" and row 104 contains the value "2200".
Similarly, in column ENAME, row 102 contains the value "JOHN" and row 104 contains the value "MARY". In column SALARY, row 102 contains the value "55K" and row 104 contains the value As an example, assume that a user submits a relational database query to retrieve values from two of the columns, namely, EMPNO and ENAME from table EMP. An example of the relational database query is the following SQL statement, SELECT empno, ename FROM emp The syntax used in the preceding statement is merely illustrative. The actual syntax of SQL statements may vary from implementation to implementation. The present Sinvention is not limited to any particular syntax.
O FIG. 1B is a block diagram that illustrates a view that contains the SQL result set r- 5 of the SQL statement, SELECT empno, ename FROM emp. The SQL result set comprises only two of columns of table EMP. Thus, FIG. 1B shows only columns 00 EMPNO and ENAME. Even though the SQL result set comprises all the rows of value in
I)
rCc columns EMPNO and ENAME, for simplicity, only rows 110 and 112 (which C respectively contain values from rows 102 and 104) are shown in FIG. IB.
10 The SQL result set of FIG. I B can be converted into a corresponding XML result Sset based on the following rules, according to certain embodiments of the invention: 1) The XML result set is in the form of an XML document that begins with a ROWSET tag. The ROWSET tag indicates that the XML document comprises a set of row elements.
2) Each row of the SQL result set is converted to a corresponding ROW element in the XML document where the ROW element is indicated by a pair of ROW tags.
3) Each column within a given row of the SQL result set is converted to a corresponding COLUMN element that is embedded in the encompassing ROW element that in turn corresponds to the given row of the SQL result set. The name of the COLUMN tag is the name of the corresponding column in the SQL result set.
The ROWSET, and ROW tags may have varying monikers in various implementations of the invention. The present invention is not limited to any particular moniker for such tags. As for COLUMN tags, according to one embodiment, an aliasing mechanism is provided for changing names of the COLUMN tags.
To illustrate, the XML result set of the above example may appear like the following:
<ROWSET>
<ROW>
<EMPNO>21 OO</EMPNO> <ENAME>John</ENAME>
</ROW>
<EMPNO>2200</EMPNO> <ENAME>Mary</ENAME>
<ROW>
other column elements
</ROW>
other row elements
</ROWSET>
CN MAPPING OF OBJECT RELATIONAL DATA O An example of the canonical mapping of object relational data to XML form is as
O
follows: a) The mapping of object relational columns to XML elements: For example, referring to FIG. 1A, the XML result set of a SQL query to select 00 VB EMPNO and ENAME at the single row 102 would appear like the following: 10 <ROWSET>
<ROW>
0 <EMPNO>2100</EMPNO> <ENAME>John</ENAME>
</ROW>
</ROWSET>
The object relational columns EMPNO and ENAME are mapped to corresponding COLUMN elements in the XML result set. EMPNO and ENAME are embedded in the encompassing ROW element.
b) The mapping of object relational object types to XML elements with nested sub-elements containing the attributes of the object type: For the purpose of explanation, assume that a user-defined type called "Address_t" is previously created in the relational database. "Address_t" is a complex object type that comprises 3 scalar attributes, namely CITY, STATE and ZIP. Assume that there is a table in the relational database called Employeetable. Employeetable has 2 columns ENAME and ADDRESS. ENAME is of type "string" and ADDRESS is the user-defined type "Address_t". Further assume that columns ENAME and ADDRESS each contain only a single row of value, namely, employee name "John" and John's address, respectively.
A SQL query such as "SELECT FROM Employeetable" can produce a SQL result set that maps to the following XML result set, according to certain embodiments of the invention:
<ROWSET>
<ROW>
<ENAME>John</ENAME>
<ADDRESS>
<CITY>Redwood City</CITY> O <STATE>California</STATE> <ZIP>94065<ZIP>
</ADDRESS>
0 5 </ROW> O </ROWSET> The object relational column ADDRESS maps to an element with the same tag 00 name in the XML result set. The element ADDRESS, which is of type "address_t", has
V)
rn 10 attributes CITY, STATE and ZIP that are mapped to sub-elements of the element N ADDRESS. Each sub-element has the name of the attribute as its corresponding tag name in the XML result set.
Sc) The mapping of object relational collection types to XML lists: For the purpose of explanation, assume that a user-defined type called "Lineitems_t" is previously created in the relational database. "Lineitems_t" is a collection object type that comprises a plurality of collection items. Each collection item has an ID attribute that defines the positional value of the item within the collection. For example, assume that there is a table in the relational database called PurchaseOrder_table. PurchaseOrder_table has 2 columns PONO for purchase order number and LINEITEMS for a list of line-items. PONO is of type "number" and LINEITEMS is of type "Lineitems_t". Further assume that columns PONO and LINEITEMS each contain a single row of value, namely, purchase order number "101" and the collection of lineitems that is associated with purchase order number "101".
Assume that there is 1 item, namely, "books", in the collection of lineitems.
A SQL query such as "SELECT FROM PurchaseOrder table" produces a SQL result set that maps to the following XML result set:
<ROWSET>
<ROW>
<PONO>101</PONO>
<LINEITEMS>
<LINEITEMS T id <LINEITEMNAME>BOOKS</ LINEITEMNAME> <COST>$150</COST> </LINEITEMS T>
</LINEITEMS>
</ROW>
</ROWSET>
The object relational column LINEITEMS maps to an element with the same tag name in the XML result set Each collection item in LINEITEMS is mapped to a subelement that is embedded within the LINEITEMS element. Each collection item has the 0 collection type name as the tag name, namely, "LINEITEM_T'". Each collection item has r- 5 attributes LINEITEMNAME, and COST that are mapped to sub-elements that are embedded within the element LINEITEM T. Each sub-element has the name of the 00 attribute as its corresponding tag name, <LINEITEMNAME>, and <COST>.
Cr d) The mapping of object relational REF types to URI references: C1 Object relational REF columns are columns for storing object references to row objects contained in any object relational table. For the purpose of explanation, assume Sthat the relational database has a table called Employee_table. Employee_table has columns EMPTNO, ENAME and DEPTREF. EMPNO is of type "number" and assume that EMPNO has only one row of value ENAME is of type "string" and assume that ENAME has only one row of value "John". DEPTREF is of type "REF" and assume that DEPTREF has only one row of value, which is a reference to a row of value corresponding to DEPTNO 1001 in another table called Department_table. Assume that Department_table is in the schema SCOTT and has columns DEPTNO with value "1001"and DEPTNAME with value"SPORTS".
A SQL query such as"SELECT EMPNO, DEPTREF FROM Employee-table produces a SQL result set that maps to the following XML result set:
<ROWSET>
<ROW>
<DEPTREF>0344855FF4ABBCC3333</DEPTREF>
</ROW>
</ROWSET>
According to certain embodiments of the invention, the REF value in the DEPTREF column is converted to XML form for the XML result set by converting the object relational REF value into a binary value that is encoded in hexadecimal Thus, in the above XML result set"0344855FF4ABBCC3333"is the encoded HEX.
According to certain other embodiments of the invention, the REF value in the DEPTREF column is converted to XML form by converting the REF value into a Database Uniform Resource Indicator ("DBURI") reference. DBURI references are described in detail in U. S. patent application Ser. No. US 09/949,020, filed together herewith, entitled "METHOD AND APPARATUS FOR XML VISUALIZATION OF A RELATIONAL DATABASE AND UNIVERSAL RESOURCE IDENTIFIERS TO DATABASE DATA AND METADATA,"naming as inventors Muralidhar O Krishnaprasad, Viswanathan Krishnamurthy, Ravi Murthy.
Using the same example above, the DBURI reference may appear as, SCOTT/DEPARTMENT_TABLE/ROW [DEPTNO="1001"], where Deptno is the oO primary key information. Thus, the XML result set may appear as: (N <ROWSET>
<ROW>
<EMPNO> C <DEPTREF>/SCOTT/DEPARTMENT_TABLE/ROW[DEPTNO=" 1001 "]</DEPTREF>
</ROW>
<ROWSET>
According to yet other embodiments of the invention, an object identifier that uniquely identifies the object stored in the REF column can be used in creating the DBURI reference. Using the same example above, the DBURI reference may appear as, SCOTT/DEPARTMENTTABLE/ROW[SYS_NC_OID$="Oasfgd23gfin3423n"] Thus, the XML result set may appear as:
<ROWSET>
<ROW>
<DEPTREF>/Scott/Department_Table/Row[SYS_NCOID$="0asfgd23gfin3423n"]</DEPTREF
</ROW>
</ROWSET>
According to an embodiment of the invention, LOB values may be converted to DBUri references as well. For example, if there is a column in the department table called DEPT_PHOTO, which is a BLOB column, then a DBUri reference can be used to reference the BLOB data instead of in-lining the BLOB data in the XML document.
The XML result may appear as follows for the DEPT_PHOTO column:
<ROWSET>
<ROW>
<DEPTNO> 1001</DEPTNO> <DEPT_PHOTO>/SCOTT/DEPARTMENTTABLE/ROW[DEPTNO=1001]/ SDEPT_PHOTO/text0</DEPT_PHOTO>
S</ROW>
S</ROWSET>
0 0 The invention is not limited to generating DBUri references to LOBs and REFs.
lr- A DBUri reference can be generated to reference any piece of database data that need not be inlined in the visualized document. For example, nested tables, LONGs and other 00 datatypes may be converted to DBUri references instead of inlining the whole data inside 1 10 the visualized document. The DBUri reference can be generated by using the primary key CI information or ROWID of the row in the predicates of the Xpath expression.
"1 MAPPING OF RELATIONAL DATABASE SCHEMAS Relational database schemas are mapped to XML form by mapping the relational database schemas to their corresponding XML-Schemas. For example, referring to FIG.
1A, in order to produce the XML result set of a SQL query to select EMPNO and ENAME at the single row 102, an XML-Schema is generated. The XML-Schema defines the structure of the XML result set, which is in the form of an XML document. Thus, the XML-Schema that corresponds to the XML result set of a SQL query to select EMPNO and ENAME at the single row 102 is as follows, according to certain embodiments of the invention: <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"> <xsd:element name="ROWSET"> <xsd:complexType> <xsd:element name="ROW" minOccurs="0" maxOccurs="unbounded"> <xsd:complexType> <xsd:element name="EMPNO" type="xsd:integer" minOccurs="O"/> <xsd:element name-"ENAME" type="xsd:string" nullable="true" minOccurs="O"/> <xsd:complexType> </xsd:element> </xsd:complexType> </xsd:element> <xsd:schema> As can be seen from the above example, in addition to defining the structure of the XML result set (XML document), XML-Schemas also define the type of the data and constraints, if any, on the data. For example, the above sample XML-Schema indicates, among other things: 1) the URL, http://www.w3.org/2000/10/XMLSchema, for the nainespace that defines the standards that apply to all XMIL-Schemnas, 2) element ROWSET is of type "complex" and contains ROW elements, 3) the ROW elements are of type "complex" and can occur any number of times in the XMI document, 3) the element
C.)
r- 5 element ENAME, which is embedded in the ROW element, is of type "string". The nullable attribute indicates whether the element value can be NULL or not. "MinOccurs" 00 indicates the minimum number of occurrences of this element in the resultant document.
Alternatively, XML-Schemas can be "inlined" in its corresponding XM[L result set c-i (XMI document). For example, referring to FIG. IlA, the XMI result set of a SQL query r- 10 to select EMIPNO and ENAME at the single row 102, can have inlined in the XML result set its corresponding XMiL-Schema as follows, according to certain embodiments of the invention: <?xml version <DOCUMNENT xmlns:xsd="ht://www.w3 .orp-/2000/1 0/XIMLSchema"> <xsd: schema xmlns:xsd="htti)://www.w3 .org/2000/1 0/XMLSchema"> <xsd:element name="ROWSET"> <xsd:complexType> <xsd:element name="ROW" minOccurs="0" max~ccurs="unbounded'> <xsd:complexType> <xsd:element name="EMIPNO" type="xsd: integer" minOccurs="0"/> <xsd:element name="ENAME" type="xsd: string" nullable="true" minOccurs="0"I> -<xsd:complexType> </xsd:element> <I/xsd:complexType> <,/xsd:element> fxsd:schema <ROWSET xmhns :xsi="http://www.w3 .orRL2000/1I /XMLSchema-instance" xsi:noNamespaceSchemaLocation="#DOCTMENT/xsd:schema[not(@targetNamespac-e <ROW num=" <EMPNO>2 1 00<EMPNO>
<ENAME>JOHN</ENAME>
<IROW>
</ROWSET>
</DOCUMENT'>
XML NAMESPACES Object relational data type definitions that are associated with a given relational database schema can be bound to a corresponding XM1. namespace. An XML namespace is a collection of names that are used in XML documents as element types and attribute names. An XML namespace can be defined by a URL. For example, as Sexplained herein, assume that the relational database has a user-defined type "Address_t", O which is a complex object type that comprises 3 scalar attributes, namely CITY, STATE r- 5 and ZIP. For the purpose of explanation, assume that the complex object type, "Addresst", is defined in relational database schema SCOTT. Thus, "Address_t" can be 00 bound to the XML namespace that is defined by the URL, http://ora.com/SCOTT, for Cc example.
Ci An XML-Schema can contain object relational types from different XML r- 10 namespaces. To illustrate, assume a relational database schema FOO and a relational Sdatabase schema PEE is created. Further assume that the relational database schema FOO contains the user-defined type called AddressType, and the relational database schema PEE contains the user-defined type called NameType. The AddressType comprises 3 scalar attributes, namely CITY, STATE and ZIP. The NameType comprises 2 scalar attributes, namely FIRSTNAME and LASTNAME. Assume that an object relational table, EMP2, is created. EMP2 has 2 columns, namely ENAME and EADDR. ENAME contains the name of employee, "James Bond" and is of type NameType. EADDR contains the address of James Bond and is of type AddressType.
The following SQL statements illustrate the creation of database schema FOO, database schema PEE, AddressType, NameType and EMP2 in the relational database: connect sys/sys as sysdba grant resource,dba to foo identified by ball; grant resource,dba to pee identified by wee; grant execute any type to foo; grant execute any type to pee; connect foo/ball create type AddressType as object (street varchar2(30), city varchar2(30), zip connect pee/wee create type NameType as object (FirstName varchar2(30), LastName varchar2(30)); create table Emp2 ename NameType, eaddr foo.AddressType -12- The syntax used in the preceding statements is merely illustrative. The actual syntax of SQL statements may vary from implementation to implementation. The present inventioni is not limited to any particular syntax.
C0 In table EMP2, the column ENAMIE uses the NameType that is defined for r- 5 relational database schema PEE while the column EADDR uses the Address Type that is defined for relational database schema FOO.
00 Thus, the XMvL-Scbema that corresponds to the XM4L result set of a SQL query such as SELECT FROM EWi2 will contain separate URLs that define the XMIL ci namespace for FOO and for PEE. The XML namespace for FOO will contain the r- 10 definition for AddressType. The XIML namespace for PEE will contain the definition for NameType.
The XCML-Schemas that correspond to the XML result set of a SQL query such as SELECT FROM EMIP2 are as follows, according to certain embodiments of the invention: <xsd:schema xmlns:FOO="http://ns.oracle.com/xdb/FOO" xmlns:xsd="hnt://www.w3 .orp,/2000/1 0/X)MLSchema" xmlns:PEE="http :H/ns.oracle.com/xdb/PEE"> <xsd:element name="ROWSET"> <xsd:complexType> <xsd:element name="ROW" minOccurs="0" max~ccurs=" unbounded"> <xsd:complexType> <xsd:element name:="ENANM" type="PEE:NAMETYPE" nullable="true" minOccurs="O"I> <xsd:element name="EADDR" type="FOO:ADDRESSTYPE" nullable="true" minOccurs -</xsd:complexType> <xsd:element -</xsd:c-omplexType> <xsd:element> </xsd:schema <schema targetNamespace="http://ns.oracle.com/xdb/FOO" xmlns="http)://www.w3 .org(2000/1 0/XMLSchema" xmlns:FOO="http):Hns.oracle.com/xdb/FOO"> <complexType name="ADDRESSTYPE"> <element name="STREET" type="string" nullable="true" minOccurs="0"/> <element name="CITY" type="string" nullable="true" minOccurs="0"/> <element name="ZLP" type= "integer" nullable="true" minOccurs="0"/> </complexType> </schema> <schema targetNamespace="http://ns.oracle.com/xdb/PEE" xmlns="htti://www.w3 .orW/2000/ 1 0/XMiLSchema" -13xmlns:PEE="htti)://ns.oracle.com/xdb/PEE"> <complexType naine="NAMETYPE'> <element name="FIRSTNAME" type="string" nullable="true" minOccurs="O"1> __<element name=" LASTNAMIE" type="string" nullable="true" minOccurs="0"f> 0 5 \</complexType> 0 </schema> Alternatively, X0 iL-Schemas can be "inlined" in its corresponding XML result set 00 that contains the target data, namely, the name and address of the employee in EMIP2.
rn 10 According to certain embodiments of the invention, the XMIL result set shows its c-i corresponding XML-schemas "inlined": <?xml version <DOCUMENT xmlns:xsd="http://www.w3 .org/2000/1 O/XN{LSchema"> <schema targetNamespace="http://ns.oracle.com/xdb/PEE" xmlns="http://www.w3 .org/2000/1 OiXCMLSchema" xmlas:PEE="http :H/ns.oracle.com/xdb/PEE"> <complexType name="NAMETYPE"> <element name="FIRSTNAME type="string" nullable="true" minOccurs="0"/> <element name="LASTNAME" type="string" nullable="true" minOccurs="0"1/> <complexType> </schema> <schema targetNamespace="htp://ns.oracle.com/xdb/FOO" xmnlns="htp://www.w3 .orW/2000/1 0/XMLSchema" xmlns:FOO="http://ns.oraclc.com/xdb/FOO"> <complexType name="ADDRESSTYPE"> <element name=" STREET" type="string" nullable="true" minOccurs"0"/> <element name="CITY" type="string" nullable="true" minOccurs="0"/> <elemnent name="ZWP" type="integer" nullable="true" minOccurs="0"t> </complexType> </schema> <xsd:schema xmlns:FOO0"htti)://ns.oracle.com/xdb/FOO" xmnlns:xsd="http://www.w3 .orp-/2000/1 0/XNElSchema" xylns:PEE="htti):H/ns.oracle.com/xdb/PEE"> '<xsd:import targetNamespace="http://ns.oracle.com/xdb/PEE" -14schemaLocation="4/DOCLTMENT/xsd:schema[@targetNamespace='httn ://ns.oracle.coml xdb/PEE']"/> <xsd:import targetNamnespace="http://ns.oracle.com/xdb/FOO" 0 schemaLocation="/DOCUMENT/xsd:schema[@targetNamespace='httr)://ns.oracle.coml r- 5 xdb/FOO'] <xsd:element name="ROWSET'> 00 <xsd:complexType> <xsd:element name="ROW" minOccurs="O" max~ccurs="unbounded"> c-i <xsd:complexType> r> 10 <xsd:element name="ENAME:F" type="PEENAMETYPE" nullable'"true" minOccurs="0 <xsd:element name="EADDR" type="FOO:ADDRESSTYPE" nullable="true" minOccurs"0"/> <xsd:complexlype> <Jxsd:element> </xsd:complexType> -</xsd:element> </xsd:schema <ROWSET xmins:xsi="http://www.w3 .org-/2000/1 0/XIMLSehema-instance" xsi:noNamesparceSchemaLocationz="#/DOCUTMENT/xsd: schema[not(@targetNamespace <ROWV nuin=" <ENAM4E> <FIRSTNAMlE>James<FIRSTNAMIE> <LASTNAMIE>Bond<LASTNAMIE> <EFNAM4E>
<EADDR>
<STREET'>00 secret ave</STREEL> <CITY>London</CITY> <ZIiP>3928 1</ZIP>
</EADDR>
</ROW>
</ROWSET>
<DOCUMENT>
c_ HARDWARE o O FIG. 2 is a block diagram that illustrates a computer system 200 upon which an r- 5 embodiment of the invention may be implemented. Computer system 200 includes a bus 202 or other communication mechanism for communicating information, and a processor 00 204 coupled with bus 202 for processing information. Computer system 200 also includes a main memory 206, such as a random access memory (RAM) or other dynamic storage C device, coupled to bus 202 for storing information and instructions to be executed by processor 204. Main memory 206 also may be used for storing temporary variables or Sother intermediate information during execution of instructions to be executed by processor 204. Computer system 200 further includes a read only memory (ROM) 208 or other static storage device coupled to bus 202 for storing static information and instructions for processor 204. A storage device 210, such as a magnetic disk or optical disk, is provided and coupled to bus 202 for storing information and instructions.
Computer system 200 may be coupled via bus 202 to a display 212, such as a cathode ray tube (CRT), for displaying information to a computer user. An input device 214, including alphanumeric and other keys, is coupled to bus 202 for communicating information and command selections to processor 204. Another type of user input device is cursor control 216, such as a mouse, a trackball, or cursor direction keys for communicating direction information and command selections to processor 204 and for controlling cursor movement on display 212. This input device typically has two degrees of freedom in two axes, a first axis x) and a second axis that allows the device to specify positions in a plane.
The invention is related to the use of computer system 200 for implementing the techniques described herein. According to one embodiment of the invention, those techniques are implemented by computer system 200 in response to processor 204 executing one or more sequences of one or more instructions contained in main memory 206. Such instructions may be read into main memory 206 from another computerreadable medium, such as storage device 210. Execution of the sequences of instructions contained in main memory 206 causes processor 204 to perform the process steps described herein. One or more processors in a multi-processing arrangement may also be employed to execute the sequences of instructions contained in main memory 206. In -16r- alternative embodiments, hard-wired circuitry may be used in place of or in combination 0 with software instructions to implement the invention. Thus, embodiments of the invention are not limited to any specific combination of hardware circuitry and software.
C.)
r- 5 participates in providing instructions to processor 204 for execution. Such a medium may take many forms, including but not limited to, non-volatile media, volatile media, and 0C) transmission media. Non-volatile media includes, for example, optical or magnetic disks, such as storage device 210. Volatile media includes dynamic memory, such as main memory 206. Transmission media includes coaxial cables, copper wire and fiber optics, r- 10 including the wires that comprise bus 202. Transmission media can also take the form of acoustic or light waves, such as those generated during radio wave and infrared data commu ni cations.
Common forms of computer-readable media include, for example, a floppy disk, a flexible disk, hard disk, magnetic tape, or any other magnetic medium, a CD-ROM, any other optical medium, punch cards, paper tape, any other physical medium with patterns of holes, a RAM, a PROM, and EPROM, a FLASH-EPROM, any other memory chip or cartridge, a carrier wave as described hereinafter, or any other medium from which a computer can read.
Various forms of computer readable media may be involved in carrying one or more sequences of one or more instructions to processor 204 for execution. For example, the instructions may initially be carried on a magnetic disk of a remote computer. The remote computer can load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local to computer system 200 can receive the data on the telephone line and use an infrared transmitter to convert the data to an infr-ared signal. An infrared detector coupled to bus 202 can receive the data carried in the infr-ared signal and place the data on bus 202. Bus 202 carries the data to main memory 206, from which processor 204 retrieves and executes the instructions. The instructions received by main memory 206 may optionally be stored on storage device 210 either before or after execution by processor 204.
Computer system 200 also includes a communication interface 218 coupled to bus 202. Communication interface 218 provides a two-way data communication coupling to a network link 220 that is connected to a local network 222. For example, communication interface 218 may be an integrated services digital network (ISDN) card or a modem to provide a data communication connection to a corresponding type of telephone line. As another example, communication interface 218 may be a local area network (LAN) card to provide a data communication connection to a compatible LAN. Wireless links may also be C0 implemented. In any such implementation, communication interface 218 sends and receives 5 electrical, electromagnetic or optical signals that canry digital data streams representing various types of information.
00 Network link 220 typically provides data communication through one or more networks to other data devices. For example, network link 220 may provide a connection Cl through local network 222 to a host computer 224 or to data equipment operated by an r- 10 Internet Service Provider (ISP) 226. ISP 226 in turn provides data communication services through the worldwide packet data communication network now commonly referred to as the "Internet" 228. Local network 222 and Internet 228 both use electrical, electromagnetic or optical signals that carry digital data streams. The signals through the various networks and the signals on -network link 220 and through communication interface 218, which carry the digital data to and from computer system 200, are exemplary forms of carrier waves transporting the information.
Computer system 200 can send messages and receive data, including program code, through the network(s), network link 220 and communication interface 218. In the Internet example, a server 230 might transmit a requested code for an application program through Internet 228, ISP 226, local network 222 and communication interface 218. In accordance with the invention, one such downloaded application implements the techniques described herein.
The received code may be executed by processor 204 as it is received, and/or stored in storage device 210, or other non-volatile storage for later execution. In this manner, computer system 200 may obtain application code in the form of a carrier wave.
In the foregoing specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
-18-

Claims (19)

1. A method of providing data, the method comprising the steps of: -n receiving, at a database server, a relational database query to retrieve data that 00 resides in a relational database; and the database server responding to the relational database query by extracting, from 00 S 5 one or more fields within the relational database, content for one or more XML documents; N- wherein the content is stored within said one or more fields in the form of one or more data types that are natively supported by the relational database; N, wherein the content is not stored within said one or more fields in the form of XML documents within the relational database; constructing, within the database server, said one or more XML documents based on the content extracted from the one or more fields; and providing said one or more XML documents as a result of the relational database query in the form of one or more XML documents; wherein the relational database query specifies which values that answer the relational database query are to be contained in the one or more XML documents, and which other values that answer the relational database query are to be referenced in the one or more XML documents by reference links.
2. A method of providing data, the method comprising the steps of: receiving, at a database server, a relational database query to retrieve data that resides in a relational database; and the database server responding to the relational database query by extracting, from one or more fields within the relational database, content for one or more XML documents; wherein the content is stored within said one or more fields in the form of one or more data types that are natively supported by the relational database; wherein the content is not stored within said one or more fields in the form of XML documents within the relational database; constructing, within the database server, said one or more XML documents based on the content extracted from the one or more fields; and -19- 0 providing said one or more XML documents as a result of the relational database query in the form of one or more XML documents in which some values that are selected Sby the relational database query are contained in the XML document and other values that Z are selected by the relational database query are referenced in the XML document. 00
3. A method of providing data, the method comprising the steps of: 00 00 receiving, at a database server, a relational database query to retrieve data that resides in a relational database; and the database server responding to the relational database query by extracting, from C 10 one or more fields within the relational database, content for one or more XML C documents; wherein the content is stored within said one or more fields in the form of one or more data types that are natively supported by the relational database; wherein the content is not stored within said one or more fields in the form of XML documents within the relational database; constructing, within the database server, said one or more XML documents based on the content extracted from the one or more fields; providing said one or more XML documents as a result of the relational database query in the form of one or more XML documents; and during a processing of the relational database query, generating one or more XML-schemas that describe features of the one or more XML documents, wherein the features comprise structure of the one or more XML documents.
4. The method of claim 3, further comprising the database server storing at least one of the one or more XML-schemas within at least one of the one or more XML documents.
A method of providing data, the method comprising the steps of: receiving, at a database server, a relational database query to retrieve data that resides in a relational database; and the database server responding to the relational database query by extracting, from one or more fields within the relational database, content for one or more XML documents; 00 wherein the content is stored within said one or more fields in the form of one or Smore data types that are natively supported by the relational database; Swherein the content is not stored within said one or more fields in the form of -n XML documents within the relational database; 00 constructing, within the database server, said one or more XML documents based on the content extracted from the one or more fields; and 00 t providing said one or more XML documents as a result of the relational database query in the form of one or more XML documents; and CI during a processing of the relational database query, generating one or more XML- schemas that describe features of the one or more XML documents, wherein the features CI comprise constraints of the one or more XML documents.
6. The method of claim 3, wherein the one or more XML-schemas correspond to metadata that is associated with the data that is retrieved in response to the relational database query.
7. The method of claim 3, wherein the one or more XML-schemas comprise relational database object types from one or more XML namespaces, wherein one or more relational database schemas are mapped to each of the one or more XML namespaces.
8. A method of providing data, the method comprising the steps of: receiving, at a database server, a relational database query to retrieve data that resides in a relational database; and the database server responding to the relational database query by extracting, from one or more fields within the relational database, content for one or more XML documents; wherein the content is stored within said one or more fields in the form of one or more data types that are natively supported by the relational database; wherein the content is not stored within said one or more fields in the form of XML documents within the relational database; constructing, within the database server, said one or more XML documents based on the content extracted from the one or more fields; providing said one or more XML documents as a result of the relational database -21- 0 query in the form of one or more XML documents; O generating the one or more XML documents using a set of rules that is stored in Sthe relational database to determine how to structure data contained in the one or more _n XML documents; 00 O wherein the set of rules comprises rules for mapping a relational database object to a corresponding Database Uniform Resource Indicator reference. 00oO Ct
9. The method of claim 8, wherein the set of rules comprises rules for N, mapping a query language reference to a corresponding Database Uniform Resource Indicator reference.
The method of claim 8, wherein the set of rules comprises rules for mapping relational data that is associated with a LOB column to a corresponding Database Uniform Resource Indicator reference.
11. A computer-readable medium carrying one or more sequences of instructions of providing data, which instructions, when executed by one or more processors, cause the one or more processors to carry out the steps: receiving, at a database server, a relational database query to retrieve data that resides in a relational database; and the database server responding to the relational database query by extracting from one or more fields within the relational database content for one or more XML documents, wherein the content is not stored in the form of XML documents within the relational database; constructing, within the database server, said one or more XML documents; and providing said one or more XML documents as a result of the relational database query in the form of one or more XML documents; wherein the relational database query specifies which values that answer the relational database query are to be contained in the one or more XML documents, and which other values that answer the relational database query are to be referenced in the one or more XML documents by reference links.
12. A computer-readable medium carrying one or more sequences of -22- 00 instructions of providing data, which instructions, when executed by one or more 0 O processors, cause the one or more processors to carry out the steps: Sreceiving, at a database server, a relational database query to retrieve data that 'n resides in a relational database; and 00 the database server responding to the relational database query by extracting from one or more fields within the relational database content for one or more XML 00 00documents, wherein the content is not stored in the form of XML documents within the relational database; constructing, within the database server, said one or more XML documents; and C 10 providing said one or more XML documents as a result of the relational database CI query in the form of one or more XML documents; wherein the step of providing said one or more XML documents as a result to the relational database query in the form of one or more XML documents comprises providing an XML document in which some values that are selected by the relational database query are contained in the XML document and other values that are selected by the relational database query are referenced in the XML document.
13. A computer-readable medium carrying one or more sequences of instructions of providing data, which instructions, when executed by one or more processors, cause the one or more processors to carry out the steps: receiving, at a database server, a relational database query to retrieve data that resides in a relational database; and the database server responding to the relational database query by extracting from one or more fields within the relational database content for one or more XML documents, wherein the content is not stored in the form of XML documents within the relational database; constructing, within the database server, said one or more XML documents; and providing said one or more XML documents as a result of the relational database query in the form of one or more XML documents; and during a processing of the relational database query, generating one or more XML- schemas that describe features of the one or more XML documents, wherein the features comprise structure of the one or more XML documents. 00
14. The computer-readable medium of claim 13 further comprising the Sdatabase server storing at least one of the one or more XML-schemas within at least one Sof the one or more XML documents. 5
15. A computer-readable medium carrying one or more sequences of instructions of providing data, which instructions, when executed by one or more 00 00 processors, cause the one or more processors to carry out the steps: receiving, at a database server, a relational database query to retrieve data that N, resides in a relational database; and the database server responding to the relational database query by extracting from N, one or more fields within the relational database content for one or more XML documents, wherein the content is not stored in the form of XML documents within the relational database; constructing, within the database server, said one or more XML documents; and providing said one or more XML documents as a result of the relational database query in the form of one or more XML documents; and during a processing of the relational database query, generating one or more XML- schemas that describe features of the one or more XML documents, wherein the features comprise constraints of the one or more XML documents.
16. The computer-readable medium of claim 13, wherein the one or more XML-schemas correspond to metadata that is associated with the data that is retrieved in response to the relational database query.
17. The computer-readable medium of claim 13, wherein the one or more XML-schemas comprise database object types from one or more XML namespaces, wherein one or more relational database schemas are mapped to each of the one or more XML namespaces.
18. A computer-readable medium carrying one or more sequences of instructions of providing data, which instructions, when executed by one or more processors, cause the one or more processors to carry out the steps: receiving, at a database server, a relational database query to retrieve data that 0 00 resides in a relational database; and Sthe database server responding to the relational database query by extracting from Sone or more fields within the relational database content for one or more XML _n documents, wherein the content is not stored in the form of XML documents within the 00 relational database; constructing, within the database server, said one or more XML documents; and 00 00 providing said one or more XML documents as a result of the relational database query in the form of one or more XML documents; generating the one or more XML documents using a set of rules that is stored in C 10 the relational database to determine how to structure data contained in the one or more N, XML documents, wherein the set of rules comprises rules for mapping a relational database object to a corresponding Database Uniform Resource Indicator reference.
19. A computer-readable medium carrying one or more sequences of instructions of providing data, which instructions, when executed by one or more processors, cause the one or more processors to carry out the steps: receiving, at a database server, a relational database query to retrieve data that resides in a relational database; and the database server responding to the relational database query by extracting from one or more fields within the relational database content for one or more XML documents, wherein the content is not stored in the form of XML documents within the relational database; constructing, within the database server, said one or more XML documents; and providing said one or more XML documents as a result of the relational database query in the form of one or more XML documents; generating the one or more XML documents using a set of rules that is stored in the relational database to determine how to structure data contained in the one or more XML documents, wherein the set of rules comprises rules for mapping a query language reference to a corresponding Database Uniform Resource Indicator reference. A computer-readable medium carrying one or more sequences of instructions of providing data, which instructions, when executed by one or more processors, cause the one or more processors to carry out the steps: 00 receiving, at a database server, a relational database query to retrieve data that Sresides in a relational database; and Sthe database server responding to the relational database query by extracting from 'n one or more fields within the relational database content for one or more XML 00 documents, wherein the content is not stored in the form of XML documents within the relational database; 00 0t constructing, within the database server, said one or more XML documents; and providing said one or more XML documents as a result of the relational database N, query in the form of one or more XML documents; generating the one or more XML documents using a set of rules that is stored in the relational database to determine how to structure data contained in the one or more XML documents, wherein the set of rules comprises rules for mapping relational data that is associated with a LOB column to a corresponding Database Uniform Resource Indicator reference. -26-
AU2007229358A 2000-09-07 2007-10-17 Apparatus and method for mapping relational data and metadata to XML Expired AU2007229358B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
AU2007229358A AU2007229358B2 (en) 2000-09-07 2007-10-17 Apparatus and method for mapping relational data and metadata to XML

Applications Claiming Priority (6)

Application Number Priority Date Filing Date Title
US60/230,878 2000-09-07
US09/949,020 2001-09-06
US09/948,949 2001-09-06
US09/948,998 2001-09-06
AU2001290693A AU2001290693B2 (en) 2000-09-07 2001-09-07 Method and apparatus for XML data storage, query rewrites, visualization, mapping and references
AU2007229358A AU2007229358B2 (en) 2000-09-07 2007-10-17 Apparatus and method for mapping relational data and metadata to XML

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
AU2001290693A Division AU2001290693B2 (en) 2000-09-07 2001-09-07 Method and apparatus for XML data storage, query rewrites, visualization, mapping and references

Publications (2)

Publication Number Publication Date
AU2007229358A1 AU2007229358A1 (en) 2007-11-08
AU2007229358B2 true AU2007229358B2 (en) 2008-07-17

Family

ID=38667245

Family Applications (2)

Application Number Title Priority Date Filing Date
AU2007229358A Expired AU2007229358B2 (en) 2000-09-07 2007-10-17 Apparatus and method for mapping relational data and metadata to XML
AU2007229359A Expired AU2007229359B2 (en) 2000-09-07 2007-10-17 Method and apparatus for flexible storage and uniform manipulation of XML data in a relational database system

Family Applications After (1)

Application Number Title Priority Date Filing Date
AU2007229359A Expired AU2007229359B2 (en) 2000-09-07 2007-10-17 Method and apparatus for flexible storage and uniform manipulation of XML data in a relational database system

Country Status (1)

Country Link
AU (2) AU2007229358B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114528438A (en) * 2022-02-11 2022-05-24 上海森亿医疗科技有限公司 XML information extraction method based on human-computer interaction, storage medium and electronic equipment
CN120234327B (en) * 2025-05-29 2025-09-23 威胜信息技术股份有限公司 Multimode data storage, configuration and read-write method based on ANSI C12.19

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2001243388A1 (en) * 2000-03-02 2001-09-12 Nimble Technology, Inc. Method and apparatus for storing semi-structured data in a structured manner

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
BANERJEE et al. 'Oracle 8i - The XML Enabled Data Management System'. 16th Int Conf on Data Engineering. Feb-Mar 2000, pp 561 to 568 *
SCHMIDT et al. 'Efficient Relational Storage and Retrieval of XML Documents'. Int Workshop on the Web and Databases. May 2000, pp 47-52 *

Also Published As

Publication number Publication date
AU2007229359A1 (en) 2007-11-08
AU2007229358A1 (en) 2007-11-08
AU2007229359B2 (en) 2008-06-12

Similar Documents

Publication Publication Date Title
US6871204B2 (en) Apparatus and method for mapping relational data and metadata to XML
CA2421214C (en) Method and apparatus for xml data storage, query rewrites, visualization, mapping and referencing
US7024425B2 (en) Method and apparatus for flexible storage and uniform manipulation of XML data in a relational database system
US7668806B2 (en) Processing queries against one or more markup language sources
US7873649B2 (en) Method and mechanism for identifying transaction on a row of data
CN1585945B (en) Mechanism for mapping XML schemas to object-relational database systems
US7120645B2 (en) Techniques for rewriting XML queries directed to relational database constructs
US7043487B2 (en) Method for storing XML documents in a relational database system while exploiting XML schema
US7107282B1 (en) Managing XPath expressions in a database system
US8463801B2 (en) Effectively and efficiently supporting XML sequence type and XQuery sequence natively in a SQL system
CN1997995B (en) Efficiently evaluating queries using transformations
AU2001290693A1 (en) Method and apparatus for XML data storage, query rewrites, visualization, mapping and references
AU2002334706A1 (en) Mechanism for mapping XML schemas to object-relational database systems
US20050131875A1 (en) Systems and methods for implementing an XML query language
Ludäscher et al. Navigation-driven evaluation of virtual mediated views
US20090100002A1 (en) Updatable result set for multiple joined tables
US7406478B2 (en) Flexible handling of datetime XML datatype in a database system
AU2007229358B2 (en) Apparatus and method for mapping relational data and metadata to XML
Robie XML processing and data integration with XQuery
Sabesan et al. Querying mediated Web services
HK1054092B (en) Method and apparatus for xml data storage, query rewrites, visualization, mapping and references
Lee et al. XML middleware for scalable web mining
CN105488080A (en) NET based XML and SQLServer data exchange method

Legal Events

Date Code Title Description
FGA Letters patent sealed or granted (standard patent)
MK14 Patent ceased section 143(a) (annual fees not paid) or expired