Re: [xsl] Transform RDF to CSV files

Subject: Re: [xsl] Transform RDF to CSV files
From: Abel Braaksma <>
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

<rdf:RDF xmlns:rdf="";
<rdf:Description rdf:about="";>
<ex:tv_show rdf:about=""; />
<rdf:Description rdf:about="";>
<ex:similar_plot_as rdf:resource=""; />

Now, to get the rdf:Description node, you can write something like this:

<xsl:template match="rdf:Description">
  <xsl:sequence select="@rdf:about">

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.

-- Abel Braaksma

Current Thread