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

RE: rdfms-literal-is-xml-structure: Yes, it is

From: Bill de hÓra <bdehora@interx.com>
Date: Thu, 12 Jul 2001 14:14:12 +0100
To: "RDF Core" <w3c-rdfcore-wg@w3.org>
Message-ID: <69B15B675E99D411A4110008C786DA2301368F1C@exwest_01.interx.com>

:>>>Aaron Swartz said:
:> On this issue I agree with Dan Connolly that an RDF literal with
:> XML content parses to the RDF representation of the XML infoset
:> for that literal.

+1 if it's in scope, but we'll have to talk about the presence of
content models and whitespace. Consider what would expected out
of these samples:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:foo="http://example.org/property/">
  <rdf:Description rdf:about="http://example.org/">
    <foo:bar rdf:parseType="literal"><el/> </foo:bar>
  </rdf:Description>
</rdf:RDF>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:foo="http://example.org/property/">
  <rdf:Description rdf:about="http://example.org/">
    <foo:bar rdf:parseType="literal"> <el attr1="v1" attr2="v2"/> </foo:bar>
  </rdf:Description>
</rdf:RDF>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:foo="http://example.org/property/">
  <rdf:Description rdf:about="http://example.org/">
    <foo:bar rdf:parseType="literal"><el>  </el></foo:bar>
  </rdf:Description>
</rdf:RDF>


: Dave Beckett:
:
:Try thinking about these questions for the attached examples:
: [...]
:My answers?
:  #1 is a sequence of Unicode characters OR
:        a sequence of XML characters (elements are forbidden)
:    I need to check XML / XML infoset for some appropriate
:term - CDATA?
:
:  #3, #4 are pieces of well formed XML (elements are allowed)
:  and cannot be distinguished - parseType has been lost.
:    It is not an XML document, or an XML Fragment[1]; and there are
:    more issues that could be pulled out with namespaces, entitiy
:    declarations etc.
:
:  #2 could be either, but more likely well formed XML and not
:an element


1.rdf:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:foo="http://example.org/property/">
  <rdf:Description rdf:about="http://example.org/" foo:bar="&lt;el/&gt;" />
</rdf:RDF>

result: [&lt;el/&gt;]

2.rdf:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:foo="http://example.org/property/">
  <rdf:Description rdf:about="http://example.org/">
    <foo:bar>&lt;el/&gt;</foo:bar>
  </rdf:Description>
</rdf:RDF>

result: [&lt;el/&gt;]


3.rdf:
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:foo="http://example.org/property/">
  <rdf:Description rdf:about="http://example.org/">
    <foo:bar rdf:parseType="literal"><el/></foo:bar>
  </rdf:Description>
</rdf:RDF>

result: [<el/>]

(ignoring that 'literal' is a syntax error and should be 'Literal')


<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:foo="http://example.org/property/">
  <rdf:Description rdf:about="http://example.org/">
    <foo:bar rdf:parseType="blah-blah"><el/></foo:bar>
  </rdf:Description>
</rdf:RDF>

result: syntax error.

Realistically,  I would expect this literal to come out in
blah-blah form; more specifically to be ignored and passed
onto something that manipulates blah-blah.

But I expect an rdf deserializer to barf. We don't have
productions that allow parseType="blah-blah", though
I doubt that any XML de/serializers are paying attention.
It's interesting that the prose surrounding the productions
in section 6 indicates that...

"""
The parseType attribute  should have one of the values
'Literal' or 'Resource'. ^^^^^^
"""

..and...

"""
Other values of parseType are reserved for
future specification by RDF.
"""

...but the productions seem to upgrade to a must...

"""
 [6.32] parseLiteral   ::= ' parseType="Literal"'
 [6.33] parseResource  ::= ' parseType="Resource"'
 [6.34] literal        ::= (any well-formed XML)
"""

...which is inconsistent overall.

[I don't think the RDF wg wants to become a parseType
legislation body. We could open this up and reserve
parseTypes beginning with say, 'rdf:'.]


:   Can all the information in the literal be preserved in the RDF
:   formal model, such that it can be reserialised to RDF/XML without
:   information loss?

I guess that users of the XML serialization SHOULD convert their
literal to infoset happy XML prior to RDF XML serialization and
MUST expect literals qualified with parseType="Literal" to be
deserialized to infoset. I suggest we say this explicitly.

Bill

----
Bill de hÓra  :  InterX  :  bdehora@interx.com
Received on Thursday, 12 July 2001 09:14:58 EDT

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