Nicolas,

This is close to what I am needing and wanting.
But how to get record rows for each word within a label ?
It would be amazing if the Wikidata Label service already had the wiring to perform that and we could ask for "words" from each label.

Thoughts on how to do with without the enhancement request for the Label service ?


On Mon, Sep 18, 2017 at 12:49 PM, Nicolas VIGNERON <vigneron.nicolas@gmail.com> wrote:
Hi

[snip]
 
>
> 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.
>
> How would I accomplish this ?

Maybe with the function STRAFTER https://www.w3.org/TR/sparql11-query/#func-strafter

Example of use:

SELECT ?item ?itemLabel ?itemLabelafter WHERE {
    ?item  wdt:P19 wd:Q647 ; rdfs:label ?itemLabel.
    FILTER (lang(?itemLabel) = "fr").
    BIND ( STRAFTER(?itemLabel, " ") AS ?itemLabelafter )
}
LIMIT 10

Cdlt, ~nicolas

_______________________________________________
Wikidata mailing list
Wikidata@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata