- From: Stefano Mazzocchi <stefano@apache.org>
- Date: Mon, 07 Jun 2004 17:36:49 +0200
- To: "Butler, Mark" <mark-h.butler@hp.com>
- Cc: simile general <www-rdf-dspace@w3.org>
- Message-ID: <40C48B91.8000201@apache.org>
Butler, Mark wrote:
> RE: MADS
>
>
>>Converting this schema to a useful RDF is algorithmically impossible
>>since too much information is kept implicit and/or optional.
>
>
> I don't think its impossible - for example of how to do it, see the enclosed
> XSLT stylesheet which demonstrates how to convert the examples.
>
> Writing XML in this way is quite a useful design pattern for getting
> RDF-like extensibility in XML while retaining compatibility with things like
> WSDL based web services, where we have to write an XML Schema to describe
> our data. Writing such a schema limits our ability to add extensions, so one
> way to overcome this is to use attributes to encode property names, as this
> frees us from the schema constraint. Of course once we are free of the
> schema constraint, then we lose our ability to validate, but then that's a
> problem we have with RDF as well.
Very true.
The problem I have is not about the encoding of the semantics in the
attributes, but the fact that those attributes are optional.
For example, in your stylesheet you write:
<xsl:template match="ref">
<xsl:element name="{@relatedType}"
namespace="http://web.mit.edu/simile/www/2004/06/mads-custom#">
<rdf:Description>
<xsl:choose>
<xsl:when test="geographic">
<xsl:attribute
name="rdf:about">http://web.mit.edu/simile/www/2004/06/madsdata#<xsl:value-of
select="str:urlencode(geographic)"/></xsl:attribute>
</xsl:when>
<xsl:when test="topic">
<xsl:attribute
name="rdf:about">http://web.mit.edu/simile/www/2004/06/madsdata#<xsl:value-of
select="str:urlencode(topic)"/></xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:apply-templates/>
</rdf:Description>
</xsl:element>
</xsl:template>
but in the MADS schema you get
...
<xsd:attribute name="relatedType" use="optional">
...
so, if the attribute is not present, the XML is legal, but the
stylesheet wouldn't work.
--
Stefano.
Received on Monday, 7 June 2004 11:36:56 UTC