W3C home > Mailing lists > Public > public-rdf-ruby@w3.org > August 2011

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

From: Marcel Otto <marcelotto@gmx.de>
Date: Mon, 22 Aug 2011 11:31:44 +0200
Message-ID: <4E522200.4030800@gmx.de>
To: public-rdf-ruby@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 22 August 2011 09:32:49 GMT