[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Notable declarative expressions?

  • From: Rick Jelliffe <rjelliffe@allette.com.au>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Wed, 21 Dec 2016 15:37:08 +1100

Re:  Notable declarative expressions?
According to a neat site I found called Wikipedia, a 1975 ANSI expert group decided there are (at least) three major things we can call data models: physical data models (e.g. for JSON?), logical data models (e.g. for XML ?) and conceptual data models (e.g. RDF?). 

So if "data model" is not a univocal term, then making categorical statements as if it were  won't really work.

So I think Roger's question is really whether the conceptual data model we can impute to XSD  for constraining the logical data model on XML documents is powerful enough compared to alloy.  What is that XSD conceptual data model?  grammars, regex, inheritance, keys.  So a particular XSD grammar is a logical data model for some XML, but that grammars are used is the conceptual data model of XSD.

Alloy might allow a richer set of concepts and therefore make modeling some things easier.  Like how using XPath instead of grammars simplifies many kinds of context expressions, but not all.  But there is a trade-off: grammars (content models and regexes) are pretty easy to understand with only a handful of operators, but I expect Alloy is a bit mode complex than that.  Expressive power (reach) is not the only criterion for a schema language, usability and simplicity also are. Bang for buck.  I am not entirely sure that XSD offers a happy trade-off between power and usability of course (!)  

Grammars are good for regular structures of immediate following nodes (i.e. parent/child, element/attribute, element/following-sibling).  If that is all your conceptual model needs, grammars are find.  If you need to go to non-regular structures or non-forward axis or with fixed distances of more than 1 (i.e.  X/Y/Z or   X[@idref = //Y/@id] ) or outside the current document then you need to go to XPath: grammars are weak.  But if you need to have transitive closure or arbitrary multi-stage traversals or searches (e.g. travese a chain of IDs until some condition is satisfied), then XSLT's XPaths are weak and you need something like Alloy (or XSLT or something that can define functions on XPath)

(By the way, how would I have a schema language to do constraint #1? I wouldn't, if possible:, in a general purpose schema language I would just say that the nodes are ordered  in document order, with the first also following the last.   Use the ordering of XML rather than requiring traversal through IDs to establish a virtual ordering. 

Am I wrong that problem #2 is not a data model of any kind, or a constraint on a data model? It is a functional description and therefore nothing to do with schemas.  [[In Schematron you can express this by pulling in the before and after documents, and asserting that the number of non-corresponding nodes should be 1, but that is not data modeling, that is input/output comparison (see http://schematron.com/2016/12/six-kinds-of-validation-using-schematron/) ]]

Regards
Rick



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.