query-a1c78792469d06be0c2803971d274501

rq turtle/ttl

Female German-language science-fiction writers. The article got deleted, then reinstated, it got a certain amount of publicity and the discussion became heated and political. I tried to create such a list with a Wikidata query but I'm having a hard time getting the largest possible number of matches. After all, not all articles are using the precisely identical statements. female science-fiction authors writing in GermanI just came across a discussion about a list article in the German Wikipedia which tries to collect There is an occupation "science fiction writer", but the query could also use author plus genre science fiction (or an arbitrary sub-genre of sci-fi). The language part can be accomplished using "native language" and "language spoken".Maybe there are additional ways to express German plus science fiction writer that I don't know. I'm also having a hard time using the union feature of SPARQL. Here's what I currenly have, I've tried various combinations of what I have put into comments:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?person ?personLabel ?dob ?dod WHERE
{
  ?person wdt:P31 wd:Q5.
  ?person wdt:P21 wd:Q6581072.
  # ?person wdt:P136 wd:Q24925.
  # ?person wdt:P136/wdt:P279 wd:Q24925.
  # {?person wdt:P103 wd:Q188} union {?person wdt:P1412 wd:108}.
  # ?person wdt:P106 wd:Q18844224
  optional {?person wdt:P569 ?dob}
  optional {?person wdt:P570 ?dod}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?dob"):::projected v3("?dod"):::projected v1("?person"):::projected c8(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal c4(["wd:Q6581072"]):::iri v1 --"wdt:P31"--> c2 v1 --"wdt:P21"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P569".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P570".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end