query-bf2d78f6fc44db7bb4247785a8f5967e
How to keep only one valueHi, How can I have distincts items with this query ?
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 ?locatedLabel ?image ?coordo ?site WHERE {
?item wdt:P31/wdt:P279* wd:Q7075 ;
wdt:P17 wd:Q16 ;
wdt:P131/wdt:P131* wd:Q176 ;
optional {?item wdt:P131 ?located .}
optional {?item wdt:P18 ?image .}
optional {?item wdt:P625 ?coordo .}
optional {?item wdt:P856 ?site .}
service wikibase:label { bd:serviceParam wikibase:language "fr". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?coordo"):::projected
v3("?image"):::projected
v1("?item"):::projected
v2("?located")
v5("?site"):::projected
a1((" "))
a2((" "))
c14(["fr"]):::literal
c3(["wd:Q7075"]):::iri
c5(["wd:Q16"]):::iri
c12(["bd:serviceParam"]):::iri
c7(["wd:Q176"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P17"--> c5
v1 --"wdt:P131"--> a2
a2 --"wdt:P131"--> c7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P625".-> v4
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P856".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end