query-03d3765fc664e22fdf1a2a0183664e86
Propertiessubclass of (P279)equivalent class (P1709)
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 schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT
?class
?classLabel
?classDescription
(GROUP_CONCAT(DISTINCT ?superClassLabel;SEPARATOR=' // ') AS ?superClasses)
(GROUP_CONCAT(DISTINCT STR(?equivalentClass);SEPARATOR=' // ') AS ?equivalentClasses)
WHERE
{
VALUES ?top { wd:Q2431196 wd:Q2188189 wd:Q115669410 wd:Q110879422 wd:Q18127 wd:Q32178211 }
?class wdt:P279+ ?top;
wdt:P279+ ?superClass.
?superClass wdt:P279* ?top.
OPTIONAL {
?class wdt:P1709 ?equivalentClass.
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en,fr".
?class rdfs:label ?classLabel.
?class schema:description ?classDescription.
?superClass rdfs:label ?superClassLabel.
}
}
GROUP BY ?class ?classLabel ?classDescription
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?class"):::projected
v6("?classDescription"):::projected
v5("?classLabel"):::projected
v4("?equivalentClass"):::projected
v9("?equivalentClasses")
v3("?superClass")
v7("?superClassLabel"):::projected
v8("?superClasses")
v1("?top")
c4(["bd:serviceParam"]):::iri
c6(["en,fr"]):::literal
bind0[/VALUES ?top/]
bind0-->v1
bind00(["wd:Q2431196"])
bind00 --> bind0
bind01(["wd:Q2188189"])
bind01 --> bind0
bind02(["wd:Q115669410"])
bind02 --> bind0
bind03(["wd:Q110879422"])
bind03 --> bind0
bind04(["wd:Q18127"])
bind04 --> bind0
bind05(["wd:Q32178211"])
bind05 --> bind0
v2 --"wdt:P279"--> v1
v2 --"wdt:P279"--> v3
v3 --"wdt:P279"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P1709".-> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
v2 --"rdfs:label"--> v5
v2 --"schema:description"--> v6
v3 --"rdfs:label"--> v7
end
bind3[/"?superClassLabel"/]
v7 --o bind3
bind3 --as--o v8
bind4[/"str(?equivalentClass)"/]
v4 --o bind4
bind4 --as--o v9