query-e160939815f2c064a17fb89d85a81e5c

rq turtle/ttl

Find same codes sharing 20:27, 26 May 2024 (UTC) 💛●✒️●💬 Bouzinac, how to filter out the unique identifiers (that is, get only those that share same identifiers) ? https://w.wiki/ACEFHi, inside this query My try:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?idnt ?numItems
WHERE {
   {
SELECT ?idnt (COUNT(DISTINCT(?item)) AS ?numItems) WHERE {
  ?item   wdt:P5696 ?idnt.
} 
GROUP BY ?idnt
}
  ?item   wdt:P5696 ?idnt.
  FILTER(?numItems > 1)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?idnt"):::projected v2("?item"):::projected v4("?numItems"):::projected c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?numItems > '1^^xsd:integer'"]] f0 --> v4 v2 --"wdt:P5696"--> v3 bind2[/"count(?item)"/] v2 --o bind2 bind2 --as--o v4 v2 --"wdt:P5696"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end