tripod icon indicating copy to clipboard operation
tripod copied to clipboard

Serialization of Resource and ResourceCollection yields database queries.

Open muratseyhan opened this issue 10 years ago • 2 comments

I have noticed that the serialization methods (to_rdf, to_ttl etc.) for Resource and ResourceCollection objects hit the database to retrieve resources that are previously loaded. Apart from the performance issues, this also means that the resources that are not persisted in the database cannot be serialized.

Is there perhaps a specific reason behind this, such as making sure that the output is consisted with the persisted data?

muratseyhan avatar Feb 13 '15 13:02 muratseyhan

This is because rdf.rb is really slow at parsing and serialising lots of data, so the principle here was to let the database do the work.

ricroberts avatar Feb 13 '15 14:02 ricroberts

Ah, that makes much more sense now. Thanks!

Serialization of ResourceCollection objects fails in some cases, due to the use of broken CONSTRUCT queries produced by _describe_query_for_select.

muratseyhan avatar Feb 13 '15 15:02 muratseyhan