query-e7016a658a186c8cceea095a2644344a

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
select ?uno ?unoLabel ?item ?itemLabel ?duos ?count
where {
  {
    select ?uno ?item
      (group_concat(distinct substr(str(?duo), 32); separator="; ") as ?duos)
      (count(distinct *) as ?count)
    where {
       {
  select ?uno ?duo ?duo_st where {
    ?uno p:P2738 ?duo_st .
    ?duo_st a wikibase:BestRank .
    ?duo_st ps:P2738 wd:Q23766486 .
    ?duo_st pq:P11260 ?duo .
  }
}      ?item wdt:P279 ?duo . # First order subclasses only
      #?item wdt:P279/wdt:P279? ?duo . # To include second order subclasses, uncomment this line and comment out the preceding line
    }
    group by ?uno ?duo_st ?item
    having (?count > 1)
    #limit 1000
  }
  service wikibase:label { bd:serviceParam wikibase:language "en" . }
}
order by desc(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?count"):::projected v4("?duo") v3("?duo_st") v6("?duos"):::projected v5("?item"):::projected v2("?uno"):::projected c6(["wd:Q23766486"]):::iri c4(["wikibase:BestRank"]):::iri c13(["en"]):::literal c11(["bd:serviceParam"]):::iri f0[["?count > '1^^xsd:integer'"]] f0 --> v7 v2 --"p:P2738"--> v3 v3 --"a"--> c4 v3 --"p:statement/P2738"--> c6 v3 --"p:qualifier/P11260"--> v4 v5 --"p:direct/P279"--> v4 bind3[/"substring(str(?duo),'32^^xsd:integer')"/] v4 --o bind3 bind3 --as--o v6 bind4[/"count(*)"/] bind4 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end