query-7e62d678c750230892e06c7c63a9d818
Propertiesinstance of (P31)subclass of (P279)
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 ?item ?odialabel ?itemLabel WHERE {
{
SELECT ?item WHERE {
?item wdt:P31/wdt:P279* wd:Q756 .
}
}
OPTIONAL {
?item rdfs:label ?label .
BIND(STR(?label) AS ?odialabel) .
}
FILTER( REGEX(LANG(?label), '^or') ) .
FILTER( BOUND(?label) ) .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
} GROUP BY ?item ?itemLabel ?odialabel
ORDER BY ASC(?odialabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v2("?label")
v4("?odialabel"):::projected
a1((" "))
c7(["bd:serviceParam"]):::iri
c4(["wd:Q756"]):::iri
c9(["en"]):::literal
f0[["bound(?label)"]]
f0 --> v2
f1[["regex(?label,'^or')"]]
f1 --> v2
v3 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."rdfs:label".-> v2
bind2[/"str(?label)"/]
v2 --o bind2
bind2 --as--o v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end