query-78545a1c69c97393a1c9946113560348

rq turtle/ttl

Propertieshas part(s) (P527)instance of (P31)place of burial (P119)image of grave (P1442)reference URL (P854)stated in (P248)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?cemeteryLabel ?person ?personLabel ?statement  ?imggrave{ 
 wd:Q252312 wdt:P527 ?cemeteryPart.  # Norra Begravningsplatsen has parts 
 ?person wdt:P31 wd:Q5.
 {?person wdt:P119 ?cemeteryPart}
    UNION
 {?person wdt:P119 wd:Q252312}

 ?person wdt:P119 ?cemetery .
 ?person p:P119 ?statement .
 OPTIONAL {?statement prov:wasDerivedFrom ?ref .
            ?ref pr:P854 ?refUsed}
 OPTIONAL {?statement prov:wasDerivedFrom ?ref .
            ?ref pr:P248 ?refUsed}
 OPTIONAL {?person wdt:P1442 ?imggrave}
 SERVICE wikibase:label { bd:serviceParam wikibase:language "sv","en" }
 FILTER (!Bound(?refUsed))
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?cemetery") v2("?cemeteryPart") v7("?imggrave"):::projected v3("?person"):::projected v6("?ref") v1("?refUsed") v5("?statement"):::projected c14(["sv"]):::literal c15(["en"]):::literal c12(["bd:serviceParam"]):::iri c1(["wd:Q252312"]):::iri c4(["wd:Q5"]):::iri f0[["not bound(?refUsed)"]] f0 --> v1 c1 --"p:direct/P527"--> v2 v3 --"p:direct/P31"--> c4 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 --"p:direct/P119"--> c1 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"p:direct/P119"--> v2 end union0r <== or ==> union0l end v3 --"p:direct/P119"--> v4 v3 --"p:P119"--> v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."prov:wasDerivedFrom".-> v6 v6 --"p:reference/P854"--> v1 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."prov:wasDerivedFrom".-> v6 v6 --"p:reference/P248"--> v1 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P1442".-> v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 c12 --"wikibase:language"--> c15 end