query-10eb1b18c7f08b22502d0ad9b764cb43
Piotrus
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?article_ko ?article_en ?size
WHERE
{
?item wdt:P31 wd:Q5. # ?item is human
?item wdt:P21 wd:Q6581072. # ?item is female
?item wdt:P27 wd:Q884. # ?item is South Korean citizen
?item wdt:P106/wdt:P279* wd:Q901. # ?item is scientist
?article_ko schema:about ?item.
?article_ko schema:isPartOf <https://ko.wikipedia.org/>.
OPTIONAL
{
?article_en schema:about ?item.
?article_en schema:isPartOf <https://en.wikipedia.org/>.
?article_en schema:name ?title_en.
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:api "Generator".
bd:serviceParam wikibase:endpoint "en.wikipedia.org".
bd:serviceParam wikibase:limit "once".
bd:serviceParam mwapi:generator "allpages".
bd:serviceParam mwapi:gapfrom ?title_en.
bd:serviceParam mwapi:gaplimit "1".
?sizestr wikibase:apiOutput "@length".
}
BIND ((xsd:integer(?sizestr)) AS ?size) # Convert from string to integer
}
}
ORDER BY ?size
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?article_en"):::projected
v3("?article_ko"):::projected
v2("?item"):::projected
v7("?size"):::projected
v6("?sizestr")
v5("?title_en")
a1((" "))
c4(["wd:Q6581072"]):::iri
c13([https://en.wikipedia.org/]):::iri
c20(["en.wikipedia.org"]):::literal
c16(["bd:serviceParam"]):::iri
c24(["allpages"]):::literal
c2(["wd:Q5"]):::iri
c12([https://ko.wikipedia.org/]):::iri
c27(["1"]):::literal
c6(["wd:Q884"]):::iri
c9(["wd:Q901"]):::iri
c22(["once"]):::literal
c29(["@length"]):::literal
c18(["Generator"]):::literal
v2 --"wdt:P31"--> c2
v2 --"wdt:P21"--> c4
v2 --"wdt:P27"--> c6
v2 --"wdt:P106"--> a1
a1 --"wdt:P279"--> c9
v3 --"schema:about"--> v2
v3 --"schema:isPartOf"--> c12
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."schema:about".-> v2
v4 --"schema:isPartOf"--> c13
v4 --"schema:name"--> v5
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c16 --"mwapi:api"--> c18
c16 --"mwapi:endpoint"--> c20
c16 --"mwapi:limit"--> c22
c16 --"mwapi:generator"--> c24
c16 --"mwapi:gapfrom"--> v5
c16 --"mwapi:gaplimit"--> c27
v6 --"mwapi:apiOutput"--> c29
end
bind0[/"http://www.w3.org/2001/XMLSchema#integer(?sizestr)"/]
v6 --o bind0
bind0 --as--o v7
end