[redland-dev] [Raptor RDF Syntax Library 0000598]: librdf_serializer_serialize_model_to_file doesn't group related statements together

Mantis Bug Tracker mantis-bug-sender at librdf.org
Fri Jun 5 14:30:41 EDT 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://bugs.librdf.org/mantis/view.php?id=598 
====================================================================== 
Reported By:                sbpcs59
Assigned To:                
====================================================================== 
Project:                    Raptor RDF Syntax Library
Issue ID:                   598
Category:                   api
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Syntax Name:                 
====================================================================== 
Date Submitted:             2015-06-05 11:30
Last Modified:              2015-06-05 11:30
====================================================================== 
Summary:                    librdf_serializer_serialize_model_to_file  doesn't
group related statements together
Description: 
The redland serializer doesn't group RDF subjects together as described at
http://www.w3.org/TR/rdf-syntax-grammar/#section-Syntax-multiple-property-elements.

Grouping subjects together isn't a requirement of the W3C recommendation, but it
makes documents alot
easier to visually inspect them without having to translate them to another
format.

I've looked for serializer options to group subjects or similiar, but haven't
found one for this.

An example of this behavior can be seen when parsing the following document into
librdf model,
then serializing it back out again.

Here is the input document:


<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:dc="http://purl.org/dc/elements/1.1/">
  <rdf:Description rdf:about="http://www.dajobe.org/">
    <dc:title>Dave Beckett's Home Page</dc:title>
    <dc:creator>Dave Beckett</dc:creator>
    <dc:description>The generic home page of Dave Beckett.</dc:description>
  </rdf:Description> 
</rdf:RDF>

And the serialize document:


<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xml:base="http://example.org/base.rdf">
  <rdf:Description rdf:about="http://www.dajobe.org/">
    <dc:description>The generic home page of Dave Beckett.</dc:description>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.dajobe.org/">
    <dc:title>Dave Beckett's Home Page</dc:title>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.dajobe.org/">
    <dc:creator>Dave Beckett</dc:creator>
  </rdf:Description>
</rdf:RDF>

Granted, having RDF statements grouped together is just an enhancement, but it
sure would
make visual verification of serialzed RDF models easier.


Steps to Reproduce: 
read in the sample input model

write it out to disk using librdf_serializer_serialize_model_to_file 

inspect output
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-06-05 11:30 sbpcs59        New Issue                                    
======================================================================



More information about the redland-dev mailing list