query-421c7bb8274027d71459a406403131be

rq turtle/ttl

WD entiteter med duplikater av IMO nummer SELECT ?imonr (COUNT(DISTINCT ?a) AS ?count) (GROUP_CONCAT(DISTINCT ?qid; SEPARATOR="; ") AS ?qids) WHERE { ?a wdt:P31/wdt:P279* wd:Q11446; wdt:P458 ?imonr. BIND(SUBSTR(STR(?a), 32) AS ?qid) } GROUP BY ?imonr HAVING (?count > 1) ORDER BY DESC(?count) ?imonr

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
# WD entiteter med duplikater av IMO nummer
SELECT
  ?imonr (COUNT(DISTINCT ?a) AS ?count)
  (GROUP_CONCAT(DISTINCT ?qid; SEPARATOR="; ") AS ?qids)
WHERE {
  ?a wdt:P31/wdt:P279* wd:Q11446;
    wdt:P458 ?imonr.
  BIND(SUBSTR(STR(?a), 32) AS ?qid)
}
GROUP BY ?imonr
HAVING (?count > 1)
ORDER BY DESC(?count) ?imonr

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?a"):::projected v5("?count") v2("?imonr"):::projected v4("?qid"):::projected v5("?qids") a1((" ")) c4(["wd:Q11446"]):::iri f0[["?count > '1^^xsd:integer'"]] f0 --> v5 v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 v3 --"wdt:P458"--> v2 bind1[/"substring(str(?a),'32^^xsd:integer')"/] v3 --o bind1 bind1 --as--o v4 bind4[/"count(?a)"/] v3 --o bind4 bind4 --as--o v5 bind5[/"?qid"/] v4 --o bind5 bind5 --as--o v5