query-570428a510e6d25ff4127f5ae39e886a
Query times out. Why?Hello! I have been trying to get the most frequent occupations for females on the Arabic Wikipedia. I found an example query and tried to modify it but the modified version always gets timed out upon running. Here is the example query: #Most frequent occupations without a label in a given language #added before 2016-10 #Most frequent occupations without a label in Latvian (lv) #by Edgars2007/Jura1, 2016-05-09 SELECT ?occup ?occupLabel ?count WHERE { { SELECT ?occup (COUNT(?person) as ?count) WHERE { ?person wdt:P106 ?occup } GROUP BY ?occup ORDER BY DESC(?count) LIMIT 1000 } OPTIONAL {?occup rdfs:label ?label1 filter(lang(?label1) = "lv")} FILTER(!BOUND(?label1)) SERVICE wikibase:label { bd:serviceParam wikibase:language "en,es,pl,ja,zh,ru" } } ORDER BY DESC(?count) LIMIT 50 And here is the one I tried to modify: #Most frequent occupations without a label in a given language #added before 2016-10 #Most frequent occupations without a label in Latvian (lv) #by Edgars2007/Jura1, 2016-05-09 SELECT ?occup ?occupLabel ?count ?female ?femaleLabel WHERE { { SELECT ?occup (COUNT(?person) AS ?count) WHERE { ?person wdt:P106 ?occup. } GROUP BY ?occup ORDER BY DESC(?count) LIMIT 1000 } OPTIONAL { ?occup rdfs:label ?label1. FILTER((LANG(?label1)) = "ar") } SERVICE wikibase:label { bd:serviceParam wikibase:language "en,es,pl,ja,zh,ru". } FILTER(!BOUND(?label1)) ?female wdt:P21 wd:Q6581072. } ORDER BY DESC(?count) LIMIT 50 14:42, 7 October 2018 (UTC)) talk (Reem Al-KashifDid I do something wrong?--
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
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 ?occup ?occupLabel ?count ?female ?femaleLabel WHERE {
{
SELECT ?occup (COUNT(?person) AS ?count) WHERE { ?person wdt:P106 ?occup. }
GROUP BY ?occup
ORDER BY DESC(?count)
LIMIT 1000
}
OPTIONAL { ?occup rdfs:label ?label1. FILTER((LANG(?label1)) = "ar")
}
FILTER(!BOUND(?label1))
?female wdt:P106 ?occup .
?female wdt:P21 wd:Q6581072.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,es,pl,ja,zh,ru". }
}
LIMIT 50
Query found at
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2018/10
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2018/11