Re: Circular transformation for RDF and n3

On Mon, 2003-06-23 at 11:21, Karl Dubost wrote:
> At 11:05 -0500 2003-06-23, Dan Connolly wrote:
> >  > but if n3 to RDF is not going well,
> >
> >it seems to be going fine.
> 
> 
> A n3 file:
> 
> ==================
>       @prefix h: <http://www.w3.org/1999/xhtml> .
>       @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
>       @prefix rss: <http://purl.org/rss/1.0/> .
> 
>      <http://www.example.org/>     a rss:channel;
>           rss:description """
>          <p>Ceci est un test</p>
> """ .
> ==================
> 
> karl% cwm -n3 foo.n3 -rdf > foo.rdf
> karl% more foo.rdf
> 
> ==================
> <!-- Processed by Id: cwm.py,v 1.129 2003/04/08 16:12:43 timbl Exp -->
> <!--     using base file:/Volumes/niu/karl/Sites/lagrange/foo.n3-->
> 
> <rdf:RDF xmlns:h="http://www.w3.org/1999/xhtml"
>      xmlns:log="http://www.w3.org/2000/10/swap/log#"
>      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>      xmlns:rss="http://purl.org/rss/1.0/">
> 
>      <rss:channel rdf:about="http://www.la-grange.net/">
>          <rss:description>
>          &#60;p&#62;Ceci est un test&#60;/p&#62;
> </rss:description>
>      </rss:channel>
> </rdf:RDF>
> ====================
> 
> 
> how do I use XSLT now to convert &#60;p&#62; in <p> to output in XHTML?

I don't recommend trying to do that...

> It's not fine for me, but I may be wrong in one option of cwm.
> 
> I would like something like
> 
> <rss:description>
>          <p>Ceci est un test</p>
> </rss:description>
> 
> or if xmlns:xhtml="http://www.w3.org/1999/xhtml"
> 
> <rss:description>
>          <xhtml:p>Ceci est un test</xhtml:p>
> </rss:description>

To represent that in N3, you'd write

  <http://www.example.org/> rss:description
"<p>...</p>"^^rdfs:XMLLiteral.

I'm not sure how well cwm's RDF/XML writer supports
XML Literals, though.

By the way... I wonder why N3 looks useful for the
task you're working on. For me, when I want to edit
documents, I like a direct-manipulation editor,
ala Amaya or mozilla composer. I use N3 as a
poor-man's user interface for much more structured data,
especially data that includes rules.

Are you thinking of using N3 rules somehow?

Even for somewhat structured stuff, I prefer to use
Amaya and scrape the data out with XSLT.
e.g. the travel schedule on my home page.

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/

Received on Monday, 23 June 2003 12:40:39 UTC