As a database format, XML (GML by extension) can be queried. In order to do this, we need a query language (of general use) to retrieve information from an XML document. Nevertheless, it is necessary to enrich the query language over XML features with spatial operators if we wish to apply it over spatial data encoded with GML. Otherwise, these query languages could only be used to query alphanumeric features of an XML document and not, for example, the topological relationship between two spatial regions. Today, there is a large set of query languages over XML. These query languages are different with respect to syntax, available operators and environment of applicability. However, they share the same features, that is, features of query languages over semi-structured data. With respect to GML, from the literature, it is known that four GML query languages have been proposed. The following chapter briefly describes these query languages over GML.
Xml As A Database: Querying Xml
Undoubtedly, an interesting advantage of XML is that it can be used as a database, even though an XML document is a database only in the strictest sense of the term, i.e., it is a collection of data. In many ways, this makes it no different from any other file.
As a database format, XML has several advantages. For example, it is self-describing (the markup describes the structure and type names of the data, although not the semantics), it is portable (Unicode), and it can describe data in tree or graph structures.
These properties make it possible to open a new set of XML applications, all of them involving storage and retrieval of information represented by XML.
One example of XML as a database is a restaurant catalog. It could be defined with alphanumeric features, e.g., name, phone number, address, capacity. An advantage of XML is that the data is portable, and it can easily be manipulated for inserting, updating and deleting information.
Key Terms in this Chapter
Markup Language: Language which combines text and extra information about the text. The extra information is expressed using markup, which is intermingled with the primary text.
Query Language: Computer language used to make queries into databases and information systems
Feature: A feature is an application object that represents a physical entity, e.g. a building, a river, or a person. A feature may or may not have geometric aspects.
Semi-Structured Data: Data with incomplete structure. Data are directly described using a simple syntax, e.g. XML, GML, etc.