query-17b8a75eacd093d6701a53078988cd5b
title:Entities with same label SELECT ?item ?itemLabel ?itemDescription ?nature ?natureLabel WHERE { wd:Q90 rdfs:label ?itemLabel filter (lang(?itemLabel) = "[AUTO_LANGUAGE]"). ?item rdfs:label ?itemLabel. OPTIONAL{ ?item schema:description ?itemDescription filter (lang(?itemDescription) = "[AUTO_LANGUAGE]"). } ?item wdt:P31 ?nature. ?nature rdfs:label ?natureLabel filter (lang(?natureLabel) = "[AUTO_LANGUAGE]"). } ORDER BY ?nature ?natureLabel
Use at
- https://query.wikidata.org/sparql
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#>
#title:Entities with same label
SELECT ?item ?itemLabel ?itemDescription ?nature ?natureLabel
WHERE {
wd:Q90 rdfs:label ?itemLabel filter (lang(?itemLabel) = "[AUTO_LANGUAGE]").
?item rdfs:label ?itemLabel.
OPTIONAL{
?item schema:description ?itemDescription filter (lang(?itemDescription) = "[AUTO_LANGUAGE]").
}
?item wdt:P31 ?nature.
?nature rdfs:label ?natureLabel filter (lang(?natureLabel) = "[AUTO_LANGUAGE]").
}
ORDER BY ?nature ?natureLabel
Query found at
- https://www.wikidata.org/wiki/Template_talk:Item_documentation
- https://www.wikidata.org/wiki/User:PAC2/SPARQL_queries
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?item"):::projected
v4("?itemDescription"):::projected
v3("?itemLabel"):::projected
v1("?nature"):::projected
v2("?natureLabel"):::projected
c2(["wd:Q90"]):::iri
f0[["?natureLabel = '#91;AUTO_LANGUAGE#93;'"]]
f0 --> v2
f1[["?itemLabel = '#91;AUTO_LANGUAGE#93;'"]]
f1 --> v3
c2 --"rdfs:label"--> v3
v5 --"rdfs:label"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."schema:description".-> v4
end
v5 --"wdt:P31"--> v1
v1 --"rdfs:label"--> v2