query-cff36fb631d3e9e9a486c8e4f4503c2e

rq turtle/ttl

title: Senses on Swedish phrase lexemes with a synonym

date: 2024-04-25

author: So9q

note: Thanks to Nikki and Ainali for help with selecting the synonym lexeme

SELECT ?l ?sense ?lemma ?synonym ?synonym_lemma WHERE { ?l ontolex:sense ?sense ; # the sense dct:language wd:Q9027 ; # the language wikibase:lemma ?lemma ; # and the lemma wikibase:lexicalCategory ?category. ?category wdt:P279/wdt:P31* wd:Q187931. # subclass of phrase ?sense wdt:P5973 ?synonym_sense . ?synonym ontolex:sense ?synonym_sense . # select synonym lexeme ?synonym wikibase:lemma ?synonym_lemma . # get the synonym lemma }

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/>
#title: Senses on Swedish phrase lexemes with a synonym
# date: 2024-04-25
# author: So9q
# note: Thanks to Nikki and Ainali for help with selecting the synonym lexeme 
SELECT ?l ?sense ?lemma ?synonym ?synonym_lemma WHERE {
  ?l   ontolex:sense ?sense ; # the sense
       dct:language wd:Q9027 ; # the language
       wikibase:lemma ?lemma ; # and the lemma
       wikibase:lexicalCategory ?category.
  ?category wdt:P279/wdt:P31* wd:Q187931. # subclass of phrase
  ?sense wdt:P5973 ?synonym_sense .
  ?synonym ontolex:sense ?synonym_sense . # select synonym lexeme
  ?synonym wikibase:lemma ?synonym_lemma . # get the synonym lemma
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?category") v1("?l"):::projected v3("?lemma"):::projected v2("?sense"):::projected v6("?synonym"):::projected v7("?synonym_lemma"):::projected v5("?synonym_sense") a1((" ")) c3(["wd:Q9027"]):::iri c8(["wd:Q187931"]):::iri v1 --"ontolex:sense"--> v2 v1 --"dct:language"--> c3 v1 --"wikibase:lemma"--> v3 v1 --"wikibase:lexicalCategory"--> v4 v4 --"wdt:P279"--> a1 a1 --"wdt:P31"--> c8 v2 --"wdt:P5973"--> v5 v6 --"ontolex:sense"--> v5 v6 --"wikibase:lemma"--> v7