Skip to main content
Log in

Model-driven approach to modeling and validating integrity constraints for XML with OCL and Schematron

  • Published:
Information Systems Frontiers Aims and scope Submit manuscript

Abstract

The idea behind Model Driven Development (MDD) (Miller and Mukerji 2003) is to model the software system on several layers of abstraction. A designer starts from the very abstract specification (independent of the platform and language used) and progresses to more concrete models (using platform-specific constructs) and finally to code. Ideally, each step of the transformation of the model from the more abstract to the less abstract is achieved by a declarative transformation obtained (semi-)automatically. In our previous work, we have developed an approach for designing XML schemas based on MDD. We showed that a set of XML schemas representing different views of the same problem domain can be first modeled in a platform-independent level with a uniform conceptual schema expressed as a UML class diagram. Then each XML schema can be modeled as a view on this uniform UML class diagram. In this paper, we further extend our approach to modeling XML schemas using UML class diagrams with modeling integrity constraints using Object Constraint Language (OCL). We show that an integrity constraint expressed at the platform-independent level as an OCL expression can be translated to an expression at the XML schema level which can be used to validate XML documents. In particular, we propose a method which translates an OCL expression at the platform-independent level to a Schematron expression. Schematron is a language which enables to express integrity constraints at the XML schema level. We show that our approach saves time and prevents from errors made by designers when expressing Schematron constraints manually.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17

Similar content being viewed by others

Notes

  1. When the name of an association end is the same as the name of the participant class (i.e. name(E) = name(part icipant(E))), we omit name(E) in the diagrams.

  2. We currently support export to XSD and Relax NG.

  3. As a matter of fact, the recommendation of XML Schema 1.1 (W3C 2012a) allows to include some of the Schematron constructs directly in the XSD.

  4. Results produced by T v are formated using SVRL—Schematron Validation Report Language, which is part of Schematron specification (ISO/EIC 2006).

  5. http://schematron.com offers an implementation of XSLT pipeline to generate T S for public use.

  6. OclX documentation: http://github.com/j-maly/oclx

  7. The syntax also presumes that all the key PSM attributes are represented as PSM elements ( x f o r m = E. For those attributes, which are not, attribute axes will is used to access them)

  8. Some iterator expression can be in some cases translated using native XPath constructs without the need to call a HOF, e.g. exists can be translated using some/satisfies expression. Due to the space limitations, we do not discuss this sort of rewriting of the queries in this paper. Our experimental implementation (Klímek et al. 2012) allows the user to choose where several translations are possible.

  9. To be accurate, another operation—oclIsUndefined—behaves equally to oclIsInvalid when the argument is invalid, but it also returns true, when the result of the computation is null

  10. Similarly, we rely on XML schema validator in other conflicts, our definitions do not, e.g., require attributes of the same class to have distinct names, even though it is not possible to translate such class into a valid XML schema.

  11. http://www.isvz.cz (in Czech only)

