[redland-dev] Possible bug: parsing with 'guess' parser and supplying a base URI always parses as RDF/XML?

Dave Beckett dave at dajobe.org
Mon Jun 19 04:53:09 BST 2006


Arjan Wekking wrote:
> On 5-mei-2006, at 14:48, Arjan Wekking wrote:

     ^^^^^^^^^^
as you can see I'm catching up

>> Hi Redland developers (Dave ;),
>>
>> I've found something when using Redland that might be a bug, or not,
>> since I'm not 100% sure whether it is, so I thought i'd send a mail to
>> the dev list first before I open an actual bug report.
>>
>> What happens is that I want to 'guess' parse a file, a turtle (.ttl)
>> file in this case, which works fine, as long as I do not supply a base
>> URI. When I do supply, the parser assumes it is RDF/XML (or XML at
>> least) and the whole 'guess' parser seems to be ignored. A workaround
>> is for me to guess for the parser (filename ends with .ttl, assume
>> 'turtle', etc) but that kinda makes the whole 'guess' parser rather
>> useless.
>>
>> The thing i'm not sure of is whether this is normal behaviour or not
>> (when supplying a base URI, assume RDF/XML, or something like that),
>> because there might be some arcane reason for doing this (dont have
>> the time to investigate further).
> 
> Well, I looked around a bit in the guess parser's gut, and it appears
> that the URI on which the format is guessed (one that ends in .ttl to
> get a turtle parser) is replaced by the base URI when there is one
> present, otherwise the original source URI is used. Apparently this is
> by design since raptor_parse_uri() has a description that implies the
> same thing:

Yes it is by design and is the correct behaviour as documented.

> <snip/>

Having thought about it for a while, I think it's confusing and the
wrong behaviour, it should do a new guess each time.  I've created a
tracking bug for this issue
http://bugs.librdf.org/mantis/view.php?id=91

Dave



More information about the redland-dev mailing list