W3C home > Mailing lists > Public > semantic-web@w3.org > June 2006

Re: Literals, cwm and rapper

From: Henry Story <henry.story@bblfish.net>
Date: Wed, 7 Jun 2006 23:08:50 +0200
Message-Id: <B1118599-8C55-4D0D-B61B-8FAC3C144548@bblfish.net>
Cc: Dan Connolly <connolly@w3.org>
To: Semantic Web <semantic-web@w3.org>

Perhaps the content of an XMLLiteral has to be escaped in rdf/xml?  
neither rapper nor cwm can cope with that.

This is what I had the problem with originally, and it's still exists:

hjs@bblfish:0$ cat testOriginal.rdf
<rdf:RDF xmlns="http://www.w3.org/2005/10/23/Atom#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<Entry>
      <author>Henry</author>
      <content rdf:parseType="Resource"><type>text/xhtml</type>
             <value rdf:datatype="http://www.w3.org/1999/02/22-rdf- 
syntax-ns#XMLL
iteral"><div xmlns="http://www.w3.org/1999/xhtml"
 >
         <p><i>[Update: The Atom draft is finished.]</i>
                   </p>


                </div>
             </value>
       </content>
</Entry>
</rdf:RDF>

23:04:13 - ~/tmp/rdf
hjs@bblfish:0$ cwm.py --rdf testOriginal.rdf --n3
#Processed by Id: cwm.py,v 1.185 2006/05/30 21:08:05 syosi Exp
         #    using base file:/Users/hjs/tmp/rdf/testOriginal.rdf

#  Notation3 generation by
#       notation3.py,v 1.187 2006/01/13 14:48:54 syosi Exp

#   Base was: file:/Users/hjs/tmp/rdf/testOriginal.rdf
      @prefix : <http://www.w3.org/2005/10/23/Atom#> .

       [      a :Entry;
              :author "Henry";
              :content  [
                  :type "text/xhtml";
                  :value  [
                      a <http://www.w3.org/1999/xhtmldiv>;
                      <http://www.w3.org/1999/xhtmlp>  [
                          a <http://www.w3.org/1999/xhtmli> ] ] ] ].

#ENDS

23:07:23 - ~/tmp/rdf
hjs@bblfish:0$ rapper -i rdfxml testOriginal.rdf -o ntriples
rapper: Parsing file testOriginal.rdf
_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http:// 
www.w3.org/2005/10/23/Atom#Entry> .
_:genid1 <http://www.w3.org/2005/10/23/Atom#author> "Henry" .
_:genid2 <http://www.w3.org/2005/10/23/Atom#type> "text/xhtml" .
_:genid3 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http:// 
www.w3.org/1999/xhtmldiv> .
_:genid4 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http:// 
www.w3.org/1999/xhtmli> .
_:genid3 <http://www.w3.org/1999/xhtmlp> _:genid4 .
_:genid2 <http://www.w3.org/2005/10/23/Atom#value> _:genid3 .
_:genid1 <http://www.w3.org/2005/10/23/Atom#content> _:genid2 .
rapper: Parsing returned 8 statements



On 7 Jun 2006, at 22:53, Henry Story wrote:

> Attached is a little test I did with rapper and cwm concerning  
> Literals.
>
> I tried converting the following to N3
>
> <rdf:RDF xmlns="http://www.w3.org/2005/10/23/Atom#"
>          xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>          xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
>  <Entry>
>     <author>Henry</author>
>     <content rdf:parseType="Resource">
>        <type>text/xhtml</type>
>        <value rdf:parseType="Literal">
>           <div xmlns="http://www.w3.org/1999/xhtml">
>              <p><i>[Update: The Atom draft is finished.]</i></p>
>           </div>
>        </value>
>      </content>
>  </Entry>
> </rdf:RDF>
>
> Looks like both rapper and cwm convert correctly to turtle, but  
> rapper does a better job
> converting back, as it inserts the xml literals nicely as xml,  
> without escaping the content.
>
> Both do understand the XMLLiteral datatype in rdf/xml though. Don't  
> know why I had a problem with that earlier though. Perhaps that's  
> because I updated cwm to use the cvs version.
>
>
> Henry
>
>
> <terminal.txt>
>
>
Received on Wednesday, 7 June 2006 21:09:02 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 07:41:52 UTC