Skip to content

Instantly share code, notes, and snippets.

@andrawaag
Created April 22, 2019 21:38
Show Gist options
  • Save andrawaag/eed8b2a0e92dbd8b0c935eb20b94d624 to your computer and use it in GitHub Desktop.
Save andrawaag/eed8b2a0e92dbd8b0c935eb20b94d624 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 {
wd:Q3052500 wdt:P1990 ?taxon .
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