query-6b7b2fd7a15880648fd8b05b7dff9e8e
Odia literary works, 624 items @10 JUN 2021 SELECT ?item ?statements ?itemLabel ?itemDescription ?genreLabel ?writerLabel ?goodread ?openlibr WHERE { VALUES ?book {wd:Q7725634 wd:Q571} # ?item is a literary work ?item wdt:P31 ?book. ?item wdt:P407 wd:Q33810. # language is odia OPTIONAL { ?item wdt:P50 ?writer } OPTIONAL { ?item wdt:P136 ?genre } OPTIONAL { ?item wdt:P2969 ?goodread } OPTIONAL { ?item wdt:P9648 ?openlibr } ?item wikibase:statements ?statements . # count statements SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en" } # for generating label } ORDER BY DESC(?statements)
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#>
# Odia literary works, 624 items @10 JUN 2021
SELECT ?item ?statements ?itemLabel ?itemDescription ?genreLabel ?writerLabel ?goodread ?openlibr
WHERE {
VALUES ?book {wd:Q7725634 wd:Q571} # ?item is a literary work
?item wdt:P31 ?book.
?item wdt:P407 wd:Q33810. # language is odia
OPTIONAL { ?item wdt:P50 ?writer }
OPTIONAL { ?item wdt:P136 ?genre }
OPTIONAL { ?item wdt:P2969 ?goodread }
OPTIONAL { ?item wdt:P9648 ?openlibr }
?item wikibase:statements ?statements . # count statements
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en" } # for generating label
}
ORDER BY DESC(?statements)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?book")
v5("?genre")
v6("?goodread"):::projected
v3("?item"):::projected
v7("?openlibr"):::projected
v1("?statements"):::projected
v4("?writer")
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;, en"]):::literal
c3(["wd:Q33810"]):::iri
bind0[/VALUES ?book/]
bind0-->v2
bind00(["wd:Q7725634"])
bind00 --> bind0
bind01(["wd:Q571"])
bind01 --> bind0
v3 --"wdt:P31"--> v2
v3 --"wdt:P407"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P50".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P136".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P2969".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P9648".-> v7
end
v3 --"wikibase:statements"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end