query-31d61d01b950f1b0822869baa156be45
Levana Taylor
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT DISTINCT ?item ?wikisource
WHERE
{
?item wdt:P31 wd:Q5. # ?item is human
?item wdt:P18 ?image1 .
?item wdt:P18 ?image2 .
FILTER (?image1 != ?image2) # First filter: Comparing the IRIs is fastest
FILTER (STR(?image1) < STR(?image2)) # Second filter: Convert to string to the halve the result set
?wikisource schema:about ?item.
?wikisource schema:isPartOf <https://en.wikisource.org/>.
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?image1")
v2("?image2")
v3("?item"):::projected
v4("?wikisource"):::projected
c2(["wd:Q5"]):::iri
c6([https://en.wikisource.org/]):::iri
f0[["str(?image1) < str(?image2)"]]
f0 --> v1
f0 --> v2
f1[["?image1 != ?image2"]]
f1 --> v1
f1 --> v2
v3 --"wdt:P31"--> c2
v3 --"wdt:P18"--> v1
v3 --"wdt:P18"--> v2
v4 --"schema:about"--> v3
v4 --"schema:isPartOf"--> c6