query-362e25b682f5f817ca857d276109f901

rq turtle/ttl

.on Mastodon and on TwitterOriginally posted

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
PREFIX dct: <http://purl.org/dc/terms/>
SELECT ?lexeme ?singular ?plural ?tolkienPlural WHERE {
  ?lexeme dct:language wd:Q1860;
          wikibase:lexicalCategory wd:Q1084;
          ontolex:lexicalForm ?singularForm, ?pluralForm.
  ?singularForm wikibase:grammaticalFeature wd:Q110786;
                ontolex:representation ?singular.
  ?pluralForm wikibase:grammaticalFeature wd:Q146786;
              ontolex:representation ?plural.
  FILTER(STRENDS(?singular, "f"))
  FILTER(STRENDS(?plural, "fs"))
  BIND(STRLANG(CONCAT(IF(STRENDS(?plural, "ffs"), SUBSTR(?plural, 1, STRLEN(?plural) - 3), SUBSTR(?plural, 1, STRLEN(?plural) - 2)), "ves"), LANG(?plural)) AS ?tolkienPlural)
  MINUS {
    ?lexeme ontolex:lexicalForm ?tolkienPluralForm.
    ?tolkienPluralForm wikibase:grammaticalFeature wd:Q146786;
                       ontolex:representation ?tolkienPlural.
  }
}
ORDER BY MD5(?singular)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?lexeme"):::projected v2("?plural"):::projected v5("?pluralForm") v1("?singular"):::projected v4("?singularForm") v6("?tolkienPlural"):::projected v7("?tolkienPluralForm") c6(["wd:Q1084"]):::iri c9(["wd:Q110786"]):::iri c11(["wd:Q146786"]):::iri c4(["wd:Q1860"]):::iri f0[["ends-with(?plural,'fs')"]] f0 --> v2 f1[["ends-with(?singular,'f')"]] f1 --> v1 v3 --"dct:language"--> c4 v3 --"wikibase:lexicalCategory"--> c6 v3 --"ontolex:lexicalForm"--> v4 v3 --"ontolex:lexicalForm"--> v5 v4 --"wikibase:grammaticalFeature"--> c9 v4 --"ontolex:representation"--> v1 v5 --"wikibase:grammaticalFeature"--> c11 v5 --"ontolex:representation"--> v2 bind2[/"STRLANG(concat(if(ends-with(?plural,'ffs'),substring(?plural,'1^^xsd:integer',string-length(?plural) - '3^^xsd:integer'),substring(?plural,'1^^xsd:integer',string-length(?plural) - '2^^xsd:integer')),'ves'),?plural)"/] v2 --o bind2 bind2 --as--o v6 subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v3 --"ontolex:lexicalForm"--> v7 v7 --"wikibase:grammaticalFeature"--> c11 v7 --"ontolex:representation"--> v6 end