Ø
the syntax of XML enforces the "hasA" view Walter, what is it in the XML syntax that enforces the “hasA” view”? (Please be specific) If I were to design a new data format language, what would I put in the language to enforce the “hasA” view? What’s the
principle at work? How did the XML founding fathers sneak that into the XML language? By design or by accident? What is the advantage of the “hasA” view? Is it something that one should strive for when designing a data format language? Or is it something that
is to be avoided? /Roger From: Costello, Roger L. Below is a fantastic response from Walter Perry. Thank you Walter! (Walter gave me permission to forward his message to the list) --------------------------------------
The fundamental semantic premise of XML markup is the "hasA" relationship; that of JSON is "isA". This is the opposite of what one is likely to see at first blush, and it has taken me a full 20 years to understand how the syntax of XML enforces the "hasA" view,
ultimately to the exclusion of "isA".
Sparing the 20-year learning curve: the XML syntax permits only the expression of "hasA" relationships between entities--even where those 'entities' are expressed in the XML attribute syntax (color=blue means only that the enclosing entity *has* an identified
color and that that color *has* the identified value 'blue'). The Generic Identifier itself of an XML entity expresses no more than that the entity *has* an identified label, and specifies its instance value. The axes of XSL are those along which the XML syntax
permits the semantics of identified "hasA" relationships to be expressed.
On the other hand, the semantically flat model of JSON allows the existence of anything to be naively induced if only it has a name: use 'color' as a JSON name and presto, color exists as a nominal thing--and not merely as a Platonic form, but something immediately
capable of instantiation in the real world as 'blue', 'red' or 'green'. Further, that color thing is implicitly global in scope, which is only another way of saying that the existence conferred upon 'color' by the "isA" semantic premise of JSON is an absolute
existence. By contrast, such existence as we might posit for entities expressed in the XML syntax is contingent and scoped, and dependent ultimately on our willingness to make the leap of inductive reasoning required to conclude that we have a sufficient number
of specific "hasA" relationships from which we may imagine a generic "isA" that types them.
This is why JSON cannot have meaningful namespaces: semantics which rely on the primacy of "isA" do not then permit that existence to be scoped and made contingent upon "hasA" relationships. And--whatever one might think of the specific W3C-anointed syntax
for XML namespaces--the semantics expressed through the XML syntax are the very essence of namespacing. Every XML entity is, or is potentially, both containing and contained by "hasA" relationships. It's namepaces all the way down--which is to say, scoped
and contingent existence.
Respectfully, Walter Perry |