query-b34cb5b8b9bd6ffdc34059dd3736ddb8
Duplicate values with different labels
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?soggetto ?soggettoLabel
(GROUP_CONCAT(DISTINCT ?id; separator=", ") as ?id_multipli)
(GROUP_CONCAT(DISTINCT ?titolo; separator=", ") as ?titoli)
(COUNT(?soggetto) as ?numero)
WHERE {
?soggetto wdt:P4521 ?id .
?soggetto p:P4521 ?d .
?d pq:P1810 ?titolo .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it". }
}
GROUP BY ?soggetto ?soggettoLabel
HAVING(count(?id) > 1)
ORDER BY DESC(?numero)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?_anon_42b5416610844a34809f33a099ae9de135995")
v4("?d")
v3("?id"):::projected
v7("?id_multipli")
v9("?numero")
v2("?soggetto"):::projected
v8("?titoli")
v5("?titolo"):::projected
a1((" "))
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,it"]):::literal
f0[[" > '1^^xsd:integer'"]]
f0 --> a1
v2 --"p:direct/P4521"--> v3
v2 --"p:P4521"--> v4
v4 --"p:qualifier/P1810"--> v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind5[/"count(?id)"/]
v3 --o bind5
bind5 --as--o v6
bind6[/"?id"/]
v3 --o bind6
bind6 --as--o v7
bind7[/"?titolo"/]
v5 --o bind7
bind7 --as--o v8
bind8[/"count(?soggetto)"/]
v2 --o bind8
bind8 --as--o v9