query: SELECT ?item ?langstring (GROUP_CONCAT(DISTINCT ?lemmas; SEPARATOR=", ") as ?lemmata) (COUNT(DISTINCT ?a) as ?ct)
  WITH { SELECT
    ?a
    ?item
    (CONCAT("[[",
            replace(str(?lang),str(wd:),""),
            "|",
            GROUP_CONCAT(DISTINCT ?lg; SEPARATOR="/"),
            "]]")
        as ?langstring)
    (CONCAT("[[",
              replace(str(?a),str(wd:),"Lexeme:"),
              "|",
              GROUP_CONCAT(DISTINCT REPLACE(?lemma,"^(M[0-9][0-9][0-9])x.*$","$1.."); separator="/"),
              "]]")
        as ?lemmas)
  {
    ?a wikibase:lemma ?lemma ; ontolex:sense/wdt:P5137 ?item ; dct:language ?lang.
    OPTIONAL { ?a dct:language/wdt:P305 ?lg_ }
    BIND(IF(BOUND(?lg_),?lg_,LANG(?lemma)) as ?lg)
    FILTER NOT EXISTS { ?a wikibase:lexicalCategory wd:Q102786 }
    FILTER ( ?a NOT IN ( wd:L123, wd:L1234) )
  }
  GROUP BY ?item ?lang ?a
  } as %as
  WHERE {
    INCLUDE %as.
  }
  GROUP BY ?item ?langstring
  ORDER BY DESC(?ct)
  LIMIT 50