Re: "XML Schema specifies just syntax" versus "XML Schema specifies semantics"

I mostly agree with the conclusion, though with a caveat. I think that in 
general it is correct to assume that XML Schema deals with syntax; 
certainly that is what it is specified to constrain.

I do think that within particular communities and for particular XML 
languages it is sometimes useful to impose a discipline where the syntax 
does parallel the semantics. For example, if I am doing dental records:

<mouth person="bob">
   <jaw whichJaw="upper">
     <tooth toothNumber="1">...</tooth>
     ...
   </jaw>
   <jaw whichJaw="lower">
     <tooth toothNumber="20">...</tooth>
     ...
   </jaw>
</mouth>

it is quite likely that the third element is actually describing a tooth in 
the upper jaw of a person named Bob. That's not inherent in XML 
specifications or in the XSD Recommendation, but when such a discipline is 
used in defining an XML language, then the parallel between syntax and 
semantics tends to be visible in both the individual instance documents and 
the schemas. For example, the schemas may directly constrain valid 
documents to have two <jaw> elements, but that pretty directly relates to 
the number of jaws that the typical person has.

Noah

On 11/9/2011 2:10 PM, Costello, Roger L. wrote:
> Hi Folks,
>
> Sally says, "XML Schema specifies just syntax."
>
> John says, "XML Schema specifies semantics."
>
> Who is correct?
>
> First, we need to be clear on what is meant by "semantics."
>
> I will define it as such:
>
>      The semantics of a thing is its relationships to other things
>      and its properties.
>
> In this discussion I focus exclusively on "relationships."
>
> Here are examples of expressing relationships:
>
>      - Book is an Object.
>      - Person is an Object.
>      - author is a property.
>      - title is a property.
>      - name is a property.
>
> The examples show a "kind-of" relationship between Book/Person to Object, and author/title/name to property.
>
> "kind-of" is only one type of relationship. There are many others, such as "same-as."
>
> So the question resolves, at least in part, to this:
>
>        Does XML Schema allow relationships to be expressed?
>
> With XML Schema you have the ability to create a complexType and then do derive-by-restriction or derive-by-extension on it.  For example, you may create a Book complexType that extends a Publishing complexType. Isn't that an example of XML Schemas expressing a relationship? If yes, then isn't it demonstrating that "XML Schema specifies semantics"?
>
> No, not really.
>
> The derive-by-extension and derive-by-restriction capability specifies a complexType by reusing another complexType. That is quite a different thing from expressing a relationship for the purpose of informing.
>
> Here's what Michael Kay said regarding the use of derive-by-restriction and derive-by-extension to specify semantics:
>
>      I think it's probably a mistake to try and use the concept
>      of 'type' to represent an ontological distinction ...
>
> Even if we grant that derive-by-restriction and derive-by-extension specifies a legitimate ontological relationship, it can only specify one type of relationship (namely, subclass). Typically, a much more varied set of relationships is needed to fully inform.
>
> Here's what Eliot Kimber said:
>
>      There is no sense in which they [XML Schemas] can be
>       anything more than a very weak reflection of some deeper
>      ontology.
>
> Conclusion: XML Schemas specifies syntax only.
>
> What do you think?
>
> /Roger
>

Received on Wednesday, 9 November 2011 22:47:36 UTC