What’s Hard about XML Schema Constraints?

  • Marcelo Arenas
  • Wenfei Fan
  • Leonid Libkin
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2453)


Data description for XML usually comes in the form of a type specification (e.g., a DTD) together with integrity constraints. XML Schema allows one to mix DTD features with semantic information, such as keys and foreign keys. It was shown recently [[2],[7]] that the interaction of DTDs with constraints may be rather nontrivial. In particular, testing if a general specification is consistent is undecidable, but for the most common case of single-attribute constraints it is NP-complete, and linear time if no foreign keys are present.

However, XML Schema design did not adopt the form of constraints prevalent in the database literature, and slightly changed the semantics of keys, foreign keys, and unique constraints. In this paper we demonstrate the very costly effect of this slight change on the feasibility of consistency checking. In particular, all the known hardness results extend to the XML Schema case, but tractability results do not. We show that even without foreign keys, and with very simple DTD features, checking consistency of XML-Schema specifications is intractable.


Regular Expression Consistency Check Integrity Constraint Consistency Problem Semistructured Data 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    S. Abiteboul, P. Buneman and D. Suciu Data on the Web: From Relations to Semistructured Data and XML. Morgan Kaufman, 2000.Google Scholar
  2. 2.
    M. Arenas, W. Fan and L. Libkin. On verifying consistency of XML specifications. In PODS’02, pages 259–270.Google Scholar
  3. 3.
    P. Buneman, S. Davidson, W. Fan, C. Hara and W. Tan. Keys for XML. In WWW’10, 2001, pages 201–210.Google Scholar
  4. 4.
    P. Buneman, S. Davidson, W. Fan, C. Hara and W. Tan. Reasoning about Keys for XML. In DBPL, 2001.Google Scholar
  5. 5.
    D. Calvanese, G. De Giacomo, and M. Lenzerini. Representing and reasoning on XML documents: A description logic approach. J. Logic and Computation 9(3):295–318, 1999.zbMATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    S. Ceri, P. Fraternali, S. Paraboschi. XML: Current developments and future challenges for the database community. In EDBT 2000, pages 3–17.Google Scholar
  7. 7.
    W. Fan and L. Libkin. On XML integrity constraints in the presence of DTDs. In PODS’01, pages 114–125.Google Scholar
  8. 8.
    M. Garey and D. Johnson. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman and Company, 1979.Google Scholar
  9. 9.
    D. Lee and W. W. Chu. Constraints-preserving transformation from XML document type definition to relational schema. In ER’2000, pages 323–338.Google Scholar
  10. 10.
    V. Vianu. A Web odyssey: From Codd to XML. In PODS’01, pages 1–15.Google Scholar
  11. 11.
    W3C. Extensible Markup Language (XML) 1.0. W3C Recommendation, Feb. 1998.Google Scholar
  12. 12.
    W3C. XML-Data, W3C Working Draft, Jan. 1998.Google Scholar
  13. 13.
    W3C. XML Path Language (XPath). W3C Working Draft, Nov. 1999.Google Scholar
  14. 14.
    W3C. XML Schema. W3C Recommendation, May 2001.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • Marcelo Arenas
    • 1
  • Wenfei Fan
    • 2
  • Leonid Libkin
    • 1
  1. 1.Department of Computer ScienceUniversity of TorontoCanada
  2. 2.Bell LaboratoriesCanada

Personalised recommendations