query-c7425bc1224e6e4c4fc620c189824f1f
items authored by Ernest Hemingway (Q23434) SELECT ?work ?workLabel ?title ?languageLabel ?pubdate (GROUP_CONCAT(?typeLabel;SEPARATOR=", ") AS ?types) WHERE { ?work wdt:P50 wd:Q23434. OPTIONAL {?work wdt:P577 ?pubdate} OPTIONAL {?work wdt:P407 ?language} OPTIONAL {?work wdt:P1476 ?title} OPTIONAL { ?work wdt:P31 ?type . ?type rdfs:label ?typeLabel . FILTER(LANG(?typeLabel)="en") } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?work ?workLabel ?title ?pubdate ?languageLabel ORDER BY ?workLabel
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# items authored by Ernest Hemingway (Q23434)
SELECT ?work ?workLabel ?title ?languageLabel ?pubdate (GROUP_CONCAT(?typeLabel;SEPARATOR=", ") AS ?types)
WHERE {
?work wdt:P50 wd:Q23434.
OPTIONAL {?work wdt:P577 ?pubdate}
OPTIONAL {?work wdt:P407 ?language}
OPTIONAL {?work wdt:P1476 ?title}
OPTIONAL {
?work wdt:P31 ?type .
?type rdfs:label ?typeLabel .
FILTER(LANG(?typeLabel)="en")
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?work ?workLabel ?title ?pubdate ?languageLabel
ORDER BY ?workLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?language")
v4("?pubdate"):::projected
v6("?title"):::projected
v7("?type")
v2("?typeLabel"):::projected
v8("?types")
v3("?work"):::projected
v1("?workLabel"):::projected
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q23434"]):::iri
v3 --"wdt:P50"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P577".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P407".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P1476".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P31".-> v7
v7 --"rdfs:label"--> v2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind1[/"?typeLabel"/]
v2 --o bind1
bind1 --as--o v8