query-98a6eca907d5c74562104cd9b94e58fb
TODO
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 ?item ?pItem ?taxon ?parentTaxon ?sitelink WHERE {
?item wdt:P171 ?pItem . # has parent item
?item wdt:P225 ?taxon . # taxon name
?item wdt:P105 ?rank . # taxon rank
?pItem wdt:P225 ?parentTaxon . # parent taxon name
VALUES ?rank {wd:Q7432 } # restrict rank to species only at this moment
?sitelink schema:about ?item .
FILTER(STRSTARTS(STR(?sitelink), "https://no.wikipedia.org/wiki/"))
FILTER(STRENDS(STR(?sitelink), ENCODE_FOR_URI(?parentTaxon))) # norwegian article name matches parent taxon
#MINUS{ ?item wdt:P225 ?parentTaxon . }
} LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v4("?pItem"):::projected
v2("?parentTaxon"):::projected
v7("?rank")
v1("?sitelink"):::projected
v5("?taxon"):::projected
f0[["ends-with(str(?sitelink),encode-for-uri(?parentTaxon))"]]
f0 --> v1
f0 --> v2
f1[["starts-with(str(?sitelink),'https://no.wikipedia.org/wiki/')"]]
f1 --> v1
v3 --"wdt:P171"--> v4
v3 --"wdt:P225"--> v5
v3 --"wdt:P105"--> v7
v4 --"wdt:P225"--> v2
bind2[/VALUES ?rank/]
bind2-->v7
bind20(["wd:Q7432"])
bind20 --> bind2
v1 --"schema:about"--> v3