query-a14477677047549ab10959e2185b22f2
Items whose article in Wikipedia contain a given string. The following is a minimal working example I've written for you to test your possible solution red banana whose body contain the string English WikipediaSuppose I have a list of QIDs and I want to know which of these items have an article in
Use at
- https://query.wikidata.org/sparql
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?item {
VALUES ?item {
# Group 1: The articles in en.wikipedia.org of these items
# contain the string "red banana"
wd:Q164934
wd:Q490941
wd:Q4927783
# Group 2: The articles in en.wikipedia.org of these items
# don't contain the string "red banana"
wd:Q12876
wd:Q249091
wd:Q1233773
}
# TODO: Filter out items whose article in en.wikipedia.org doesn't
# contain "red banana". That is, the query should show the items
# from Group 1
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
bind0[/VALUES ?item/]
bind0-->v1
bind00(["wd:Q164934"])
bind00 --> bind0
bind01(["wd:Q490941"])
bind01 --> bind0
bind02(["wd:Q4927783"])
bind02 --> bind0
bind03(["wd:Q12876"])
bind03 --> bind0
bind04(["wd:Q249091"])
bind04 --> bind0
bind05(["wd:Q1233773"])
bind05 --> bind0