Mailing list ARC-DEV: Archives

Re: [arc-dev] LOAD broken?

From: Will Daniels 
Subject: Re: [arc-dev] LOAD broken?
Date: Sun, 06 Sep 2009 20:36:02 +0300


https://code.launchpad.net/~wdaniels/+junk/arc

Regards,
Will

Will Daniels wrote:
> Well, I debugged this and it turned out that the problem was since I
> started using keep_bnode_ids = true in the query call. Which led me to a
> line in runQuery that passes the call to runQuery on the
> ARC2_StoreLoadQueryHandler class:
> 
>   function runQuery($infos, $type, $keep_bnode_ids = 0, $q = '') {
>     ARC2::inc('Store' . ucfirst($type) . 'QueryHandler');
>     $cls = 'ARC2_Store' . ucfirst($type) . 'QueryHandler';
>     $h =& new $cls($this->a, $this);
>     $ticket = 1;
>     if ($q && ($type == 'select')) $ticket = $this->getQueueTicket($q);
> **    $r = $ticket ? $h->runQuery($infos, $keep_bnode_ids) : array();
>     if ($q && ($type == 'select')) $this->removeQueueTicket($ticket);
>     $trigger_r = $this->processTriggers($type, $infos);
>     return $r;
>   }
> 
> This seems to be mismatched with the actual parameters of that function:
> 
>   function runQuery($infos, $data = '', $keep_bnode_ids = 0) {
> 
> ...such that when $keep_bnode_ids = true, $data actually gets set
> instead, and thus it is trying to read the wrong type of stream, does
> not get any headers, hence no format identified, leading finally to the
> "no loader available" error.
> 
> All seems to be working fine after fixing that.
> 
> Regards,
> Will
> 
> 
> Will Daniels wrote:
>> Hi,
>>
>> Would somebody mind confirming for me whether LOAD is working properly
>> in the latest ARC (bzr revision 8)? A simple example:
>>
>> LOAD <http://dbpedia.org/resource/Charles_Dickens>
>>
>> ....tells me...
>>
>> No loader available for "http://dbpedia.org/resource/Charles_Dickens":
>> in ARC2_StoreLoadQueryHandler
>>
>> Same with all sites that I've tried. I started to debug this and found
>> that it's not getting the format from the stream headers in
>> ARC2_Reader::getFormat:
>>
>> $mtype = $this->v('format', '', $this->stream['headers']);
>>
>> Here, $this->stream['headers'] is just an empty array, so it doesn't get
>> any MIME type etc. But it would take me quite some time to dig into all
>> the code before this that actually reads the stream, so I just wanted to
>> ask if anybody can confirm that it should be working, or if somebody
>> knows of any obvious configuration mishap that might stop this working
>> properly (it always used to work fine when I was last playing with ARC,
>> and I'm sure I didn't change anything except to update the ARC code with
>> the latest version).
>>
>> Thanks,
>> Will
>>
>