XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] 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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS