oh very nice! SAMPLE is really interesting for my use case :)
Thank you for the hint.

 
 

Sent: Tuesday, April 24, 2018 at 2:26 PM
From: "Osma Suominen" <[email protected]>
To: [email protected]
Subject: Re: [sparql] Return only one property of many with the same name
Hi Laura!

If LIMIT is not applicable (e.g. you want to query for many similar
resources in one query), you can also consider using SAMPLE (with a
GROUP BY).

If you want to make the choice deterministic, you can use LIMIT together
with ORDER BY.

-Osma

Laura Morales kirjoitti 24.04.2018 klo 15:23:
> Yeah I'd prefer one over the other, but I don't think there is any simple way 
> to distinguish them, I think multiple values are just supposed to be 
> unordered.
> I'll end up using LIMIT or DISTINCT. Thank you.
>
>
>
> Sent: Tuesday, April 24, 2018 at 2:12 PM
> From: ajs6f <[email protected]>
> To: [email protected]
> Subject: Re: [sparql] Return only one property of many with the same name
> Do you care about which one?
>
> If not, just use the LIMIT keyword to get only one. Otherwise, it's going to 
> depend on which one you want and how you want to distinguish them.
>
> ajs6f
>
>> On Apr 24, 2018, at 5:54 AM, Laura Morales <[email protected]> wrote:
>>
>> If I have this node
>>
>> :Alice :name "Alice", "Alice Smith" ;
>> :age 25 .
>>
>> how can I return *only one* of the ":name" properties with SPARQL? For 
>> example return ("Alice", 25)
>
>

--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Kaikukatu 4)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
[email protected]
http://www.nationallibrary.fi

Reply via email to