- From: Dave Beckett <dave.beckett@bristol.ac.uk>
- Date: Wed, 13 Nov 2002 11:00:31 +0000
- To: Jonathan Borden <jonathan@openhealth.org>
- Cc: WWW-Tag <www-tag@w3.org>
>>>Jonathan Borden said: > What I want to do is this: > > <rddl:description rdf:parseType="Literal" rdf:datatype="&xhtml;Flow.mix" > xmlns="&xhtml;"> > <h1>Some typed XML</h1> > <p>This is an example of typed XML. It is intended to validate according > to xhtml:Flow.mix. Now if RDF allowed this I might actually have a prayer of > writing a document that could be RDF and which I could incorporate valid > snippets of RDF, e.g. fragements of XHTML. > </p> > <p><b>Perhaps you have a different solution to this use case.</b></p> > </rddl:description> > > However this isn't legal RDF as you don't allow typed XML literals. We do. RDF typed literals are a pair of (datatype URI-ref, unicode string lexical form) [ignoring lang for now] -- http://www.w3.org/TR/rdf-concepts/#dfn-typed-literal and we defined a single datatype URI-ref for lexical forms that are of the XML literal type, rdfs:XMLLiteral. In the RDF/XML, rdf:parseType="Literal" attribute is a synonym for rdf:datatype="&rdfs;XMLLiteral" plus it makes the parser allow any XML element content inside the element, since the parser is an XML parser. I'm assuming the latter is what you care about. The question is always, what does it look like in the RDF graph, written as triples? Here you have two slots to fill as the object typed literal node (datatype URI-ref, unicode string lexical form) It is certainly possible that we could allow rdf:parseType="Literal" to generate that lexical form for you (from serialization of the XML infoset of the content), and rdf:datatype to give you the URI-reference. However, would you be surprised if the serialization of such a triple to a new RDF/XML file, gave you this? <rddl:description rdf:datatype="&xhtml;Flow.mix"> <h1 xmlns="&xhtml">Some typed XML</h1> <p xmlns="&xhtml">This is an example of typed XML. It is intended to validate according to xhtml:Flow.mix. Now if RDF allowed this I might actually have a prayer of writing a document that could be RDF and which I could incorporate valid snippets of RDF, e.g. fragements of XHTML. </p> <p xmlns="&xhtml"><b>Perhaps you have a different solution to this use case.</b></p> </rddl:description> (I'm faking this somewhat, you might have to expand the xmlns URIs, it might also have to be canonicalized XML) This is because the indication that this came from a rdf:parseType="Literal" type syntax, is not recorded in the RDF typed literal. It would need an extra isXML flag, and a subsequent change to the RDF model so that every (typed) literal had that flag. Dave
Received on Wednesday, 13 November 2002 06:03:56 UTC