query-a23c79849b50d8ced28b21e70c3f2d07
AdrianoRutz
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?taxon ?taxon_name
WHERE
{
OPTIONAL # Optional is used as means to have this block executed first
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "www.wikidata.org" .
bd:serviceParam mwapi:generator "allpages" .
bd:serviceParam mwapi:gapnamespace "1" .
bd:serviceParam mwapi:gaplimit "max" .
?talk wikibase:apiOutput mwapi:title .
}
BIND(URI(CONCAT("http://www.wikidata.org/entity/", SUBSTR(?talk, 6))) AS ?taxon)
}
?taxon wdt:P225 ?taxon_name .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?talk")
v2("?taxon"):::projected
v3("?taxon_name"):::projected
c6(["www.wikidata.org"]):::literal
c12(["max"]):::literal
c10(["1"]):::literal
c2(["bd:serviceParam"]):::iri
c8(["allpages"]):::literal
c14(["mwapi:title"]):::iri
c4(["Generator"]):::literal
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c2 -."mwapi:api".-> c4
c2 --"mwapi:endpoint"--> c6
c2 --"mwapi:generator"--> c8
c2 --"mwapi:gapnamespace"--> c10
c2 --"mwapi:gaplimit"--> c12
v1 --"mwapi:apiOutput"--> c14
end
bind0[/"concat('http://www.wikidata.org/entity/',substring(?talk,'6^^xsd:integer'))"/]
v1 --o bind0
bind0 --as--o v2
end
v2 --"wdt:P225"--> v3