query-7895213a7963ffe4def1362c9e754319

rq turtle/ttl

title:articles on English Wikipedia with "Korea" or "Korean" in title not on Korean Wikipedia SELECT DISTINCT ?item ?itemLabel ?sitelink WHERE { hint:Query hint:optimizer "None". SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Search"; wikibase:endpoint "www.wikidata.org"; mwapi:srsearch "Korea". ?item wikibase:apiOutputItem mwapi:title . } FILTER(BOUND(?item)) ?article schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ ; schema:name ?sitelink . FILTER(CONTAINS(STR(?sitelink),"Korea")) FILTER NOT EXISTS { [] schema:about ?item ; schema:isPartOf https://ko.wikipedia.org/ .} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY ?sitelink

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:articles on English Wikipedia with "Korea" or "Korean" in title not on Korean Wikipedia 
SELECT DISTINCT ?item ?itemLabel ?sitelink
WHERE {

  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "Korea".
    ?item wikibase:apiOutputItem mwapi:title .
  }
  FILTER(BOUND(?item))
  ?article schema:about ?item ;
             schema:isPartOf <https://en.wikipedia.org/>  ;
             schema:name ?sitelink .
  FILTER(CONTAINS(STR(?sitelink),"Korea"))
  FILTER NOT EXISTS { [] schema:about ?item ;
                         schema:isPartOf <https://ko.wikipedia.org/> .}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} ORDER BY ?sitelink

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?article") v2("?item"):::projected v1("?sitelink"):::projected a1((" ")) c10(["www.wikidata.org"]):::literal c3([https://ko.wikipedia.org/]):::iri c14([https://en.wikipedia.org/]):::iri c6(["bd:serviceParam"]):::iri c8(["Search"]):::literal c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal c13(["mwapi:title"]):::iri c4(["Korea"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0a1 --"schema:about"--> e0v1 e0a1 --"schema:isPartOf"--> e0c3 e0v1("?item"):::projected e0a1((" ")):::projected e0c3([https://ko.wikipedia.org/]):::iri end f0--EXISTS--> f0e0 f0 --> a1 f0 --> c1 f0 --> v2 f0 --> c2 f0 --> c3 a1 --"schema:about"--> v2 a1 --"schema:isPartOf"--> c3 f1[["contains(str(?sitelink),'Korea')"]] f1 --> v1 f2[["bound(?item)"]] f2 --> v2 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c6 --"mwapi:api"--> c8 c6 --"mwapi:endpoint"--> c10 c6 --"mwapi:srsearch"--> c4 v2 --"mwapi:apiOutputItem"--> c13 end v3 --"schema:about"--> v2 v3 --"schema:isPartOf"--> c14 v3 --"schema:name"--> v1 subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c6 --"mwapi:language"--> c18 end