query-effb1f89f8b444aa491ac3c57a026a82
SPARQL endpointTry running this code
Use at
- https://query.wikidata.org/sparql
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
PREFIX :<http://www.w3.org/2004/02/skos/core#>
SELECT ?uri (str(?lab) as ?prefLabel) ?broader ?broaderLabel
WHERE{
{?uri :prefLabel ?lab .}
#UNION{?uri :altLabel ?lab .}
FILTER(lang(?lab)='en')
OPTIONAL {?uri skos:broader ?broader.
?broader :prefLabel ?broaderLabel .
FILTER(lang(?broaderLabel)='en')
}
}ORDER BY ?uri
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?broader"):::projected
v3("?broaderLabel"):::projected
v2("?lab"):::projected
v5("?prefLabel")
v1("?uri"):::projected
f0[["?lab = 'en'"]]
f0 --> v2
v1 --"skos:prefLabel"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."skos:broader".-> v4
v4 --"skos:prefLabel"--> v3
end
bind1[/"str(?lab)"/]
v2 --o bind1
bind1 --as--o v5