query-1c4061f4f87665a4587fab345ea9c923
doesn't timeout: LIMIT and no hint:Prior hint:gearing "forward": This version with Jura1@
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
?person ?personLabel ?personDescription
?occupations
?politics ?business ?sports ?arts
( (BOUND(?politics) || BOUND(?business) || BOUND(?sports) || BOUND(?arts)) as ?any)
WHERE
{
{
SELECT
?person (GROUP_CONCAT(DISTINCT ?p106label;SEPARATOR=", ") AS ?occupations)
WHERE
{
?person wdt:P172 wd:Q726673.
OPTIONAL { ?person wdt:P106 ?p106 . ?p106 rdfs:label ?p106label . FILTER(lang(?p106label)='sv') }
?person wdt:P31 wd:Q5.
}
GROUP BY ?person
}
OPTIONAL { ?person wdt:P106/wdt:P279* wd:Q82955 . BIND("y" as ?politics) }
OPTIONAL { ?person wdt:P106/wdt:P279* wd:Q43845 . BIND("y" as ?business) }
OPTIONAL { ?person wdt:P106/wdt:P279* wd:Q2066131 . BIND("y" as ?sports) }
OPTIONAL { ?person wdt:P106/wdt:P279* wd:Q483501 . BIND("y" as ?arts) }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],sv,fi,en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v9("?any")
v8("?arts"):::projected
v6("?business"):::projected
v4("?occupations"):::projected
v3("?p106")
v1("?p106label")
v2("?person"):::projected
v5("?politics"):::projected
v7("?sports"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
c3(["wd:Q726673"]):::iri
c12(["wd:Q483501"]):::iri
c9(["wd:Q82955"]):::iri
c10(["wd:Q43845"]):::iri
c11(["wd:Q2066131"]):::iri
c14(["bd:serviceParam"]):::iri
c16(["#91;AUTO_LANGUAGE#93;,sv,fi,en"]):::literal
c7(["wd:Q5"]):::iri
v2 --"wdt:P172"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P106".-> v3
v3 --"rdfs:label"--> v1
end
v2 --"wdt:P31"--> c7
bind1[/"?p106label"/]
v1 --o bind1
bind1 --as--o v4
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P106".-> a1
a1 --"wdt:P279"--> c9
bind2[/"'y'"/]
bind2 --as--o v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P106".-> a2
a2 --"wdt:P279"--> c10
bind3[/"'y'"/]
bind3 --as--o v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P106".-> a3
a3 --"wdt:P279"--> c11
bind4[/"'y'"/]
bind4 --as--o v7
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P106".-> a4
a4 --"wdt:P279"--> c12
bind5[/"'y'"/]
bind5 --as--o v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c14 --"wikibase:language"--> c16
end
bind6[/"(bound(?politics) || (bound(?business) || (bound(?sports) || bound(?arts))))"/]
v5 --o bind6
v6 --o bind6
v7 --o bind6
v8 --o bind6
bind6 --as--o v9