query-1f2ecb4426ed0831eeb1398a79c22586
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 bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?item ?itemLabel ?cls1 ?cls1Label ?cls2 ?cls2Label ?cls3 ?cls3Label WHERE {
BIND(wd:Q1686757 AS ?item)
?item wdt:P31 ?cls1.
OPTIONAL { ?cls1 wdt:P279 ?cls2. }
OPTIONAL { ?cls2 wdt:P279 ?cls3. }
# You can continue the optionals with longer property paths,
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
} order by ?cls1 ?cls2 ?cls3
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?cls1"):::projected
v2("?cls2"):::projected
v3("?cls3"):::projected
v4("?item"):::projected
c4(["bd:serviceParam"]):::iri
c6(["fr"]):::literal
bind0[/"'wd:Q1686757'"/]
bind0 --as--o v4
v4 --"wdt:P31"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P279".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P279".-> v3
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end