That's great! Thanks a lot.
By the way,
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.

This is not working because there's not :
FILTER(LANG(?label) = "en").
As it's explained later in the example apparently.

Thanks again!


On 02/04/18 23:45, Jeremy Baron wrote:
so that's trying to filter the given name item not the label of the
given 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