W3C home > Mailing lists > Public > w3c-rdfcore-wg@w3.org > July 2003

Re: first pass parseType="Literal" text for primer

From: Frank Manola <fmanola@mitre.org>
Date: Wed, 23 Jul 2003 10:26:13 -0400
Message-ID: <3F1E9B05.6060807@mitre.org>
To: Brian McBride <bwm@hplb.hpl.hp.com>
CC: rdf core <w3c-rdfcore-wg@w3.org>, Martin Duerst <duerst@w3.org>, i18n <w3c-i18n-ig@w3.org>

Brian--

I have both some editorial comments and some technical comments about this.

Editorial comments:

Putting this as a section 4.5 seems OK.  This will have us covering 
parseType="Literal" in 4.5, and we already cover parsetype="Collection" 
in 4.2.  As I've already mentioned, we probably in that case should 
cover parseType="Resource" too, but this can easily be added to 4.4 (and 
there's already an example there that uses it, so all I have to do is 
point out what it does).  All I need to do then is add a forward 
reference from the typed literal section (2.4) and a brief mention to 
these types of "other facilities" at the beginning of Section 4.

I think we're going to have to explain a bit further what the "need for 
care" is at the bottom of the example.  It might not jump out at someone 
right away.  Also, I wonder about calling this stuff "rich text";  it 
might remind people of rtf, and that's not what we're talking about.

I also think we need to say something explicitly about xml:lang.  A 
couple of examples use it already (even before we introduce this new 
one), but since one of the issues surrounding this material has been 
xml:lang, we probably should say something about it.

Technical comments:

1.  Your example uses HTML, but according to the definition of 
XMLLiteral, the value is supposed to be XML.  We could say XHTML instead 
of XML, but I think we also need to say something explicitly about 
handling HTML (and any other non-XML stuff that looks like markup). 
People might think they can put any old markup in there, and get a surprise.

2.  What happens if someone, instead of using parsetype="Literal", 
writes an element with markup content as a regular typed literal with an 
rdf:datatype attribute value of rdf:XMLLiteral?  I would assume this is 
supposed to work the same way as writing parsetype="Literal", and the 
element content needs to obey the same rules, but we don't explicitly 
say anything about it (either saying it's allowed, and it works the same 
way, or explicitly forbidding it).  Syntax doesn't seem to explicitly 
cover this case either.

--Frank


Brian McBride wrote:

> 4.5 parseType="Literal"
> 
> The RDF/XML syntax is designed to make it easy for the values of
> properties to be fragments of XML.  Whilst this feature is may be used
> with arbritary fragments of XML, it was designed specifically to enable
> the values of properties to be rich text represented as XML markup.
> 
> For example, A publisher might maintain RDF meta data that includes the
> titles of books and articles.  Whilst such titles are often just simple
> strings of characters, this is not always the case.  The titles of books
> on mathematics may contain mathematical formulae, that could be
> represented using MathML [@@REF].  Titles may include HTML markup.
> 
> For example  [@@complete namespaces etc]:
> 
>   <rdf:Description>
>     <dc:title rdf:parseType="Literal">  <!-- @@spelling? -->
>       <span xml:lang="en">
>         The <em>&lt;br /&gt;</em> Element Considered Harmful.
>       </span>
>     </dc:title>
>   </rdf:Description>
> 
> describes a graph containing one triple:
> 
>   _:a <dc:title> " \
>       <span xml:lang="en" xmlns:dc="@@"> \ 
>         The <em>&lt;br /&gt;</em> Element Considered Harmful. \
>       </span>"^^rdf:XMLLiteral .  # @@ needs checking
> 
> The rdf:parseType="Literal" attribute in the RDF/XML indicates that all
> the XML within the <dc:title> element is an XML fragment that is the
> value of the dc:title property.
> 
> The value of the property is a typed literal, whose datatype,
> rdf:XMLLiteral is defined by RDF, specifically to represent fragments of
> XML.  The XML fragment is canonicalized according to the XML Exclusive
> Canonicalization recommendation [@@ref].  This causes declarations of
> used namespaces to be added to the fragment, the escaping of reserved
> characters such as '<', '>' and '&', and possibly, the re-ordering of
> attributes.  Contextual attributes, such as xml:lang and xml:base are
> not inherited from the RDF/XML document, and, if required, must, as
> shown in the example, be explicitly specified in the XML fragment.
> 
> This example illustrates that designers should take care when designing
> RDF data.  In cases where the value of a property may sometimes contain
> rich text and sometimes not, the designer should either use
> rdf:parseType="Literal" throughout, or design the application to handle
> both plain literals and rdf:XMLLiteral's.
> 
> 
> 


-- 
Frank Manola                   The MITRE Corporation
202 Burlington Road, MS A345   Bedford, MA 01730-1420
mailto:fmanola@mitre.org       voice: 781-271-8147   FAX: 781-271-875
Received on Wednesday, 23 July 2003 10:05:59 EDT

This archive was generated by hypermail pre-2.1.9 : Wednesday, 3 September 2003 09:58:46 EDT