query-b7686c082d796d8f0e05a69c0ced8ff6
Automatic hyperonymy SELECT ?l ?lemma ?sense ?item ?itemLabel ?class ?classLabel ?lemclass ?ru ?senseHyper WHERE { ?l a ontolex:LexicalEntry ; dct:language ?language ; wikibase:lemma ?lemma; #ontolex:gloss ?gloss; ontolex:sense ?sense. ?language wdt:P218 'ru'. ?sense wdt:P5137 ?item. ?item wdt:P279 ?class. ?class rdfs:label ?ru . filter(lang(?ru)="ru") ?lemclass a ontolex:LexicalEntry; dct:language ?language; wikibase:lemma ?ru; ontolex:sense ?senseHyper. ?senseHyper wdt:P5137 ?class. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Automatic hyperonymy
SELECT ?l ?lemma ?sense ?item ?itemLabel ?class ?classLabel ?lemclass ?ru ?senseHyper WHERE {
?l a ontolex:LexicalEntry ; dct:language ?language ;
wikibase:lemma ?lemma;
#ontolex:gloss ?gloss;
ontolex:sense ?sense.
?language wdt:P218 'ru'.
?sense wdt:P5137 ?item.
?item wdt:P279 ?class.
?class rdfs:label ?ru . filter(lang(?ru)="ru")
?lemclass a ontolex:LexicalEntry; dct:language ?language;
wikibase:lemma ?ru;
ontolex:sense ?senseHyper.
?senseHyper wdt:P5137 ?class.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?class"):::projected
v6("?item"):::projected
v2("?l"):::projected
v3("?language")
v8("?lemclass"):::projected
v4("?lemma"):::projected
v1("?ru"):::projected
v5("?sense"):::projected
v9("?senseHyper"):::projected
c1(["ru"]):::literal
c3(["ontolex:LexicalEntry"]):::iri
c12(["bd:serviceParam"]):::iri
c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?ru = 'ru'"]]
f0 --> v1
v2 --"a"--> c3
v2 --"dct:language"--> v3
v2 --"wikibase:lemma"--> v4
v2 --"ontolex:sense"--> v5
v3 --"wdt:P218"--> c1
v5 --"wdt:P5137"--> v6
v6 --"wdt:P279"--> v7
v7 --"rdfs:label"--> v1
v8 --"a"--> c3
v8 --"dct:language"--> v3
v8 --"wikibase:lemma"--> v1
v8 --"ontolex:sense"--> v9
v9 --"wdt:P5137"--> v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end