query-d633da3862cce804a2c869c48763c067

rq turtle/ttl

Compound and derivation graph

Use at

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 target: <http://www.wikidata.org/entity/L735051>

#defaultView:Graph
SELECT DISTINCT
  ?lexeme1 ?lexeme1Label ?lexeme1Image
  ?lexeme2 ?lexeme2Label ?lexeme2Image
{

  {
    target: (wdt:P5238 | wdt:P5191)+ | (^wdt:P5238 | ^wdt:P5191)+ ?lexeme1 , ?lexeme2 . 
    ?lexeme1 wdt:P5238 | wdt:P5191 ?lexeme2 .
  }
  UNION
  {
    BIND(target: AS ?lexeme1)
    target: wdt:P5238 | wdt:P5191 ?lexeme2 .
  }
  UNION
  {
    BIND(target: AS ?lexeme2)
    ?lexeme1 wdt:P5238 | wdt:P5191 target: .
  }
  OPTIONAL { ?lexeme1 ontolex:sense / wdt:P5137? / wdt:P18 ?lexeme1Image }
  OPTIONAL { ?lexeme2 ontolex:sense / wdt:P5137? / wdt:P18 ?lexeme2Image }
  ?lexeme1 wikibase:lemma ?lemma1 ;
           dct:language / rdfs:label ?lexeme1_languageLabel .
  FILTER (LANG(?lexeme1_languageLabel) = 'en')
  ?lexeme2 wikibase:lemma ?lemma2 ;
           dct:language / rdfs:label ?lexeme2_languageLabel .
  FILTER (LANG(?lexeme2_languageLabel) = 'en')
  BIND(CONCAT(?lemma1, "\n (", ?lexeme1_languageLabel, ")") AS ?lexeme1Label)
  BIND(CONCAT(?lemma2, "\n (", ?lexeme2_languageLabel, ")") AS ?lexeme2Label)
}
LIMIT 500

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?lemma1") v8("?lemma2") v5("?lexeme1"):::projected v5("?lexeme1Image"):::projected v9("?lexeme1Label"):::projected v2("?lexeme1_languageLabel") v5("?lexeme2"):::projected v6("?lexeme2Image"):::projected v10("?lexeme2Label"):::projected v1("?lexeme2_languageLabel") a1((" ")) a2((" ")) a3((" ")) a4((" ")) a5((" ")) a6((" ")) c2([http://www.wikidata.org/entity/L735051]):::iri f0[["?lexeme2_languageLabel = 'en'"]] f0 --> v1 f1[["?lexeme1_languageLabel = 'en'"]] f1 --> v2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; bind2[/"http://www.wikidata.org/entity/L735051"/] bind2 --as--o v5 subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P5191"--> c2 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P5238"--> c2 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; bind3[/"http://www.wikidata.org/entity/L735051"/] bind3 --as--o v5 subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; c2 --"wdt:P5191"--> v5 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; c2 --"wdt:P5238"--> v5 end union3r <== or ==> union3l end end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; subgraph union4[" Union "] subgraph union4l[" "] style union4l fill:#abf,stroke-dasharray: 3 3; subgraph union5[" Union "] subgraph union5l[" "] style union5l fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P5191"--> c2 end subgraph union5r[" "] style union5r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P5238"--> c2 end union5r <== or ==> union5l end subgraph union6[" Union "] subgraph union6l[" "] style union6l fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P5191"--> c2 end subgraph union6r[" "] style union6r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P5238"--> c2 end union6r <== or ==> union6l end end subgraph union4r[" "] style union4r fill:#abf,stroke-dasharray: 3 3; subgraph union7[" Union "] subgraph union7l[" "] style union7l fill:#abf,stroke-dasharray: 3 3; c2 --"wdt:P5191"--> v5 end subgraph union7r[" "] style union7r fill:#abf,stroke-dasharray: 3 3; c2 --"wdt:P5238"--> v5 end union7r <== or ==> union7l end subgraph union8[" Union "] subgraph union8l[" "] style union8l fill:#abf,stroke-dasharray: 3 3; c2 --"wdt:P5191"--> v5 end subgraph union8r[" "] style union8r fill:#abf,stroke-dasharray: 3 3; c2 --"wdt:P5238"--> v5 end union8r <== or ==> union8l end end union4r <== or ==> union4l end subgraph union9[" Union "] subgraph union9l[" "] style union9l fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P5191"--> v5 end subgraph union9r[" "] style union9r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P5238"--> v5 end union9r <== or ==> union9l end end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v5 -."ontolex:sense".-> a1 subgraph union10[" Union "] subgraph union10l[" "] style union10l fill:#abf,stroke-dasharray: 3 3; a1 --"wdt:P5137"--> a2 end subgraph union10r[" "] style union10r fill:#abf,stroke-dasharray: 3 3; end union10r <== or ==> union10l end a2 --"wdt:P18"--> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v5 -."ontolex:sense".-> a3 subgraph union11[" Union "] subgraph union11l[" "] style union11l fill:#abf,stroke-dasharray: 3 3; a3 --"wdt:P5137"--> a4 end subgraph union11r[" "] style union11r fill:#abf,stroke-dasharray: 3 3; end union11r <== or ==> union11l end a4 --"wdt:P18"--> v6 end v5 --"wikibase:lemma"--> v7 v5 --"dct:language"--> a5 a5 --"rdfs:label"--> v2 v5 --"wikibase:lemma"--> v8 v5 --"dct:language"--> a6 a6 --"rdfs:label"--> v1 bind4[/"concat(?lemma1,' (',?lexeme1_languageLabel,')')"/] v7 --o bind4 v2 --o bind4 bind4 --as--o v9 bind5[/"concat(?lemma2,' (',?lexeme2_languageLabel,')')"/] v8 --o bind5 v1 --o bind5 bind5 --as--o v10