query-bf869771903492d556c26f4b1f7aba43
.on Mastodon and on TwitterOriginally posted 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#>
#defaultView:Timeline{ "hide": ["?publicationDate"] }
SELECT ?item (?title AS ?itemLabel) ?url ?publicationDate ?subject ?subjectLabel ?dead ?injured WHERE {
?item wdt:P179 wd:Q67365338;
wdt:P1476 ?title;
wdt:P953 ?url;
wdt:P577 ?publicationDate;
wdt:P921 ?subject.
OPTIONAL {
?subject wdt:P1120 ?dead_.
BIND(STRLANG(CONCAT(IF(wikibase:isSomeValue(?dead_), "unknown", STR(?dead_)), " dead"), "en") AS ?dead)
}
OPTIONAL {
?subject wdt:P1339 ?injured_.
BIND(STRLANG(CONCAT(IF(wikibase:isSomeValue(?injured_), "unknown", STR(?injured_)), " injured"), "en") AS ?injured)
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
- https://www.wikidata.org/wiki/User:TweetsFactsAndQueries/Queries-test-transclude
- https://www.wikidata.org/wiki/User:TweetsFactsAndQueries/Queries/%E2%80%98No_Way_To_Prevent_This,%E2%80%99_Says_Only_Nation_Where_This_Regularly_Happens_articles
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?dead"):::projected
v6("?dead_")
v9("?injured"):::projected
v8("?injured_")
v1("?item"):::projected
v10("?itemLabel")
v4("?publicationDate"):::projected
v5("?subject"):::projected
v2("?title"):::projected
v3("?url"):::projected
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q67365338"]):::iri
v1 --"wdt:P179"--> c2
v1 --"wdt:P1476"--> v2
v1 --"wdt:P953"--> v3
v1 --"wdt:P577"--> v4
v1 --"wdt:P921"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P1120".-> v6
bind0[/"STRLANG(concat(if(http://wikiba.se/ontology#isSomeValue(?dead_),'unknown',str(?dead_)),' dead'),'en')"/]
v6 --o bind0
bind0 --as--o v7
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P1339".-> v8
bind1[/"STRLANG(concat(if(http://wikiba.se/ontology#isSomeValue(?injured_),'unknown',str(?injured_)),' injured'),'en')"/]
v8 --o bind1
bind1 --as--o v9
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind2[/"?title"/]
v2 --o bind2
bind2 --as--o v10