How do I get RDF.rb to produce RDF collections in RDF/XML with a rdf:parseType="Collection" serialisation

Hi,

I've loaded a RDF/XML file with a collection (by 
rdf:parseType="Collection") into a RDF.rb graph and looked at the 
containing statement, consisting of equivalent rdf:first and rdf:rest 
triples. If I write this graph back to a RDF/XML file, I get the proper 
serialisation with rdf:parseType="Collection" back. But if I build it 
manually, I only get a serialisation of the rdf:first and rdf:rest 
triples back (not rdf:parseType="Collection" serialisation; note, that 
writing the same graph to a N3 file, produces a nice serialisation with 
parantheses).

Is there a way to get the RDF/XML writer to produce a rdf:parseType 
serialisation with a manually built graph?

I am aware of the fact, that both serialisations are equivalent, 
according to the RDF specification, but it looks so ugly, and given the 
importance of collections for OWL, an OWL ontology becomes almost 
unreadable.

By the way: I've also tried RDF::List, but this seems to be unusable 
with RDF/XML, since if I try to write it, I get a "RDF::WriterError: 
Attempt to serialize #<RDF::List...>, not supported in RDF/XML".

Thanks in advance
Marcel

Received on Monday, 22 August 2011 09:32:48 UTC