query-7ca9e96c1004c2544265693d47405bec

rq turtle/ttl

TODO

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel
WHERE {

  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "Republic of Macedonia haswbstatement:P31=Q4167836".
    ?title wikibase:apiOutput mwapi:title.
  }
  BIND(IRI(CONCAT(STR(wd:), ?title)) AS ?item)
  ?item rdfs:label ?itemLabel . 
  filter(lang(?itemLabel)="en")
  FILTER(CONTAINS(LCASE(?itemLabel), "republic of macedonia"))
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item"):::projected v1("?itemLabel"):::projected v2("?title") c8(["www.wikidata.org"]):::literal c10(["Republic of Macedonia haswbstatement:P31=Q4167836"]):::literal c4(["bd:serviceParam"]):::iri c6(["Search"]):::literal c12(["mwapi:title"]):::iri f0[["contains(lower-case(?itemLabel),'republic of macedonia')"]] f0 --> v1 f1[["?itemLabel = 'en'"]] f1 --> v1 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c4 --"mwapi:api"--> c6 c4 --"mwapi:endpoint"--> c8 c4 --"mwapi:srsearch"--> c10 v2 --"mwapi:apiOutput"--> c12 end bind2[/"concat(str('wd:'),?title)"/] v2 --o bind2 bind2 --as--o v3 v3 --"rdfs:label"--> v1