Re: iana mime types as rdfs:Datatype ?

On 23 Jun 2006, at 14:04, Ivan Herman wrote:

>>
>> [] :content [ a :Content;
>>               :value "<b>hello</b>"^^ianatxt:html ] .
>>
>
> I see a practical issue with this example. If one uses an RDF/XML
> encoding and turtle, then the parser will have a problem with your
> example, unless 'value' is declared to be rdf:XMLLiteral, which is a
> datatype itself.... The second option could probably work as:
>
> [] :content [ a :Content;
>               :type ianatxt:html;
>               :value "<b>hello</b>"^^rdf:XMLLiteral ] .

Mhh I tried converting the following

-----------
@prefix : <https://sommer.dev.java.net/atom/2006-06-06/AtomOwl.n3#> .
@prefix ianatxt: <http://www.iana.org/assignments/relation/text/>.

[] :title "<div>hello<p>well formed html but <b>bad</b> xhtml</ 
div>"^^ianatxt:html .
-----------

using rapper and I got this

-----------
hjs@bblfish:0$ rapper -i turtle test.n3 -o rdfxml
rapper: Parsing file test.n3
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:ianatxt="http://www.iana.org/assignments/relation/ 
text/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"  
xmlns="https://sommer.dev.java.net/atom/2006-06-06/AtomOwl.n3#">
   <rdf:Description rdf:nodeID="genid1">
     <title rdf:datatype="http://www.iana.org/assignments/relation/ 
text/html">&lt;div&gt;hello&lt;p&gt;well formed html but  
&lt;b&gt;bad&lt;/b&gt; xhtml&lt;/div&gt;</title>
   </rdf:Description>
</rdf:RDF>
-----------

which is what I would expect: not knowing that the content of that  
datatype is correct xml it escaped it. On the other hand the cwm from  
cvs seems to barf on "cwm.py test.n3 --rdf".

Of course this cuts both ways, as clearly it will react the same way  
to xhtml content (ianatxt:xhtml).
It would be nice to be able to specify that ianatxt:xhtml is a  
subclass of rdf:XMLLiteral so that such tools could use this  
knowledge to avoid escaping their content.


Henry

Received on Friday, 23 June 2006 12:28:03 UTC