query-4803c5ac1da4e050346fe2b099ff44fb

rq turtle/ttl

TODO

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?p3318 ?p3318num (COUNT(?item) AS ?count) (GROUP_CONCAT(STRAFTER(STR(?item),'entity/');SEPARATOR=', ') AS ?items)  WHERE {
   {
  SELECT DISTINCT ?p3318  WHERE {
  ?item1 wdt:P3318 ?p3318 .
  ?item2 wdt:P3318 ?p3318 .
  FILTER(STR(?item1)<STR(?item2))
}
}  ?item wdt:P3318 ?p3318 .
  BIND(xsd:integer(STRAFTER(STR(?p3318),'i')) AS ?p3318num)
}
GROUP BY ?p3318 ?p3318num
ORDER BY DESC(?count) ?p3318num

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?count") v6("?item"):::projected v3("?item1") v4("?item2") v7("?items") v5("?p3318"):::projected v7("?p3318num"):::projected f0[["str(?item1) < str(?item2)"]] f0 --> v3 f0 --> v4 v3 --"wdt:P3318"--> v5 v4 --"wdt:P3318"--> v5 v6 --"wdt:P3318"--> v5 bind1[/"http://www.w3.org/2001/XMLSchema#integer(substring-after(str(?p3318),'i'))"/] v5 --o bind1 bind1 --as--o v7 bind4[/"count(?item)"/] v6 --o bind4 bind4 --as--o v7 bind5[/"substring-after(str(?item),'entity/')"/] v6 --o bind5 bind5 --as--o v7