On Tue, 24 May 2011 19:16:13 +0200, Kingsley Idehen
<kide...@openlinksw.com> wrote:

> On 5/24/11 1:08 PM, Curran Kelleher wrote:
>> Greetings,
>>
>> The problem remains, the following query doesn't execute on the public
>> DBPedia endpoint
>> <http://dbpedia.org/snorql/?query=select+distinct+%3Fproperty+where+%7B%0D%0A+++++%3Fs+%3Fproperty+%3Fo.%0D%0A%7D+limit+1>,
>> even with a limit:
>>
>> select distinct ?property where {
>>      ?s ?property ?o.
>> } limit 1
>>
>> Without 'distinct' it does work:
>>
>> select ?property where {
>>      ?s ?property ?o.
>> } limit 1
>>
>> Why might this be?
>
> Because Distinct requires more work.
>
>> Shouldn't the engine be able to work this one out quickly even with
>> 'distinct', as it needs to only traverse a single triple to compute
>> the result?
>
> Really? First encounter != distinct :-)
>> It seems the engine is doing some unnecessary computation to do with
>> 'distinct' and is timing out because of it.
>
> LIMIT doesn't simply the Distinct computation. It simply limits the
> resultset size.
>
> Kingsley
---------------------------------------------------------------------
Don't know much about history,
don't know much biology,
don't know much about people 'very experienced with DBMS oriented data'
but I do know SOMETIHING LIKE this:

here again the same with a small correction of my algorithm
for general case:

a.) read SPARQL query
b.) set limit:= {1, ..., MAX}
c.) set distinct:= {true, false}
d.) set i:=1
e.) compute result item i, if none, set i:=i-1 and break
f.) if distinct is true and comparing i'th item with
     previous result-items results true, goto e.)
g.) store i'th item to result-set
h.) if i == limit, then break
i.) set i:= i+1
j.) GOTO e.)
k.) send the result-set to Baran

And here i am, thanks.

This is a general(!) algorithm with the rationality of a tramp,
if LIMIT is 1, for DISTINCT the engine should require nothing,
but.. i know, you mean rationality is not elitist enough...

Baran

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to