query-d01ec0c7ccaa550dc0301c87b42adf2c

rq turtle/ttl

title: Concepts studied by ecology or invasion biology, sorted by number of languages with associated lexemes

adapted from https://w.wiki/5H28

SELECT ?item ?itemLabel ?count ?langExample ?langExampleLabel (SAMPLE(?lexeme) AS ?lexemeExample) (SAMPLE(?lemma) AS ?lemmaExample) (SAMPLE(?sens) AS ?sense) { { SELECT ?item (COUNT(DISTINCT ?lang) AS ?count) (SAMPLE(?lang) AS ?langExample) { ?sens wdt:P5137 ?item . ?lexeme ontolex:sense ?sens ; dct:language ?lang . { ?item wdt:P2579 wd:Q7150 . } UNION { ?item wdt:P2579 wd:Q42985020 . } } GROUP BY ?item }

?lexeme ontolex:sense ?sens ; dct:language ?langExample ; wikibase:lemma ?lemma . ?sens wdt:P5137 ?item . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?item ?itemLabel ?count ?langExample ?langExampleLabel ?lemmaExample ORDER BY DESC(?count)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: Concepts studied by ecology or invasion biology, sorted by number of languages with associated lexemes
# adapted from https://w.wiki/5H28
SELECT ?item ?itemLabel ?count ?langExample ?langExampleLabel (SAMPLE(?lexeme) AS ?lexemeExample) (SAMPLE(?lemma) AS ?lemmaExample) (SAMPLE(?sens) AS ?sense) {
  {
    SELECT ?item (COUNT(DISTINCT ?lang) AS ?count) (SAMPLE(?lang) AS ?langExample) {
      ?sens wdt:P5137 ?item .
      ?lexeme ontolex:sense ?sens ;
              dct:language ?lang .
      { ?item wdt:P2579 wd:Q7150 . }
      UNION
      { ?item wdt:P2579 wd:Q42985020 . }
    } 
    GROUP BY ?item
  }

  ?lexeme ontolex:sense ?sens ;
          dct:language ?langExample ;
          wikibase:lemma ?lemma .
  ?sens wdt:P5137 ?item .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?item ?itemLabel ?count ?langExample ?langExampleLabel ?lemmaExample
ORDER BY DESC(?count)

Query found at