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

Re: What is a sematic data model?

  • From: Amelia A Lewis <amyzing@talsever.com>
  • To: xml-dev@lists.xml.org
  • Date: Fri, 12 Nov 2021 10:17:44 -0500

Re:  What is a sematic data model?
On Fri, 12 Nov 2021 08:33:05 -0500, Ihe Onwuka wrote:
>  Except you cannot generally do that because XML and JSON are not
> representationally equivalent so an XML model translated to JSON will be
> lossy.

Okay, so this is generally true (although I expect cries of outrage 
from those who wish to point out that JSON can represent things that 
XML cannot so that it's lossy to translate from JSON to XML (as well, 
or instead)), but that's because it's general cases, generalized 
conversion tools.

If you want a solid JSON to XML and XML to JSON conversion, then you'll 
have to constrain both XML and JSON to subsets, and restrict data usage 
to those subsets. Then define the conversion between these two language 
subsets (with any options you care to support, and configuration or 
negotiation to specify the use of those options), not the whole thing. 
This gives fairly good results (the principle in general is that you 
have to be able to round trip it without loss; if you can do that, the 
model is working within specs).

If you try to do the same thing for the corpus of all documents 
matching the XML grammars and all documents matching the JSON grammars, 
you're going to either stumble, or write more documentation covering 
the corner cases and underspecified behaviors than both parts of XML 
Schema. But if you start by constraining to a better-defined, 
interoperable-by-design subset (of both sides), you can get reliable 
results.

Note that XDM in its modern forms also offers greater interoperability 
for generalized processors and converters (I'm still in XPath/XSLT 
2.0/XQuery 1.0 land, though, so not going to do more than acknowledge 
that).

Amy!
-- 
Amelia A. Lewis                    amyzing {at} talsever.com
    Songs and fame are vain endeavor--
    only two things fail us never,
    only two things last forever--
    sorrow and love, sorrow and love ....
                -- The Last Song of Sirit Byar


[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.