query-90ca81babfc50a838d8a27421e9264ba

rq turtle/ttl

German-language female science fiction authors SELECT DISTINCT ?author ?authorLabel ?dateOfBirth ?dateOfDeath WHERE { ?author wdt:P31 wd:Q5; wdt:P21/wdt:P279 wd:Q6581072. # speaks/writes German, or citizen of Germany, Austria or Liechtenstein (since “languages spoken, written or signed” alone is not very complete; Swiss citizenship would probably include too many French- or Italian-writing authors) { ?author wdt:P1412 wd:Q188. } UNION { VALUES ?country { wd:Q183 wd:Q40 wd:Q347 } ?author wdt:P27 ?country. } # genre science fiction, or occupation science fiction author, or genre science fiction as qualifier on occupation author statement { ?author wdt:P136/wdt:P279 wd:Q24925. } UNION { ?author wdt:P106/wdt:P279 wd:Q28225718. } UNION { ?author p:P106 [ a wikibase:BestRank; ps:P106/wdt:P279 wd:Q482980; pq:P136/wdt:P279* wd:Q24925 ]. } OPTIONAL { ?author wdt:P569 ?dateOfBirth. } OPTIONAL { ?author wdt:P570 ?dateOfDeath. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# German-language female science fiction authors
SELECT DISTINCT ?author ?authorLabel ?dateOfBirth ?dateOfDeath WHERE {
  ?author wdt:P31 wd:Q5;
          wdt:P21/wdt:P279* wd:Q6581072.
  # speaks/writes German, or citizen of Germany, Austria or Liechtenstein (since “languages spoken, written or signed” alone is not very complete; Swiss citizenship would probably include too many French- or Italian-writing authors)
  {
    ?author wdt:P1412 wd:Q188.
  } UNION {
    VALUES ?country { wd:Q183 wd:Q40 wd:Q347 }
    ?author wdt:P27 ?country.
  }
  # genre science fiction, or occupation science fiction author, or genre science fiction as qualifier on occupation author statement
  {
    ?author wdt:P136/wdt:P279* wd:Q24925.
  } UNION {
    ?author wdt:P106/wdt:P279* wd:Q28225718.
  } UNION {
    ?author p:P106 [
      a wikibase:BestRank;
      ps:P106/wdt:P279* wd:Q482980;
      pq:P136/wdt:P279* wd:Q24925
    ].
  }
  OPTIONAL { ?author wdt:P569 ?dateOfBirth. }
  OPTIONAL { ?author wdt:P570 ?dateOfDeath. }
  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; v1("?author"):::projected v2("?country") v3("?dateOfBirth"):::projected v4("?dateOfDeath"):::projected a1((" ")) a2((" ")) a3((" ")) a4((" ")) a5((" ")) a6((" ")) c10(["wd:Q24925"]):::iri c14(["wikibase:BestRank"]):::iri c5(["wd:Q6581072"]):::iri c22(["bd:serviceParam"]):::iri c16(["wd:Q482980"]):::iri c2(["wd:Q5"]):::iri c24(["#91;AUTO_LANGUAGE#93;,en"]):::literal c12(["wd:Q28225718"]):::iri c7(["wd:Q188"]):::iri v1 --"p:direct/P31"--> c2 v1 --"p:direct/P21"--> a1 a1 --"p:direct/P279"--> c5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; bind0[/VALUES ?country/] bind0-->v2 bind00(["wd:Q183"]) bind00 --> bind0 bind01(["wd:Q40"]) bind01 --> bind0 bind02(["wd:Q347"]) bind02 --> bind0 v1 --"p:direct/P27"--> v2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P1412"--> c7 end union0r <== or ==> union0l end subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; a4 --"a"--> c14 a4 --"p:statement/P106"--> a5 a5 --"p:direct/P279"--> c16 a4 --"p:qualifier/P136"--> a6 a6 --"p:direct/P279"--> c10 v1 --"p:P106"--> a4 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P106"--> a3 a3 --"p:direct/P279"--> c12 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P136"--> a2 a2 --"p:direct/P279"--> c10 end union1r <== or ==> union1l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P569".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P570".-> v4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c22 --"wikibase:language"--> c24 end