query-f98f12452d3c24175c5b2cbba60f3dac
Propertiessubclass of (P279)
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item
(group_concat(distinct ?institutionType1_en;separator="; ") as ?institutionTypes1_en)
(group_concat(distinct ?institutionType2_en;separator="; ") as ?institutionTypes2_en)
(group_concat(distinct ?institutionType3_en;separator="; ") as ?institutionTypes3_en)
(group_concat(distinct ?institutionType4_en;separator="; ") as ?institutionTypes4_en)
?Label_en
(group_concat(distinct ?Alias_en;separator="; ") as ?Aliases_en) #Concatenate the values in order not to get several rows per item.
?Label_de
(group_concat(distinct ?Alias_de;separator="; ") as ?Aliases_de)
WHERE {
{?item wdt:P279+ wd:Q33506} UNION {?item wdt:P279+ wd:Q166118} UNION {?item wdt:P279+ wd:Q7075}.
OPTIONAL { ?item rdfs:label ?Label_en . FILTER (lang(?Label_en) = "en") }
OPTIONAL { ?item rdfs:label ?Label_de . FILTER (lang(?Label_de) = "de") }
OPTIONAL { ?item skos:altLabel ?Alias_en . FILTER (lang(?Alias_en) = "en") }
OPTIONAL { ?item skos:altLabel ?Alias_de . FILTER (lang(?Alias_de) = "de") }
OPTIONAL { ?item wdt:P279+ ?institutionType1 . ?institutionType1 wdt:P279/^wdt:P279 wd:Q33506 . ?institutionType1 rdfs:label ?institutionType1_en . FILTER (lang(?institutionType1_en) = "en") }
OPTIONAL { ?item wdt:P279+ ?institutionType1 . ?institutionType1 wdt:P279/^wdt:P279 wd:Q166118 . ?institutionType1 rdfs:label ?institutionType1_en . FILTER (lang(?institutionType1_en) = "en") }
OPTIONAL { ?item wdt:P279+ ?institutionType1 . ?institutionType1 wdt:P279/^wdt:P279 wd:Q7075 . ?institutionType1 rdfs:label ?institutionType1_en . FILTER (lang(?institutionType1_en) = "en") }
OPTIONAL { ?item wdt:P279+ ?institutionType2 . ?institutionType2 wdt:P279 wd:Q33506 . ?institutionType2 rdfs:label ?institutionType2_en . FILTER (lang(?institutionType2_en) = "en") }
OPTIONAL { ?item wdt:P279+ ?institutionType2 . ?institutionType2 wdt:P279 wd:Q166118 . ?institutionType2 rdfs:label ?institutionType2_en . FILTER (lang(?institutionType2_en) = "en") }
OPTIONAL { ?item wdt:P279+ ?institutionType2 . ?institutionType2 wdt:P279 wd:Q7075 . ?institutionType2 rdfs:label ?institutionType2_en . FILTER (lang(?institutionType2_en) = "en") }
OPTIONAL { ?item wdt:P279+ ?institutionType3 . ?institutionType3 wdt:P279/wdt:P279 wd:Q33506 . ?institutionType3 rdfs:label ?institutionType3_en . FILTER (lang(?institutionType3_en) = "en") }
OPTIONAL { ?item wdt:P279+ ?institutionType3 . ?institutionType3 wdt:P279/wdt:P279 wd:Q166118 . ?institutionType3 rdfs:label ?institutionType3_en . FILTER (lang(?institutionType3_en) = "en") }
OPTIONAL { ?item wdt:P279+ ?institutionType3 . ?institutionType3 wdt:P279/wdt:P279 wd:Q7075 . ?institutionType3 rdfs:label ?institutionType3_en . FILTER (lang(?institutionType3_en) = "en") }
OPTIONAL { ?item wdt:P279+ ?institutionType4 . ?institutionType4 wdt:P279/wdt:P279/wdt:P279 wd:Q33506 . ?institutionType4 rdfs:label ?institutionType4_en . FILTER (lang(?institutionType4_en) = "en") }
OPTIONAL { ?item wdt:P279+ ?institutionType4 . ?institutionType4 wdt:P279/wdt:P279/wdt:P279 wd:Q166118 . ?institutionType4 rdfs:label ?institutionType4_en . FILTER (lang(?institutionType4_en) = "en") }
OPTIONAL { ?item wdt:P279+ ?institutionType4 . ?institutionType4 wdt:P279/wdt:P279/wdt:P279 wd:Q7075 . ?institutionType4 rdfs:label ?institutionType4_en . FILTER (lang(?institutionType4_en) = "en") }
}
group by ?item #List all the variables for which the values are not concatenated!
?Label_en
?Label_de
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?Alias_de"):::projected
v6("?Alias_en"):::projected
v19("?Aliases_de")
v18("?Aliases_en")
v7("?Label_de"):::projected
v8("?Label_en"):::projected
v10("?institutionType1")
v4("?institutionType1_en"):::projected
v11("?institutionType2")
v3("?institutionType2_en"):::projected
v12("?institutionType3")
v2("?institutionType3_en"):::projected
v13("?institutionType4")
v1("?institutionType4_en"):::projected
v14("?institutionTypes1_en")
v15("?institutionTypes2_en")
v16("?institutionTypes3_en")
v17("?institutionTypes4_en")
v9("?item"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
a7((" "))
a8((" "))
a9((" "))
a10((" "))
a11((" "))
a12((" "))
c6(["wd:Q7075"]):::iri
c4(["wd:Q33506"]):::iri
c5(["wd:Q166118"]):::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;
v9 --"wdt:P279"--> c6
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v9 --"wdt:P279"--> c5
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v9 --"wdt:P279"--> c4
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v9 -."rdfs:label".-> v8
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v9 -."rdfs:label".-> v7
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v9 -."skos:altLabel".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v9 -."skos:altLabel".-> v5
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v10
v10 --"wdt:P279"--> a1
c4 --"wdt:P279"--> a1
v10 --"rdfs:label"--> v4
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v10
v10 --"wdt:P279"--> a2
c5 --"wdt:P279"--> a2
v10 --"rdfs:label"--> v4
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v10
v10 --"wdt:P279"--> a3
c6 --"wdt:P279"--> a3
v10 --"rdfs:label"--> v4
end
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v11
v11 --"wdt:P279"--> c4
v11 --"rdfs:label"--> v3
end
subgraph optional8["(optional)"]
style optional8 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v11
v11 --"wdt:P279"--> c5
v11 --"rdfs:label"--> v3
end
subgraph optional9["(optional)"]
style optional9 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v11
v11 --"wdt:P279"--> c6
v11 --"rdfs:label"--> v3
end
subgraph optional10["(optional)"]
style optional10 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v12
v12 --"wdt:P279"--> a4
a4 --"wdt:P279"--> c4
v12 --"rdfs:label"--> v2
end
subgraph optional11["(optional)"]
style optional11 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v12
v12 --"wdt:P279"--> a5
a5 --"wdt:P279"--> c5
v12 --"rdfs:label"--> v2
end
subgraph optional12["(optional)"]
style optional12 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v12
v12 --"wdt:P279"--> a6
a6 --"wdt:P279"--> c6
v12 --"rdfs:label"--> v2
end
subgraph optional13["(optional)"]
style optional13 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v13
v13 --"wdt:P279"--> a7
a7 --"wdt:P279"--> a8
a8 --"wdt:P279"--> c4
v13 --"rdfs:label"--> v1
end
subgraph optional14["(optional)"]
style optional14 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v13
v13 --"wdt:P279"--> a9
a9 --"wdt:P279"--> a10
a10 --"wdt:P279"--> c5
v13 --"rdfs:label"--> v1
end
subgraph optional15["(optional)"]
style optional15 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P279".-> v13
v13 --"wdt:P279"--> a11
a11 --"wdt:P279"--> a12
a12 --"wdt:P279"--> c6
v13 --"rdfs:label"--> v1
end
bind6[/"?institutionType1_en"/]
v4 --o bind6
bind6 --as--o v14
bind7[/"?institutionType2_en"/]
v3 --o bind7
bind7 --as--o v15
bind8[/"?institutionType3_en"/]
v2 --o bind8
bind8 --as--o v16
bind9[/"?institutionType4_en"/]
v1 --o bind9
bind9 --as--o v17
bind10[/"?Alias_en"/]
v6 --o bind10
bind10 --as--o v18
bind11[/"?Alias_de"/]
v5 --o bind11
bind11 --as--o v19