query-db34719bb699dfb3917fd6b867e63ee2

rq turtle/ttl

Query on Lexemes needing fixingHi, I wrote this query to have the number of words (representation of forms) in English sorted by number:

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#>
SELECT ?firstLetter (COUNT(?form) AS ?count ) WHERE {
  ?lexeme a ontolex:LexicalEntry ; dct:language ?language ; ontolex:lexicalForm ?form .
  ?form ontolex:representation ?word .
  ?language wdt:P218 'en' .
  BIND ( SUBSTR(UCASE(?word), 1, 1) AS ?firstLetter )
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?firstLetter
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?count") v6("?firstLetter"):::projected v4("?form"):::projected v3("?language") v2("?lexeme") v5("?word") c9(["bd:serviceParam"]):::iri c2(["ontolex:LexicalEntry"]):::iri c7(["en"]):::literal c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"a"--> c2 v2 --"dct:language"--> v3 v2 --"ontolex:lexicalForm"--> v4 v4 --"ontolex:representation"--> v5 v3 --"wdt:P218"--> c7 bind0[/"substring(upper-case(?word),'1^^xsd:integer','1^^xsd:integer')"/] v5 --o bind0 bind0 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind2[/"count(?form)"/] v4 --o bind2 bind2 --as--o v7