Subject: Re: [xsl] Transform RDF to CSV files|
From: "oknam park" <ponda7777@xxxxxxxxxxx>
Date: Mon, 19 Mar 2007 21:24:14 +0000
Thanks for your wonderful tips and fast response. -Oknam
From: Abel Braaksma <abel.online@xxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] Transform RDF to CSV files Date: Mon, 19 Mar 2007 22:20:36 +0100
oknam park wrote:
I have experienced transforming XML files to CSV by XSLT. But, have no ideas how to transform RDF to CSV.
Well, in short, RDF is XML, so you can use your experience with XML to transform it to CSV.
Of course, there is no such thing as RDF to CSV, because RDF is a layered hierarchical format, and CSV is flat non-hierarchical, not even relational. So, just replying "do xyz to transform RDF to CSV" won't get you there.
Here's a small example of an RDF file from xml.com: http://www.xml.com/pub/a/2001/01/24/rdf.html
<ex:tv_show rdf:about="http://www.example.org/law_and_order_ci" />
<ex:similar_plot_as rdf:resource="http://www.example.org/the_matrix" />
Now, to get the rdf:Description node, you can write something like this:
<xsl:template match="rdf:Description"> <xsl:sequence select="@rdf:about"> <xsl:text>,</xsl:text> </xsl:template>
But that is only one column. You will have to find out for yourself what data for what requirements goes into what column. Then we can help you to sort out what kind of XPaths you can use to process the RDF feeds or documents into those CSV fields.
Cheers, -- Abel Braaksma http://www.nuntia.nl