References

  • Abiteboul, S., Benjelloun, O., Milo, T. (2008). The Active XML project: an overview. VLDB Journal, 17(5), 1019–1040. http://dblp.uni-trier.de/db/journals/vldb/vldb17.html#AbiteboulBM08.

    Article  Google Scholar 

  • Arenas, M., Fan, W., Libkin, L. (2008). On the complexity of verifying consistency of XML specifications. SIAM Journal of Computer, 38, 841–880. http://dl.acm.org/citation.cfm?id=1.405087.1405100.

    Article  Google Scholar 

  • Badica, A., Badica, C., Popescu, E. (2006). Implementing logic wrappers using xslt stylesheets. International multi-conference on computing in the global information technology (Vol. 0, p. 31).

  • Boag, S., Chamberlin, D., Fernández, M.F., Florescu, D., Robie, J., Siméon, J. (2007). XQuery 1.0: an XML Query Language, W3C. http://www.w3.org/TR/xquery/.

  • Bouchou, B., Ferrari, M.H., Lima, M.A.V. (2011). Attribute grammar for XML integrity constraint validation. In Proceedings of the 22nd international conference on database and expert systems applications—volume part I, DEXA’11 (pp. 94–109). Springer, Berlin, Heidelberg. http://dl.acm.org/citation.cfm?id=2035368.2035378.

  • Booth, C.K.L.D. (2007). Web Services Description Language (WSDL) version 2.0 part 0: Primer, W3C. http://www.w3.org/TR/wsdl20-primer/.

  • Codd, E.F. (1972). Relational completeness of data base sublanguages. In R. Rustin (Ed.), Database systems: 65–98, Prentice Hall and IBM Research Report RJ 987. San Jose, California.

  • Conrad, R., Scheffner, D., Christoph Freytag, J. (2000). XML conceptual modeling using UML. In Conceptual modeling—ER 2000. Lecture Notes in Computer Science.

  • Demuth, B., & Hussmann, H. (1999). Using uml/ocl constraints for relational database design. In Proceedings of the 2nd international conference on The unified modeling language: beyond the standard, UML’99. Springer, Berlin, Heidelberg. http://dl.acm.org/citation.cfm?id=1.767297.1767359.

  • Dominguez, E., Lloret, J., Perez, A., Rodriguez, B., Rubio, A.L., Zapata, M.A. (2011). Evolution of XML schemas and documents from stereotyped UML class models: a traceable approach. Information and Software Technology, 53, 34–50.

    Article  Google Scholar 

  • Eclipse Model Development Tools (MDT). http://www.eclipse.org/modeling/mdt/.

  • Fan, W., & Libkin, L. (2002). On XML integrity constraints in the presence of DTDs. Journal of ACM, 49(3), 368–406. doi:10.1145/567112.567117.

    Article  Google Scholar 

  • Gaafar, A., & Sakr, S. (2004). Towards a framework for mapping between UML/OCL and XML/XQuery. In UML.

  • Holstege, M. (2012). Type introspection in XQuery. In Proceedings of Balisage: the markup conference 2012, Balisage series on markup technologies. Mulberry Technologies.

  • Hussmann, H., Demuth, B., Finger, F. (2000). Modular architecture for a toolset supporting OCL. In UML: advancing the standard, UML’00. Springer.

  • ISO/EIC (2006). Information technology Document Schema Definition Languages (DSDL) part 3: rule-based validation schematron. ISO/IEC 19757-3.

  • Klímek, J., Malý, J., Nečaský, M. (2012). eXolutio project. http://exolutio.com.

  • Klímek, J., & Nečaský, M. (2012). Formal evolution of XML schemas with inheritance. In Proceedings of international conference on web services 2012.

  • Malý, J., Mlýnková, I., Nečaský, M. (2011). XML data transformations as schema evolves. In ADBIS ’11: proceedings of the 15th advances in databases and information systems. Springer, Vienna.

  • Malý, J., & Nečaský, M. (2012). Utilizing new capabilities of XML languages to verify OCL constraints. In Proceedings of Balisage: the markup conference 2012, Balisage series on markup technologies.

  • Malý, J., Nečaský, M., Mlýnková, I. (2012). Efficient adaptation of XML data using a conceptual model. Information Systems Frontiers, 1–34. doi:10.1007/s10796-012-9375-8.

  • Mandel, L., & Cengarle, M. (1999). On the expressive power of OCL. In FM’99 – Formal Methods, Springer (Vol. 1708).

  • Miller, J., & Mukerji, J. (2003). MDA Guide Version 1.0.1, Object Management Group. http://www.omg.org/docs/omg/03-06-01.pdf.

  • Murata, M. (2002). RELAX (Regular Language Description for XML), ISO/IEC DTR 22250-1. http://www.xml.gr.jp/relax/.

  • Murata, M., Lee, D., Mani, M., Kawaguchi, K. (2005). Taxonomy of XML schema languages using formal language theory. ACM Transactions, 5(4), 660–704.

    Article  Google Scholar 

  • Nečaský, M., Klímek, J., Malý, J., Mlýnková, I. (2012a). Evolution and change management of XML-based systems. Journal of Systems and Software, 85(3), 683–707. http://www.sciencedirect.com/science/article/pii/S0164121211002524.

    Article  Google Scholar 

  • Nečaský, M., Mlýnková, I., Klímek, J., Malý, J. (2012b). When conceptual model meets grammar: a dual approach to XML data modeling. Data & Knowledge Engineering, 72, 1–30. http: //www.sciencedirect.com/science/article/pii/S0169023X1100125X.

    Article  Google Scholar 

  • Nentwich, C., Capra, L., Emmerich, W., Finkelstein, A. (2002). xlinkit: a consistency checking and smart link generation service. ACM Transactions on Internet Technology, 2(2), 151–185. 10.1145/514183.514186.

    Article  Google Scholar 

  • Object Management Group (2007). UML 2.1.2 Specification. http://www.omg.org/spec/UML/2.1.2/.

  • Object Constraint Language Specification (2012). OMG. http://www.omg.org/spec/OCL/2.3.1/.

  • Phan, B., Pardede, E., Rahayu, W. (2013). On the improvement of active XML (AXML) representation and query evaluation. Information Systems Frontiers, 15(2), 203–222. doi.10.1007/s10796-012-9363-z.

    Article  Google Scholar 

  • Richters, M., & Gogolla, M. (2002). OCL: syntax, semantics, and tools. In Object modeling with the OCL, Springer. (Vol. 2263, pp. 447–450).

  • Routledge, N., Bird, L., Goodchild, A. (2002). UML and XML schema. In ADC’02, ACS.

  • Salem, R., Boussaïd, O., Darmont, J. (2013). Active XML-based Web data integration. Information Systems Frontiers, 15(3), 371–398. doi:10.1007/s10796-012-9405-6.

    Article  Google Scholar 

  • Saxonica (2012). Saxon XSLT Processor 9.4., http://saxon.sourceforge.net/.

  • Sparx Systems. Enterprise Architect. http://www.sparxsystems.com.au/products/ea/index.html.

  • Technische Universität Dresden. Dresden OCL. http://www.dresden-ocl.org.

  • Tim Bray, C.M.S.-M., & Paoli, J. (2000). Document type declaration.

  • W3C (2001). XML Linking Language (XLink) version 1.0 recommendation. http://www.w3.org/TR/xlink/.

  • W3C (2010). XProc: an XML pipeline language recommendation. http://www.w3.org/TR/xproc/.

  • W3C (2011). XML Path Language (XPath) 3.0, working draft 13. http://www.w3.org/TR/xpath-30/.

  • W3C (2012). XML Schema 1.1. http://www.w3.org/TR/xmlschema-1/.

  • W3C (2012). XQuery and XPath data model 3.0, working draft. http://www.w3.org/TR/xpath-datamodel-30/.

  • W3C (2012). XSL Transformations (XSLT) version 3.0, working draft 10. http://www.w3.org/TR/xslt-30/.

  • Wenfei, F., & Jerome, S. (2003). Integrity constraints for XML. Journal of Computer and System Sciences (JCSS), 66(1), 254–291.

    Article  Google Scholar 

  • Zschaler, S., Demuth, B., Schmitz, L. (2014). Salespoint: A Java framework for teaching object-oriented software development. Science of Computer Programming, 79, 189–203. doi:10.1016/j.scico.2012.04.005, http://dblp.uni-trier.de.

Download references

Acknowledgments

This work was supported by the Czech Science Foundation (GAČR), grant number P202/11/P455 and by Charles University, grant number 204-10/253421.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jakub Malý.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Malý, J., Nečaský, M. Model-driven approach to modeling and validating integrity constraints for XML with OCL and Schematron. Inf Syst Front 17, 917–946 (2015). https://doi.org/10.1007/s10796-013-9471-4

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10796-013-9471-4

Keywords

Navigation