This application claims benefit of priority of European application no. EP ______ titled “Method and System for Processing a Non-XML Document for Storage in a XML Database”, filed May 25, 2007, and whose inventor is Dr. Michael Gesmann.
European application no. ______ titled “Method and System for Processing a Non-XML Document for Storage in a XML Database”, filed May 25, 2007, and whose inventor is Dr. Michael Gesmann, is hereby incorporated by reference in its entirety as though fully and completely set forth herein.
The present invention relates to a method and a database system for processing a non-XML document for storage in a XML database
XML (eXtensible Markup Language) databases are one of the most important technical tools of modern information societies. The high degree of flexibility of such a database allows to store and to retrieve data in a very efficient manner. Generally, XML databases are designed for XML documents. However, in the prior art it is also known to extend a XML database so that it is capable of storing other types of documents. For example the XML database Tamino of applicant is adapted to store non-XML documents such as text files, MS Office files, PDF files, images and audio files, etc. To enable the retrieval of such non-XML documents from the database, it is known to analyze a non-XML document to be stored and to extract some metadata for generating a so-called XML shadow document corresponding to the non-XML document. Using XQuery, the shadow XML document can later be searched and the corresponding non-XML document can be retrieved.
The analysis and the extraction of the metadata is typically performed by a piece of software of the database system, wherein this software is specific for a certain type of non-XML document. Alternatively, a more generic analysing and extracting software can be provided for the handling of non-XML documents, which comprises several components, each of which is specifically designed to process a predefined type of non-XML document. Similar methods and systems are known from U.S. Pat. No. 6,549,922 and published US patent application US 2005050086.
However, all of the methods and systems of the prior art for processing non-XML documents for storage in a XML database use a predefined format or schema for the generated XML documents. In other words, all types of non-XML documents will always lead to a certain type of shadow XML document. For example the above mentioned Tamino database of applicant uses a fixed XML schema, which is in accordance with the “Dublin Core Metadata Initiative” (http://dublincore.org/) and follows the OpenOffice-formats (http://openoffice.org) As a result, the content of the shadow XML document is sometimes not very useful if the fixed XML schema does not allow to store metadata on the shadow XML document with meaningful information. Searches for the non-XML documents based on the shadow XML documents known in the prior art are therefore ineffective and slow.
The above outlined approach for processing non-XML documents furthermore leads to problems, if new types of non-XML documents are to be processed for storing and/or if software components of different providers are to be used for handling different types of non-XML documents. This applies in particular, if the new type of document is not a standard office document but for example an image, wherein the metadata to be extracted (e.g. color distribution, resolution, size or any result of an image processing software) is very different from the metadata for a standard office document.
The present invention is therefore in one aspect based on the technical problem to provide a more flexible approach for generating shadow XML documents, which overcomes at least some of the above explained disadvantages of the prior art.
One embodiment of the invention relates to a method for processing a non-XML document for storage in a XML database comprising the steps of
The received non-XML document may be any of various types of documents, such as a text file, e.g., a .pdf document or a Microsoft Office document; an image file, an audio file; a movie file, or other types of documents or files. The received non-XML document may also be a compressed file using any of various types of compression, such as a compressed text file (using, e.g., LZ compression), a compressed image file (e.g., JPEG), a compressed movie file (e.g., MPEG), etc.
One embodiment of the method may store two separate documents in the XML database, the non-XML document itself and the corresponding shadow document. The structure of the shadow XML document, as defined in the XML schema, is flexible and may vary. This is because there is no complete definition of the structure of the XML content wrapped by the wrapping element of the XML schema. On the contrary, any well-formed XML content can be arranged inside the wrapping element. As a result, the described method provides more flexibility for the components generating the XML shadow document, since they no longer have to strictly adhere to an inflexible, fixed XML schema.
Even though the wrapping element can wrap any kind of well-formed XML content regardless of its structure and content, the XML content of the wrapping element is adapted to be searched using an XQuery with a wildcard.
According to another embodiment, the method further comprises creating an index on the shadow XML document, wherein in one example information for the index is defined in the XML schema. Accordingly, the flexibility of the structure of the XML content of the wrapping element is combined with some definitions, which are adapted for providing an index for later search and retrieval of the shadow XML documents and their non-XML counterparts. In one embodiment, the shadow XML document comprises a unique identifier identifying the corresponding non-XML document.
Another embodiment of the invention concerns a XML database system with an analyzer adapted to analyze a non-XML document. This embodiment may comprise at least one extractor adapted to extract metadata from the non-XML document and to generate a shadow XML document for the non-XML document in accordance with a predefined XML schema, wherein the shadow XML document comprises the metadata. The XML database system further comprises a wrapper adapted to wrap the extracted metadata in the shadow XML document, wherein the structure of the wrapped metadata is at least partly undefined in the XML schema.
The analyzer, the extractor and the wrapper are in one embodiment provided as an extension of a database server, which therefore provides all the functionality for the structured storage of non-XML documents and their respective metadata.
Additionally, the XML database system may further comprise an index based on content of the shadow XML document. This index can be based on information in the wrapped metadata of the shadow XML document.
Further modifications of the described methods and XML database systems are defined in further dependent claims.
While the invention is susceptible to various modifications and alternative forms specific embodiments are shown by way of example in the drawings and may herein be described in detail. It should be understood however, that drawings and detailed description thereto are not intended to limit the invention to the particular form disclosed. But on the contrary the invention is to cover all modifications, equivalents and alternative following within the spirit and scope of the present invention as defined by the appended claims.
The following is a glossary of terms used in the present application:
Memory Medium—Any of various types of memory devices or storage devices. The term “memory medium” is intended to include an installation medium, e.g., a CD-ROM, floppy disks 104, or tape device; a computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; or a non-volatile memory such as a magnetic media, e.g., a hard drive, or optical storage. The memory medium may comprise other types of memory as well, or combinations thereof. In addition, the memory medium may be located in a first computer in which the programs are executed, and/or may be located in a second different computer which connects to the first computer over a network, such as the Internet. In the latter instance, the second computer may provide program instructions to the first computer for execution. The term “memory medium” may include two or more memory mediums which may reside in different locations, e.g., in different computers that are connected over a network. The term “memory medium” encompasses a storage area network (SAN), a database, etc.
In the following, exemplary embodiments of the XML database system and method of the present invention are described. It will be understood that functionality described below can be implemented in a number of alternative ways, for example on a single database server, a distributed arrangement of a plurality of database servers, with an integral storage or an external storage, etc. None of these implementation details is essential for the present invention.
For processing the media file 10, the XML database system 1 comprises in one embodiment a document processor 2. The document processor 2 drives the process for storing a document. As illustrated by the dotted arrow on the left side of
In addition, the media file 10 is forwarded to a schema processor 4. The operation of the schema processor 4 and the further elements of the XML database system 1 which are shown on the right side of
In a first step, an analyzer 6 analyzes the media file 10 and determines which extractors 7 are to be called. Each extractor 7 processes the media file 10 and generates content for a shadow XML document 20. Depending on the type of media file 10, different extractors 7 can be used. For example, there might be an extractor 7 performing image processing on an image and outputting metadata about the image such as its resolution, colour distribution or any other type of image related information. Another extractor 7 may be adapted to process video files and a further extractor 7 may be provided for extracting metadata about an audio file, such as its length, the sampling frequency etc. Whereas in the described embodiment there are distinct extractors 7 for each type of media file 10, there could also be one or more integrated extractors 7 being able to extract metadata from more than one type of file.
Finally, a wrapper 8 creates a common doctype element around the generated XML content. It is to be noted that this content, which was generated by one or more extractors 7, can be any well-formed XML content, regardless of its specific structure. Therefore, the described embodiment of the XML database system can be quickly adapted to new media files by adding or modifying an extractor 7 so that the new type of files can be processed.
Whereas the schema processor 4, the analyzer 6, the extractors 7 and the wrapper 8 have been described and shown in
Although the resulting XML shadow document 20 is fully flexible with respect to the structure and the content of the XML metadata generated by the extractors 7 from the media file 10, it is nevertheless in accordance with a predefined XML schema. An example of such a flexible XML schema 50 for shadow XML documents of the XML database system is shown in
Looking more in detail, the XML schema 50 of
In addition to the elements shown in
An exemplary section of a XML shadow element 20 generated as explained above is shown in
Regardless of the specific structure of the XML content of the wrapping element, it is still possible to execute queries on the shadow XML documents. One option of such a query is the use of wildcards, which do not require information about a specific structure of the XML content of the shadow XML document. For example a query for
In addition to the generation of the shadow XML documents 20, the XML database system 1 of
There are various ways how to generate an index over the shadow XML documents 20. In one embodiment, one or more attributes and/or elements for the index are defined in the XML schema for the shadow XML documents. An example for such an extended XML schema is shown in
It is to be noted that the definition of the information necessary for the index does not imply a certain XML structure for the content of the wrapping element so that the above explained flexibility is preserved. On the contrary, the attribute and the element for the index in the example of
Although the system and method of the present invention has been described in connection with various embodiments, it is not intended to be limited to the specific form set forth herein, but on the contrary, it is intended to cover such alternatives, modifications, and equivalents, as can be reasonably included within the spirit and scope of the invention as defined by the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
07010516.8 | May 2007 | EP | regional |