Skip to content

Instantly share code, notes, and snippets.

@andrawaag
Created April 22, 2019 21:33
Show Gist options
  • Save andrawaag/6187733ac964860ae6f9b96fb8149fdf to your computer and use it in GitHub Desktop.
Save andrawaag/6187733ac964860ae6f9b96fb8149fdf to your computer and use it in GitHub Desktop.
SELECT ?taxon ?taxonLabel ?de ?en ?fr ?nl WHERE {
bind(if(bound(?english), "+", "-") as ?en )
bind(if(bound(?french), "+", "-") as ?fr )
bind(if(bound(?dutch), "+", "-") as ?nl )
bind(if(bound(?german), "+", "-") as ?de )
{SELECT ?taxon ?taxonLabel ?english ?french ?dutch ?german WHERE {
?taxon wdt:P5588 wd:Q458 .
OPTIONAL {?english schema:about ?taxon .
FILTER (regex(str(?english), "https://en.wikipedia"))}
OPTIONAL {?dutch schema:about ?taxon .
FILTER (regex(str(?dutch), "https://nl.wikipedia"))}
OPTIONAL {?french schema:about ?taxon .
FILTER (regex(str(?french), "https://fr.wikipedia"))}
OPTIONAL {?german schema:about ?taxon .
FILTER (regex(str(?german), "https://de.wikipedia"))}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment