Re: DISTINCT in sparql definitions

Vladimir,

Yes, DISTINCT may be expensive, but it would be more expensive to
evaluate the constraints on the same node multiple times (and report
duplicate violations).

-- Arthur

On Fri, Oct 23, 2015 at 11:26 PM, Holger Knublauch
<holger@topquadrant.com> wrote:
> On 10/24/2015 11:01, Vladimir Alexiev wrote:
>>
>> http://w3c.github.io/data-shapes/shacl/#PropertyScope has this SPARQL
>> DEFINITION:
>>
>> SELECT DISTINCT ?this
>> WHERE {
>>         ?this $predicate ?any .
>> }
>>
>> (in total , DISTINCT occurs 7 times in the document)
>>
>> A problem I see is that if the result of this query is very large, doing
>> the
>> DISTINCT is expensive.
>> A more economic query would use
>>
>>     FILTER EXISTS {?this $predicate ?any}.
>>
>> But afaik, you can't make a query out of a FILTER only...
>
>
> Exactly this is the problem. FILTERs would not bind new values, but here we
> need to produce such bindings.
>
> Holger
>
>

Received on Thursday, 29 October 2015 20:27:59 UTC