query-db918be94e3f16a7bfac0aa72791bd12
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?dob (GROUP_CONCAT(distinct ?occupationLabel;separator="; ") as ?occuption) WHERE {
VALUES ?state {wd:Q1223 wd:Q824}
{?item wdt:P19/wdt:P131* ?state. }
UNION
{?item wdt:P551/wdt:P131* ?state. }
UNION
{?item wdt:P20/wdt:P131* ?state. }
?item wdt:P31 wd:Q5;
wdt:P172 wd:Q49085;
wdt:P106 ?occupation.
OPTIONAL { ?item wdt:P569 ?dob. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr,it".
?occupation rdfs:label ?occupationLabel .
?item rdfs:label ?itemLabel .}
} group by ?item ?itemLabel ?dob ORDER BY (?dob)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?dob"):::projected
v3("?item"):::projected
v6("?itemLabel"):::projected
v4("?occupation")
v5("?occupationLabel"):::projected
v7("?occuption")
v2("?state")
a1((" "))
a2((" "))
a3((" "))
c14(["en,fr,it"]):::literal
c12(["bd:serviceParam"]):::iri
c6(["wd:Q5"]):::iri
c8(["wd:Q49085"]):::iri
bind0[/VALUES ?state/]
bind0-->v2
bind00(["wd:Q1223"])
bind00 --> bind0
bind01(["wd:Q824"])
bind01 --> bind0
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;
v3 --"wdt:P20"--> a3
a3 --"wdt:P131"--> v2
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P551"--> a2
a2 --"wdt:P131"--> v2
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P19"--> a1
a1 --"wdt:P131"--> v2
end
union0r <== or ==> union0l
end
v3 --"wdt:P31"--> c6
v3 --"wdt:P172"--> c8
v3 --"wdt:P106"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P569".-> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
v4 --"rdfs:label"--> v5
v3 --"rdfs:label"--> v6
end
bind2[/"?occupationLabel"/]
v5 --o bind2
bind2 --as--o v7