query-4a51b5ede98547e9a240e2d2faac4e48
Grouping result by entity, not by propertyHi everyone, I'm dealing with the following query which gathers every painting with one or more depict properties. But when a painting has more than one depict, the results appear with one line by depict. My 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 ?item ?itemLabel ?image ?depict WHERE {
?item wdt:P31/wdt:P279* wd:Q4502142.
?item wdt:P18 ?image.
?item wdt:P180 ?depict.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],fr,en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?depict"):::projected
v2("?image"):::projected
v1("?item"):::projected
a1((" "))
c7(["bd:serviceParam"]):::iri
c3(["wd:Q4502142"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,fr,en"]):::literal
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P18"--> v2
v1 --"wdt:P180"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end