[redland-dev] Model serialization bug

Christopher Schmidt crschmidt at crschmidt.net
Tue Jan 4 16:13:34 PST 2005


On Tue, Jan 04, 2005 at 10:43:20PM +0000, Dave Beckett wrote:

> However, I found some dubious memory use in raptor_free_statement
> (and elsewhere in raptor_rss.c which you aren't using here).
> 
> I've made an updated patch against 1.4.3 as released, attached.
> 
> With this, 'print m' should work.  At least it works for me ;)

"Works" in this case is a relative term: it no longer crashes, 
segfaults, or exits in any other dubious ways. However, I still don't 
get any data out of it:

#!/usr/bin/python2.3
import RDF
p = RDF.Parser()
m = RDF.Model()
p.parse_into_model(m, RDF.Uri("http://crschmidt.net/foaf.rdf"))
print m

[crschmidt at peanut ~]$ python fail.py
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:atom="http://purl.org/atom/ns#" 
xmlns:dc="http://purl.org/dc/elements/1.1/" 
xmlns:enc="http://purl.oclc.org/net/rss_2.0/enc#" 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:rss091="http://purl.org/rss/1.0/modules/rss091#" 
xmlns="http://purl.org/rss/1.0/">
</rdf:RDF>

In other words, the data is not actually being serialized. It looks 
somewhat like the RSS 1.0 serializer is being used by default rather 
than the RDF/XML serializer. For example, serializing 
http://danbri.org/foaf.rdf :

<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:atom="http://purl.org/atom/ns#" 
xmlns:dc="http://purl.org/dc/elements/1.1/" 
xmlns:enc="http://purl.oclc.org/net/rss_2.0/enc#" 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:rss091="http://purl.org/rss/1.0/modules/rss091#" 
xmlns="http://purl.org/rss/1.0/">
  <channel rdf:about="http://www.glandscape.com/cgi-bin/prnxml.rss">
    <title>Channel of Filth</title>
  </channel>

</rdf:RDF>

To test, I tried to use the Serializer class: however, with both 
name="ntriples" and mime_type="application/rdf+xml" , nothing happens: 
no error message, but no file writing either.

As it stands, I can't serialize with either the to_string method or the 
Serializer class. However, I don't seem to be able to produce any memory 
errors, so it's getting better, at least.

-- 
Christopher Schmidt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.gnomehack.com/pipermail/redland-dev/attachments/20050104/976edb29/attachment-0001.pgp


More information about the redland-dev mailing list