<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>I don’t think there’s any SPARQL function that can transform a
single result into multiple results (one for each string fragment,
in that case). But for your request, a regex works:</p>
<p><tt>SELECT ?human ?label WHERE {</tt><tt><br>
</tt><tt> ?human wdt:P31 wd:Q15632617;</tt><tt><br>
</tt><tt> rdfs:label ?label.</tt><tt><br>
</tt><tt> FILTER(LANG(?label) = "en")</tt><tt><br>
</tt><tt> FILTER(REGEX(?label, "y\\s"))</tt><tt><br>
</tt><tt>}</tt></p>
<p><a moz-do-not-send="true"
href="https://query.wikidata.org/#SELECT%20%3Fhuman%20%3Flabel%20WHERE%20%7B%0A%20%20%3Fhuman%20wdt%3AP31%20wd%3AQ15632617%3B%0A%20%20%20%20%20%20%20%20%20rdfs%3Alabel%20%3Flabel.%0A%20%20FILTER%28LANG%28%3Flabel%29%20%3D%20%22en%22%29%0A%20%20FILTER%28REGEX%28%3Flabel%2C%20%22y%5C%5Cs%22%29%29%0A%7D">Link</a></p>
On 18.09.2017 19:07, Thad Guidry wrote:<br>
<blockquote type="cite"
cite="mid:CAChbWaNq-asLsBvX4oZvdrkE9FwtKeT=b_p_UfR7q0T88JXe+A@mail.gmail.com">
<div dir="ltr">
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Say I have
this query...</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small"><span
class="gmail-k">SELECT</span> <span class="gmail-nv">?human</span>
<span class="gmail-nv">?label</span><br>
<span class="gmail-k">WHERE</span><br>
<span class="gmail-p">{</span><br>
<span class="gmail-nv">?human</span> <span
class="gmail-nn">wdt</span><span class="gmail-p">:</span><span
class="gmail-nt">P31</span> <span class="gmail-nn">wd</span><span
class="gmail-p">:</span><span class="gmail-nt">Q15632617</span><span
class="gmail-p">;</span> <span class="gmail-nn">rdfs</span><span
class="gmail-p">:</span><span class="gmail-nt">label</span>
<span class="gmail-nv">?label</span><span class="gmail-p">.</span><br>
<span class="gmail-k">FILTER</span><span class="gmail-p">(</span><span
class="gmail-nf">LANG</span><span class="gmail-p">(</span><span
class="gmail-nv">?label</span><span class="gmail-p">)</span>
<span class="gmail-o">=</span> <span class="gmail-s">"en"</span><span
class="gmail-p">).</span><br>
<span class="gmail-k">FILTER</span><span class="gmail-p">(</span><span
class="gmail-nf">STRSTARTS</span><span class="gmail-p">(</span><span
class="gmail-nv">?label</span><span class="gmail-p">,</span>
<span class="gmail-s">"Mr. "</span><span class="gmail-p">)).</span><br>
<span class="gmail-p">}</span></div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">What if I
wanted to see if any one of a humans name ends with "y" such
as my last name does , their first, last, doesn't matter. I
have a "d" and a "y" on the array returned from my name (if it
were split by whitespace)</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">I did not see
any special syntax or FILTER or Label service commands to help
with splitting apart a Label by whitespace and then applying a
filter on each string.</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">
<div class="gmail_default" style="font-size:small">How would I
accomplish this ? </div>
</div>
<div class="gmail_default" style="font-size:small"><br
clear="all">
</div>
<div>
<div class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">Thad
<div class="gmail_default"
style="font-size:small;display:inline"></div>
<div><a href="https://www.google.com/+ThadGuidry"
target="_blank" moz-do-not-send="true">+ThadGuidry</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Wikidata mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Wikidata@lists.wikimedia.org">Wikidata@lists.wikimedia.org</a>
<a class="moz-txt-link-freetext" href="https://lists.wikimedia.org/mailman/listinfo/wikidata">https://lists.wikimedia.org/mailman/listinfo/wikidata</a>
</pre>
</blockquote>
<br>
</body>
</html>