OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Markup Syntax=XSD, Markup Semantics=RDF

[ Lists Home | Date Index | Thread Index ]

A few days ago, I was reading about the silly HLink [1] and XLink [2]
debate on XML.com.  Along with nearly everyone else it seems [4], I
wondered why XLink just hasn't caught on.  This issue is a little scary
to me, since the debate feels like the older one about ID in the
XPointer scheme [5,6].  (Note: I still can't find any articles on the
current general consensuses about the ID-debate.)  Now that
three-fourths of the XPointer Framework have been stabilized [7], I
would *really* hate to see XPF to fall into oblivion like XPointer seems
to have.

It seems to me that both of these issues are about defining the
semantics of xml tags in a machine-understandable way.  HLink was
invented to describe which markup represents a hyperlink [1], while most
of the ID-issue solutions seem to try to declare what markup represents
an ID for the processing machine [6].  Both of theses issues stem from a
common problem of explicitly defining what an element's name means,
whether an ID or a Link in these cases.  In general, I suspect that this
problem will block any attempt to define a standard that applies to a
***specific type of element*** rather that to the content or document
itself.

Note the emphasized text, 'specific type of element.'  Defining a
thing's type and meaning is an issue that has been of interest to the
W3C and computer engineers for a while [8], and it has influenced the
design of XML.  Indeed, Tim Bray says that one of the main advantages
that XML has over other languages is when it is used to describe the
semantics of a document [9].

However, there haven't been many ways to explicitly define this metadata
until Topic Maps [10] and RDF [11] were invented.  Although Topic Maps
and RDF applications have been used mainly to describe document content,
they haven't often been vectored for describing the semantics of the
markup itself (in my limited experience).

But why not?  Xml Schema Definition Language (XSD) was created as a more
flexible way to describe the structure of the markup of a document [12].
It can be used to define what elements should be nested where.  It can
define the structure of text in an attribute or element (such as a
string or integer).  But there's no way to define in XSD to define what
an element or attribute means.  XSD can be used to declare an attribute
as an ID, but this is just a constraint of uniqueness and not of
meaning.  Why not use RDF to describe the semantics of the markup of the
document?

So I tried it.  Just as XSD describes the logical structure and
organization of elements in an XML application, RDF can be used to
define - in a machine-readable way - what different elements in an XML
application mean.  This allows the semantics of a particular markup
language to be explicitly defined.  Furthermore, RDFS allows one two
apply the semantics of one markup language to another, as the example
below demonstrates:

<h:html
  xmlns:r="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
  xmlns:s="http://www.w3.org/2000/01/rdf-schema#";
  xmlns:h="http://www.w3.org/1999/xhtml";>
<h:head>
  <r:RDF>

    <s:Class r:about="http://www.w3.org/1999/xlink#href"; />

    <s:Class r:about="http://www.w3.org/2001/XMLSchema-datatypes#ID"; />

    <r:Description r:about="#xpointer(/*//*/@href)"
                   r:type="http://www.w3.org/1999/xlink#href"; />

    <r:Description r:about="#xpointer(/*//*/@src)"
                   r:type="http://www.w3.org/1999/xlink#href"; />

    <r:Description r:about="#xpointer(/*//*/@id)"
 
r:type="http://www.w3.org/2001/XMLSchema-datatypes#ID"; />

  </r:RDF>
  <h:title>foo</h:title>
</h:head>
<!-- rest of document -->
</h:html>

In the example above, the all "href" and "src" attributes are declared
to be a type of XLink "href" attributes.  Also, the "id" attributes of
all elements are declared to be a type of XML Schema datatype
(specifically, "ID").  Thus, this mechanism may help when using several
different markup languages where some of the semantics overlap between
them.  

Of course, the above RDF document could be stored in a separate file and
linked to html document as the semantic-analogue of an XML Schema
(though the XPointer expressions would be different).

But I'm definitely not an expert, so I leave this to yinz.

--
James F. Cerra 

[1] http://www.w3.org/TR/hlink

[2] http://www.w3.org/TR/xlink

[3] http://www.xml.com/search/index.ncsp?sp-q=hlink&search=search

[4] http://www.xml.com/pub/a/2002/03/13/xlink.html

[5] http://www.xml.com/pub/a/2001/11/07/id.html

[6] http://weblogs.userland.com/eclectic/xml-identifiers.html

[7] http://www.w3.org/2003/03/xpointer-pressrelease

[8] http://www.w3.org/2001/sw

[9] http://tbray.org/ongoing/When/200x/2003/04/09/SemanticMarkup

[10] http://www.ontopia.net/topicmaps/materials/tao.html

[11] http://www.w3.org/TR/rdf-primer

[12] http://www.w3.org/XML/Schema




 

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

Copyright 2001 XML.org. This site is hosted by OASIS