query-fbe6d3570ba006f21d74be829f8e753d
&& which gives me a list of names similar to the given name "Franz". I could work with this for the price of having to query each given name separately., e.g. accessing only items with label="Franz" or getting all in one query? 20:58, 14 April 2024 (UTC)) talk (Herzi PinkiIs there any smarter solution? best --19:42, 16 April 2024 (UTC)) talk (Vincent TepWhat I cannot explain though is that this only works if the label service line is wrapped in an OPTIONAL clause, otherwise this approach fails too. . This query returns 48,861 hits in about 40 seconds.like thisYour first query doesn't time out if you turn off the label service. In order to get the labels, you can wrap your query in a WITH clause, and then use the label service in the main part of your query, ,Herzi PinkiHello @12:01, 17 April 2024 (UTC)) talk (Vincent Tepyour initial query works fine when you disable the label service. Maybe you can do this (retrieve only item IDs), and then make a separate call/query to get their labels? 09:51, 17 April 2024 (UTC)) talk (Herzi PinkiI want to embed the query in a script to check gender against names, so a static .csv will not really help. best -- 06:41, 17 April 2024 (UTC)) talk (Vincent TepI tried it multiple times and it timed out once too. I suggest you try again. If it doesn't work I can send you a .csv of the results. 22:36, 16 April 2024 (UTC)) talk (Herzi Pinki: a lot of not straightforward tricks. and it still times out for me. :-( thanks anyhow --Vincent Tep@splendid idea:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel
WHERE {
?item rdfs:label ?itemLabel .
FILTER (LANG(?itemLabel) = "de").
VALUES ?item {
wd:Q741
wd:Q923
wd:Q1557
wd:Q4642
wd:Q20164
wd:Q20790
wd:Q24223
wd:Q29884
wd:Q37080
wd:Q42771
}.
SERVICE wikibase:label { bd:serviceParam wikibase:language 'de' }
}
Query found at
- https://www.wikidata.org/wiki/User:Herzi_Pinki/Sparql
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2024/04