query-bdbe2d94c01c1f33f534c142ec6fc492
TODO
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 bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?itemLabel ?authorLabel ?genreLabel ?item
WHERE
{
?item wdt:P31/wdt:P279* wd:Q571 ; #books and subclasses of book
wdt:P136 ?genre ; #genre of the book
wdt:P50 ?author . #author of the book
?author wdt:P21 wd:Q6581072 . #author is female
{{?item wdt:P136 wd:Q26928598 .} union {?item wdt:P136 wd:Q7252 .} union {?item wdt:P136 wd:Q12132683 .}} #book is a science-fiction novel, a distopia or about feminism
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,es". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?author")
v2("?genre")
v1("?item"):::projected
a1((" "))
c7(["wd:Q6581072"]):::iri
c8(["wd:Q26928598"]):::iri
c9(["wd:Q7252"]):::iri
c14(["en,es"]):::literal
c12(["bd:serviceParam"]):::iri
c3(["wd:Q571"]):::iri
c10(["wd:Q12132683"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P136"--> v2
v1 --"wdt:P50"--> v3
v3 --"wdt:P21"--> c7
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P136"--> c10
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P136"--> c9
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P136"--> c8
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end