query-31946c0ca7ff793b33670eaeeef8a48c

rq turtle/ttl

TODO

Use at

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#>
SELECT DISTINCT ?subj ?subjLabel ?dob ?dod ?place ?placeLabel ?layer ?coord
# re-use results
WHERE {
  {
     {
  SELECT DISTINCT ?place ?coord WHERE {
    ?place wdt:P131* wd:Q11943 .
    ?place wdt:P625 ?coord .
  }
}    ?subj wdt:P19 ?place .
    bind("birth place" as ?layer)
    OPTIONAL { ?subj wdt:P569 ?dob. filter(!wikibase:isSomeValue(?dob)) }
  } UNION {
     {
  SELECT DISTINCT ?place ?coord WHERE {
    ?place wdt:P131* wd:Q11943 .
    ?place wdt:P625 ?coord .
  }
}    ?subj wdt:P20 ?place.
    bind("death place" as ?layer)
    OPTIONAL { ?subj wdt:P570 ?dod. filter(!wikibase:isSomeValue(?dod))  }
  } UNION {
     {
  SELECT DISTINCT ?place ?coord WHERE {
    ?place wdt:P131* wd:Q11943 .
    ?place wdt:P625 ?coord .
  }
}    ?subj wdt:P551 ?place.
    bind("residence" as ?layer)
  } UNION {
     {
  SELECT DISTINCT ?place ?coord WHERE {
    ?place wdt:P131* wd:Q11943 .
    ?place wdt:P625 ?coord .
  }
}    ?subj wdt:P1321 ?place.
    bind("place of origin" as ?layer)
  } UNION {
     {
  SELECT DISTINCT ?place ?coord WHERE {
    ?place wdt:P131* wd:Q11943 .
    ?place wdt:P625 ?coord .
  }
}    ?subj wdt:P937 ?place.
    bind("work location" as ?layer)
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?coord"):::projected v1("?dob"):::projected v6("?dod"):::projected v7("?layer"):::projected v2("?place"):::projected v4("?subj"):::projected c12(["bd:serviceParam"]):::iri c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2(["wd:Q11943"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c2 v2 --"wdt:P625"--> v3 v4 --"wdt:P937"--> v2 bind0[/"'work location'"/] bind0 --as--o v7 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c2 v2 --"wdt:P625"--> v3 v4 --"wdt:P1321"--> v2 bind1[/"'place of origin'"/] bind1 --as--o v7 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c2 v2 --"wdt:P625"--> v3 v4 --"wdt:P551"--> v2 bind2[/"'residence'"/] bind2 --as--o v7 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c2 v2 --"wdt:P625"--> v3 v4 --"wdt:P20"--> v2 bind3[/"'death place'"/] bind3 --as--o v7 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P570".-> v6 end end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> c2 v2 --"wdt:P625"--> v3 v4 --"wdt:P19"--> v2 bind4[/"'birth place'"/] bind4 --as--o v7 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P569".-> v1 end end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end