query-aebc2cc3f434f7ddb164bf55121f721e

rq turtle/ttl

title: Language-pairs of connected lexemes with count of lexemes SELECT ?language1 ?language1Label ?language2 ?language2Label ?number_of_lexemes WITH { SELECT ?language1 ?language2 (COUNT(*) AS ?number_of_lexemes) { [] ^wdt:P5137 / ^ontolex:sense ?lexeme1, ?lexeme2 . FILTER (?lexeme1 != ?lexeme2) ?lexeme1 dct:language ?language1 . ?lexeme2 dct:language ?language2 . FILTER (?language1 != ?language2) FILTER (STR(?language1) > STR(?language2)) } GROUP BY ?language1 ?language2 ORDER BY DESC(?number_of_lexemes) LIMIT 100 } AS %result { INCLUDE %result SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY DESC(?number_of_lexemes)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: Language-pairs of connected lexemes with count of lexemes
SELECT
  ?language1 ?language1Label ?language2 ?language2Label 
  ?number_of_lexemes
{
   {
SELECT ?language1 ?language2 (COUNT(*) AS ?number_of_lexemes) {
  [] ^wdt:P5137 / ^ontolex:sense ?lexeme1, ?lexeme2 .
  FILTER (?lexeme1 != ?lexeme2)
  ?lexeme1 dct:language ?language1 .
  ?lexeme2 dct:language ?language2 .
  FILTER (?language1 != ?language2)
  FILTER (STR(?language1) > STR(?language2)) 
}
GROUP BY ?language1 ?language2
ORDER BY DESC(?number_of_lexemes)
LIMIT 100
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?number_of_lexemes)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?language1"):::projected v3("?language2"):::projected v4("?lexeme1") v5("?lexeme2") v6("?number_of_lexemes"):::projected a2((" ")) a1((" ")) c5(["bd:serviceParam"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["str(?language1) > str(?language2)"]] f0 --> v2 f0 --> v3 f1[["?language1 != ?language2"]] f1 --> v2 f1 --> v3 f2[["?lexeme1 != ?lexeme2"]] f2 --> v4 f2 --> v5 a1 --"wdt:P5137"--> a2 v4 --"ontolex:sense"--> a1 v5 --"ontolex:sense"--> a1 v4 --"dct:language"--> v2 v5 --"dct:language"--> v3 bind4[/"count(*)"/] bind4 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end