query-be258e260f2c64cc2759e2a279f0e9d3
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?sitelink
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)
optional { ?item rdfs:label ?itemLabel .
filter(lang(?itemLabel)="en") }
?article schema:about ?item ;
# schema:isPartOf <https://en.wikipedia.org/> ;
schema:name ?sitelink .
FILTER(CONTAINS(LCASE(?sitelink), "republic of macedonia"))
}
Query found at
- https://www.wikidata.org/wiki/User:Xaris333/query
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2019/03
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?article")
v4("?item"):::projected
v2("?itemLabel"):::projected
v1("?sitelink"):::projected
v3("?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(?sitelink),'republic of macedonia')"]]
f0 --> 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
v3 --"mwapi:apiOutput"--> c12
end
bind1[/"concat(str('wd:'),?title)"/]
v3 --o bind1
bind1 --as--o v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."rdfs:label".-> v2
end
v5 --"schema:about"--> v4
v5 --"schema:name"--> v1