query-d368b521c485205de44a3b88421d3847

rq turtle/ttl


Jüngsten Personen (geboren oder gestorben in Dresden)

---------------------------------------------------------------------------------------

SELECT distinct ?item ?itemLabel ?itemDescription ?age ?pobLabel ?podLabel {

?item wdt:P1196 wd:Q8454 .

?item wdt:P1399 [] .

{?item wdt:P19 wd:Q1731} union {?item wdt:P20 wd:Q1731}

?item p:P569 [ a wikibase:BestRank ; psv:P569 [ wikibase:timeValue ?birth; wikibase:timePrecision ?precision_birth ] ] . ?item p:P570 [ a wikibase:BestRank ; psv:P570 [ wikibase:timeValue ?death; wikibase:timePrecision ?precision_death ] ] . FILTER (?precision_birth > 8 && ?precision_death > 8) BIND ((?death - ?birth)/365.25 AS ?age) #FILTER (?age <= 18.5)

optional {?item wdt:P19 ?pob. } optional {?item wdt:P20 ?pod. } SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en"} } ORDER BY ?age limit 50

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#---------------------------------------------------------------------------------------
# Jüngsten Personen (geboren oder gestorben in Dresden)
#---------------------------------------------------------------------------------------
SELECT distinct ?item ?itemLabel ?itemDescription ?age ?pobLabel ?podLabel {
#  ?item wdt:P1196 wd:Q8454 . 
# ?item wdt:P1399 [] .

  {?item wdt:P19 wd:Q1731}
  union
  {?item wdt:P20 wd:Q1731}

  ?item p:P569 [ a wikibase:BestRank ;
                 psv:P569 [ wikibase:timeValue ?birth;
                            wikibase:timePrecision ?precision_birth ] ] .
  ?item p:P570 [ a wikibase:BestRank ;
                 psv:P570 [ wikibase:timeValue ?death;
                            wikibase:timePrecision ?precision_death ] ] . 
  FILTER (?precision_birth > 8 && ?precision_death > 8) 
  BIND ((?death - ?birth)/365.25 AS ?age) 
  #FILTER (?age <= 18.5)

  optional {?item wdt:P19 ?pob. }
  optional {?item wdt:P20 ?pod. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en"}
} ORDER BY ?age
limit 50

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?age"):::projected v5("?birth") v6("?death") v4("?item"):::projected v7("?pob") v8("?pod") v2("?precision_birth") v3("?precision_death") a1((" ")) a2((" ")) a3((" ")) a4((" ")) c6(["wikibase:BestRank"]):::iri c14(["bd:serviceParam"]):::iri c16(["de,en"]):::literal c3(["wd:Q1731"]):::iri f0[["?precision_birth > '8^^xsd:integer'?precision_death > '8^^xsd:integer'"]] f0 --> v2 f0 --> v3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v4 --"p:direct/P20"--> c3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v4 --"p:direct/P19"--> c3 end union0r <== or ==> union0l end a1 --"a"--> c6 a2 --"wikibase:timeValue"--> v5 a2 --"wikibase:timePrecision"--> v2 a1 --"p:statement/value/P569"--> a2 v4 --"p:P569"--> a1 a3 --"a"--> c6 a4 --"wikibase:timeValue"--> v6 a4 --"wikibase:timePrecision"--> v3 a3 --"p:statement/value/P570"--> a4 v4 --"p:P570"--> a3 bind1[/"?death - ?birth / '365.25^^xsd:decimal'"/] v6 --o bind1 v5 --o bind1 bind1 --as--o v7 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P19".-> v7 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P20".-> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end