Conversion algorithm from XQuery to SQL query language and method for querying relational data

A query language and conversion algorithm technology, applied in the database field, can solve the problems of reducing conversion mode mapping dependence, many restrictions, simple functions, etc.

Inactive Publication Date: 2009-10-21
TIANJIN UNIV
View PDF0 Cites 43 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Existing general XQuery-to-SQL conversion algorithms have many restrictions or simple functions
Sun Hongwei et al. added a virtual GVRS layer between XML and relational data in the "Journal of Computer-Aided Design and Graphics" article "XQuery to SQL

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Conversion algorithm from XQuery to SQL query language and method for querying relational data

Examples

Experimental program
Comparison scheme
Effect test

Example Embodiment

[0060] The design idea of ​​the present invention is: since standard SQL statements run on mainstream relational databases, XQuery can be indirectly used to query relational data by converting XQuery into SQL. The conversion algorithm of the invention only needs to generate SQL query statements, which can be nested at any level, but does not need to generate SQL data definition and data operation statements. The conversion algorithm of the present invention uses a mapping algorithm from a fixed relational schema to an XML schema, and the algorithm only considers data query and does not consider complex relations such as keys, foreign keys and constraints in the relational schema. The invention can be used to realize the XQuery query extension of the relational database.

[0061] The present invention first maps relational data to XML schema. In a relational database, data is actually stored in a data table, or a data window can be realized by creating a view. This algori...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a conversion algorithm from XQuery to SQL query language and a method for querying a relational database. Firstly, relational data is mapped into an XML mode, and a concrete mapping rule comprises the following steps of: constructing self-defined XQuery query sublanguage (comprising construction of grammar and functions for self-defining the XQuery query sublanguage); converting the self-defined XQuery query sublanguage into the SQL query language; and utilizing the SQL query language after the conversion to query the relational data. Compared with the prior art, the conversion algorithm can convert an XQuery statement which aims at the relational data to query into an SQL query statement with a plurality of layers of complex nestings and multi-table joining, and the generated SQL statement meets SQL99 standard; and the algorithm can also be taken as a basis of query conversion of an XML expansion plug-in of the relational database, and can also be used for realizing middlewares related to the database and realizing that the database is required by the use of the XQuery language.

Description

technical field [0001] The invention relates to the database field, in particular to a conversion algorithm for realizing relational database query by using XQuery language. Background technique [0002] As an information carrier, data is a valuable resource for an enterprise. In enterprise information systems, most of the data is stored by relational database systems. However, with the development of computer networks, semi-structured XML data has become the de facto standard for data transmission on the Internet. How to make full use of the advantages of traditional relational databases in data storage and at the same time conveniently use the popular XML data format for online data transmission of existing relational databases has aroused people's research interest. [0003] Due to the difference in schema between XML data and relational data, the XQuery query language for XML data is also different from the relational query language SQL for relational data. For exampl...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F17/30
Inventor 陈世展刘超冯志勇李柳青
Owner TIANJIN UNIV
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products