https://www.wikidata.org/wiki/Wikidata:SPARQL_tutorial#FILTER that try to do FILTER(STRSTARTS(?humanLabel, "Mr. ")). the first one is broken but I assume it used to work.
FILTER
(
LANG
(
?label
)
=
"en"
).
As it's explained later in the example apparently.On 02/04/18 23:45, Jeremy Baron wrote:
so that's trying to filter the given name item not the label of thegiven name item. there's a few examples at https://www.wikidata.org/wiki/Wikidata:SPARQL_tutorial#FILTER that try to do FILTER(STRSTARTS(?humanLabel, "Mr. ")). the first one is broken but I assume it used to work. adapt the second "Mr. " example there and I get: SELECT DISTINCT ?person ?personLabel ?givenNameLabel ?gnlabel WHERE { ?person wdt:P31 wd:Q5. ?person wdt:P735 ?givenName. ?givenName rdfs:label ?gnlabel. FILTER(LANG(?gnlabel) = "[AUTO_LANGUAGE]"). FILTER(STRSTARTS(?gnlabel, "A")) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } that times out even with LIMIT 5. but if I test with a smaller dataset (fictional humans) it appears to be written properly: SELECT DISTINCT ?person ?personLabel ?givenNameLabel ?gnlabel WHERE { ?person wdt:P31 wd:Q15632617. ?person wdt:P735 ?givenName. ?givenName rdfs:label ?gnlabel. FILTER(LANG(?gnlabel) = "[AUTO_LANGUAGE]"). FILTER(STRSTARTS(?gnlabel, "A")) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } http://tinyurl.com/ydzdywmw -Jeremy _______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata