A structural similarity measure for XML documents: theory and applications

XML (eXtendible Markup Language) has recently emerged as the most relevant standardization effort in the area of markup languages, and it is increasingly used as the language for information representation and exchange over the Web. An important feature of XML is that information on document structures is available on the Web together with the document contents. This information can be exploited to improve document handling and query processing. At the same time, XML databases on the Web are proliferating. The possibility of associating a kind of schema (either a DTD, an XML schema or others), allows one to take advantage of the knowledge about document structures for storing, querying, protecting and indexing a set of documents. An important feature that should be guaranteed is the possibility of exchanging information among XML databases on the Web in order to share data dealing with the same topic. However, in an heterogeneous environment as the Web, it is not reasonable to assume that XML documents generated in a database A and acquired by a database B always conform to a predefined schema present in the database B. In other words, even if the two databases contain a schema representing the same kind of information it is not reasonable to assume that the two schemas are identical. There is therefore a strong need for methodologies and tools for modeling and evaluating the similarity between an XML document and a schema in order to verify whether a document is similar enough to a schema to be considered an instance of it, and to identify the common and divergent components of the two structures. Whenever a newly acquired document is similar enough to a given schema, all the policies and data structures defined on the schema for document storage, access and protection can be also applied to the new document. In this dissertation we propose a measure for evaluating the structural similarity between an XML document and a DTD. The measure addresses the fundamental requirements a measure should meet in order to properly evaluate the distance between the two structures: maximize the common parts of the two structures, minimize the differences (that is, the parts present in the document but not required in the DTD, the parts required in the DTD but absent in the document), and taking into account the level in the hierarchical structure where differences are detected. Besides the structural similarity, the measure takes also into account the vocabular similarity. Indeed, even if the label used for tagging an element is different from the one used in the schema, the two labels can be synonymous with respect to a given thesaurus. Requirements, formalization, algorithms and experimental results for the structural similarity measure have been discussed in the thesis. Moreover, the similarity measure has been exploited for several applications. First, the measure is used for the classification of documents against a set of DTDs. For each DTD in the database, the similarity measure is applied for determining if (at least) a DTD exists with a similarity degree greater than a given threshold. If such a DTD exists, the document is considered as instance of it thus taking advantage of this status. Then, since the classification of documents can lead to a DTD no more representative of its instances, an approach for changing the DTD itself has been developed in order to obtain a suitable representation of its document instances. The structural similarity measure is exploited for determining a new schema for the DTD by extracting structural information during the classification phase. During the evolution phase, each element of the DTD is considered for establishing whether it is better to keep the current structure of its subelements, completely change it or to perform just some corrections. Finally, the measure is exploited for the protection of documents. The widespread use of XML is pushing the need of models and techniques for securing XML data. In the dissertation a suitable access control model has been defined that addresses the fundamental requirements for access protection of XML documents: varying granularity levels of protection ranging from a single element of a document to a set of documents; the presence in a database of both valid and well-formed documents; hierarchical inter-linked structure of XML documents; releasing of documents relying on subject properties (specified by means of credentials) instead of subject identity. In this context, the similarity measure has been exploited for the classification of documents against a DTD, and for propagating the access control policies specified on the DTD to the documents. Propagation options have been specified for the protection of the parts of documents not covered by the DTD. This approach helps the Security Officer in its work to protect the sensitivity information contained in huge amount of documents gathered from the Web.