query-058927c83576dc5488090617feb9c0e8

rq turtle/ttl

Recent deaths nearby without Commons pic

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:People recently buried in a cemetery nearby without an image of the grave (P1442) on Wikidata
#defaultView:Map{"hide":["?coor"]}
#by Jura1, 2021-11-0, source: https://www.wikidata.org/wiki/Property_talk:P1442#Queries
SELECT ?item ?itemLabel ?itemDescription ?date_of_death ?cemetery ?cemeteryLabel ?coor ?commons_category_which_may_include_one ?findagrave ?img_person ?img_cemetery WHERE {
  ?item wdt:P119 ?cemetery.
  ?cemetery wdt:P31 wd:Q39614.
  ?item wdt:P570 ?date_of_death.
  FILTER(?date_of_death > "2010-01-01"^^xsd:dat)
  FILTER(NOT EXISTS { ?item p:P1442 _:b0. })
  ?cemetery wdt:P625 ?coor.
  FILTER(NOT EXISTS {
    ?cemetery wdt:P625 ?c2.
    FILTER((STR(?coor)) > (STR(?c2)))
  })
  OPTIONAL {
    ?item wdt:P373 ?cat.
    BIND(URI(CONCAT("https://commons.wikimedia.org/wiki/Category:", ?cat)) AS ?commons_category_which_may_include_one)
  }
  OPTIONAL {
    ?item wdt:P535 ?fid.
    wd:P535 wdt:P1630 ?ff.
    BIND(URI(REPLACE(?ff, "\\$1", ?fid)) AS ?findagrave)
  }
  OPTIONAL { ?item wdt:P18 ?img_person. }
  FILTER(NOT EXISTS {
    ?item wdt:P18 ?i2.
    FILTER((STR(?i2)) > (STR(?img_person)))
  })
  OPTIONAL { ?cemetery wdt:P18 ?img_cemetery. }
  FILTER(NOT EXISTS {
    ?cemetery wdt:P18 ?i3.
    FILTER((STR(?i3)) > (STR(?img_cemetery)))
  })
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,fr". }
  ?cemetery wdt:P131* wd:Q915.
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?c2") v10("?cat") v3("?cemetery"):::projected v11("?commons_category_which_may_include_one"):::projected v7("?coor"):::projected v9("?date_of_death"):::projected v13("?ff") v12("?fid") v14("?findagrave"):::projected v4("?i2") v1("?i3") v2("?img_cemetery"):::projected v5("?img_person"):::projected v6("?item"):::projected a1((" ")) c16(["#91;AUTO_LANGUAGE#93;,en,fr"]):::literal c18(["wd:Q915"]):::iri c14(["bd:serviceParam"]):::iri c11(["wd:P535"]):::iri c7(["wd:Q39614"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0f0[["str(?i3) > str(?img_cemetery)"]] e0f0 --> e0v1 e0f0 --> e0v2 e0v3 --"p:direct/P18"--> e0v1 e0v3("?cemetery"):::projected e0v1("?i3"):::projected e0v2("?img_cemetery"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> v2 f0 --> v3 f0 --> c1 f1[["str(?i3) > str(?img_cemetery)"]] f1 --> v1 f1 --> v2 v3 --"p:direct/P18"--> v1 f2[["not "]] subgraph f2e1["Exists Clause"] e1f0[["str(?i2) > str(?img_person)"]] e1f0 --> e1v1 e1f0 --> e1v2 e1v3 --"p:direct/P18"--> e1v1 e1v1("?i2"):::projected e1v2("?img_person"):::projected e1v3("?item"):::projected end f2--EXISTS--> f2e1 f2 --> v4 f2 --> v5 f2 --> v6 f2 --> c1 f3[["str(?i2) > str(?img_person)"]] f3 --> v4 f3 --> v5 v6 --"p:direct/P18"--> v4 f4[["not "]] subgraph f4e2["Exists Clause"] e2f0[["str(?coor) > str(?c2)"]] e2f0 --> e2v1 e2f0 --> e2v2 e2v3 --"p:direct/P625"--> e2v2 e2v2("?c2"):::projected e2v3("?cemetery"):::projected e2v1("?coor"):::projected end f4--EXISTS--> f4e2 f4 --> v7 f4 --> v8 f4 --> v3 f4 --> c2 f5[["str(?coor) > str(?c2)"]] f5 --> v7 f5 --> v8 v3 --"p:direct/P625"--> v8 f6[["not "]] subgraph f6e3["Exists Clause"] e3v1 --"p:P1442"--> e3a1 e3v1("?item"):::projected e3a1((" ")):::projected end f6--EXISTS--> f6e3 f6 --> v6 f6 --> c3 f6 --> a1 v6 --"p:P1442"--> a1 f7[["?date_of_death > s2010-01-01^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f7 --> v9 v6 --"p:direct/P119"--> v3 v3 --"p:direct/P31"--> c7 v6 --"p:direct/P570"--> v9 v3 --"p:direct/P625"--> v7 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P373".-> v10 bind8[/"concat('https://commons.wikimedia.org/wiki/Category:',?cat)"/] v10 --o bind8 bind8 --as--o v11 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P535".-> v12 c11 --"p:direct/P1630"--> v13 bind9[/"replace(?ff,'\$1',?fid)"/] v13 --o bind9 v12 --o bind9 bind9 --as--o v14 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P18".-> v5 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P18".-> v2 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end v3 --"p:direct/P131"--> c18