query-4c5f28383bd9446d58322c5b174dd160

rq turtle/ttl

to work: seems: It seems that when either part of the UNION in that query is excluded, the query runs. So I split both criteria into separate subqueries (with some other modifications) and it Gamaliel@ ]reply[17:28, 2 June 2020 (UTC) )talk( Gamaliel: The query works, but it only returns 797 items, while the last time Listeria successfully ran the query, it returned 3331 items. Mahir256@]reply[17:51, 2 June 2020 (UTC)) talk (Mahir256: It is easy to forget that query service lag exists. Gamaliel@ ]reply[17:44, 2 June 2020 (UTC) )talk( Gamaliel to that item but it didn't change the results. Is there a way to get the query to pull multiple occupations from that qualifier? (Q715301)comics artist . I added (Q65183699)Wikipedia:WikiProject Women in Red/Missing articles by occupation/Cartoonists : It looks like the list is pulling the occupation from Mahir256@ ]reply[17:36, 2 June 2020 (UTC) )talk( Gamaliel might have some insight. TagishsimonI don't know unfortunately. Maybe ]reply[17:34, 2 June 2020 (UTC)) talk (Mahir256). Would you happen to know how such de-linkages might have occurred? (Q24204895)art director , and (Q3024627)editorial cartoonist , (Q1114448)cartoonist : It seems, then, that some occupations previously returned in the "%i" subquery got lost (that part I did not change, and all that subquery returns are Gamaliel@

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT DISTINCT ?item ?linkcount ?lambiekurl
where
{
  { { SELECT ?item ?linkcount { 
   {
  select ?occ WHERE { VALUES ?occ {
    wd:Q715301  # comics artists
    wd:Q1114448 # cartoonists 
  }
  }
}
    {?item wdt:P106/wdt:P279* ?occ .}                            # item has this occupation
  MINUS { ?item wdt:P5035 ?lambiek } # those in the Comiclopedia omitted here, since it will be returned in the other subquery
  MINUS {?wen schema:about ?item ; schema:isPartOf <https://en.wikipedia.org/> . } # has no en.wikipedia sitelink
  ?item wdt:P21 wd:Q6581072 .                      # gender is female
  ?item wdt:P31 wd:Q5 .                            # instance is human
  ?item wikibase:sitelinks ?linkcount .            # number of sitelinks for the item
  }
}} UNION { { SELECT ?item ?linkcount ?lambiekurl { 
   {
  select ?occ WHERE { VALUES ?occ {
    wd:Q715301  # comics artists
    wd:Q1114448 # cartoonists 
  }
  }
}
  ?item wdt:P5035 ?lambiek.  BIND ((CONCAT ("[https://www.lambiek.net/artists/", ?lambiek, ".htm entry]")) as ?lambiekurl) . # is in the Lambiek Comiclopedia
  MINUS {?wen schema:about ?item ; schema:isPartOf <https://en.wikipedia.org/> . } # has no en.wikipedia sitelink
  ?item wdt:P21 wd:Q6581072 .                      # gender is female
  ?item wdt:P31 wd:Q5 .                            # instance is human
  ?item wikibase:sitelinks ?linkcount .            # number of sitelinks for the item
  }
}}
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v3("?lambiek") v6("?lambiekurl"):::projected v5("?linkcount"):::projected v6("?occ") v4("?wen") a1((" ")) c6([https://en.wikipedia.org/]):::iri c10(["wd:Q5"]):::iri c8(["wd:Q6581072"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; bind0[/VALUES ?occ/] bind0-->v6 bind00(["wd:Q715301"]) bind00 --> bind0 bind01(["wd:Q1114448"]) bind01 --> bind0 v2 --"wdt:P5035"--> v3 bind1[/"concat('#91;https://www.lambiek.net/artists/',?lambiek,'.htm entry#93;')"/] v3 --o bind1 bind1 --as--o v6 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v4 --"schema:about"--> v2 v4 --"schema:isPartOf"--> c6 end v2 --"wdt:P21"--> c8 v2 --"wdt:P31"--> c10 v2 --"wikibase:sitelinks"--> v5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; bind3[/VALUES ?occ/] bind3-->v6 bind30(["wd:Q715301"]) bind30 --> bind3 bind31(["wd:Q1114448"]) bind31 --> bind3 v2 --"wdt:P106"--> a1 a1 --"wdt:P279"--> v6 subgraph minus4["MINUS"] style minus4 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P5035"--> v3 end subgraph minus5["MINUS"] style minus5 stroke-width:6px,fill:pink,stroke:red; v4 --"schema:about"--> v2 v4 --"schema:isPartOf"--> c6 end v2 --"wdt:P21"--> c8 v2 --"wdt:P31"--> c10 v2 --"wikibase:sitelinks"--> v5 end union0r <== or ==> union0l end