[redland-dev] python: RDF.Model.to_string() -> None

Dave Beckett dave.beckett at bristol.ac.uk
Fri Apr 15 12:32:33 BST 2005


On Tue, 12 Apr 2005 10:48:20 -0500, Darrin Thompson <darrint at progeny.com> wrote:

> Using the python bindings:
> 
> $ python
> Python 2.3.5 (#2, Feb  9 2005, 00:38:15)
> [GCC 3.3.5 (Debian 1:3.3.5-8)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import RDF
> >>> m = RDF.Model()
> >>> print m.to_string(name='ntriples')
> None
> >>> print m.to_string(name='xml')
> None
> >>> print m.to_string()
> <?xml version="1.0" encoding="utf-8"?>
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> </rdf:RDF>
> 
> Shouldn't the output of to_string() for an empty model always be
> parsable and result in an empty model?

Yeah, I suppose.  The first one should return "" but there is no syntax
called "xml" so None is ok.  The last one is an empty model.

I've noted it as http://bugs.librdf.org/mantis/view.php?id=21

Dave


More information about the redland-dev mailing list