query-ebea710af9c08748b2bb87e2066bbc5b
Below is a query yielding a similar table to the main page, but for Bengali, Turkish, Swahili, and Maltese (the first two of which borrow from Persian and the last three of which derive from Arabic):
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX dct: <http://purl.org/dc/terms/>
select distinct ?l1 ?lemma ?l2 ?lbn ?l3 ?ltr ?l4 ?lsw ?l5 ?lmt
where {
{
select ?l1 ?lemma {
values ?l1_ {
# lexeme IDs from the first column of the main table go here
}
?l1_ wikibase:lemma ?lfa . filter(lang(?lfa)="fa")
optional {
?l1_ wdt:P5191 ?l0 . ?l0 dct:language wd:Q13955 ; wikibase:lemma ?lar
}
bind(coalesce(?l0,?l1_) as ?l1)
bind(coalesce(?lar,?lfa) as ?lemma)
}
}.
optional { ?l2 dct:language wd:Q9610 ; wikibase:lemma ?lbn ; wdt:P5191/wdt:P5191?/wdt:P5191? ?l1 }
optional { ?l3 dct:language wd:Q256 ; wikibase:lemma ?ltr ; wdt:P5191/wdt:P5191?/wdt:P5191? ?l1 . filter(lang(?ltr)="tr") }
optional { ?l4 dct:language wd:Q7838 ; wikibase:lemma ?lsw ; wdt:P5191/wdt:P5191?/wdt:P5191? ?l1 . filter(lang(?lsw)="sw") }
optional { ?l5 dct:language wd:Q9166 ; wikibase:lemma ?lmt ; wdt:P5191/wdt:P5191?/wdt:P5191? ?l1 }
filter(bound(?l2)|| bound(?l3) || bound(?l4) || bound(?l5))
} order by str(?lemma)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v10("?l0")
v12("?l1"):::projected
v9("?l1_")
v2("?l2"):::projected
v3("?l3"):::projected
v4("?l4"):::projected
v5("?l5"):::projected
v11("?lar")
v13("?lbn"):::projected
v13("?lemma"):::projected
v8("?lfa")
v14("?lmt"):::projected
v6("?lsw"):::projected
v7("?ltr"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
a7((" "))
a8((" "))
c8(["wd:Q9610"]):::iri
c9(["wd:Q256"]):::iri
c10(["wd:Q7838"]):::iri
c11(["wd:Q9166"]):::iri
c7(["wd:Q13955"]):::iri
f0[["(bound(?l2) || (bound(?l3) || (bound(?l4) || bound(?l5))))"]]
f0 --> v2
f0 --> v3
f0 --> v4
f0 --> v5
f1[["?lfa = 'fa'"]]
f1 --> v8
bind2[/VALUES ?l1_/]
bind2-->v9
v9 --"wikibase:lemma"--> v8
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v9 -."wdt:P5191".-> v10
v10 --"dct:language"--> c7
v10 --"wikibase:lemma"--> v11
end
bind3[/"?l0?l1_"/]
v10 --o bind3
v9 --o bind3
bind3 --as--o v12
bind4[/"?lar?lfa"/]
v11 --o bind4
v8 --o bind4
bind4 --as--o v13
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."dct:language".-> c8
v2 --"wikibase:lemma"--> v13
v2 --"wdt:P5191"--> a1
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
a1 --"wdt:P5191"--> a2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
end
union0r <== or ==> union0l
end
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
a2 --"wdt:P5191"--> v12
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
end
union1r <== or ==> union1l
end
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."dct:language".-> c9
v3 --"wikibase:lemma"--> v7
v3 --"wdt:P5191"--> a3
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
a3 --"wdt:P5191"--> a4
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
end
union2r <== or ==> union2l
end
subgraph union3[" Union "]
subgraph union3l[" "]
style union3l fill:#abf,stroke-dasharray: 3 3;
a4 --"wdt:P5191"--> v12
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
end
union3r <== or ==> union3l
end
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v4 -."dct:language".-> c10
v4 --"wikibase:lemma"--> v6
v4 --"wdt:P5191"--> a5
subgraph union4[" Union "]
subgraph union4l[" "]
style union4l fill:#abf,stroke-dasharray: 3 3;
a5 --"wdt:P5191"--> a6
end
subgraph union4r[" "]
style union4r fill:#abf,stroke-dasharray: 3 3;
end
union4r <== or ==> union4l
end
subgraph union5[" Union "]
subgraph union5l[" "]
style union5l fill:#abf,stroke-dasharray: 3 3;
a6 --"wdt:P5191"--> v12
end
subgraph union5r[" "]
style union5r fill:#abf,stroke-dasharray: 3 3;
end
union5r <== or ==> union5l
end
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v5 -."dct:language".-> c11
v5 --"wikibase:lemma"--> v14
v5 --"wdt:P5191"--> a7
subgraph union6[" Union "]
subgraph union6l[" "]
style union6l fill:#abf,stroke-dasharray: 3 3;
a7 --"wdt:P5191"--> a8
end
subgraph union6r[" "]
style union6r fill:#abf,stroke-dasharray: 3 3;
end
union6r <== or ==> union6l
end
subgraph union7[" Union "]
subgraph union7l[" "]
style union7l fill:#abf,stroke-dasharray: 3 3;
a8 --"wdt:P5191"--> v12
end
subgraph union7r[" "]
style union7r fill:#abf,stroke-dasharray: 3 3;
end
union7r <== or ==> union7l
end
end