query-2727f1df9b762a3f5b23faf5b97a390b

rq turtle/ttl

title: Dieren die bedreigd zijn volgens de IUCN-Rode lijst

https://en.wikipedia.org/wiki/Conservation_status

Common names are in English only

SELECT ?animal ?scientific_names ?common_names ?statusLabel where { # hint:Prior hint:runLast true { SELECT DISTINCT ?animal (GROUP_CONCAT(DISTINCT ?scientific_name; separator=", ") as ?scientific_names) (GROUP_CONCAT(DISTINCT ?common_name; separator=", ") as ?common_names) WHERE {

    ?animal wdt:P141 ?status;
            wdt:P225 ?scientific_name;
            wdt:P1843 ?common_name.
    filter( ?status
       IN (
           wd:Q11394,  #Endangered
           wd:Q219127, #critcally endangered
           wd:Q278113  #vulnurable
          )
      ).

    # Only return common names in English
    FILTER(LANGMATCHES(LANG(?common_name), "en"))
  }
  GROUP BY ?animal

}. ?animal wdt:P141 ?status. SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title: Dieren die bedreigd zijn volgens de IUCN-Rode lijst
# https://en.wikipedia.org/wiki/Conservation_status
# Common names are in English only

SELECT ?animal ?scientific_names ?common_names ?statusLabel where
{
  # hint:Prior hint:runLast true
   {
      SELECT DISTINCT ?animal (GROUP_CONCAT(DISTINCT ?scientific_name; separator=", ") as ?scientific_names) (GROUP_CONCAT(DISTINCT ?common_name; separator=", ") as ?common_names) WHERE
      {

        ?animal wdt:P141 ?status;
                wdt:P225 ?scientific_name;
                wdt:P1843 ?common_name.
        filter( ?status
           IN (
               wd:Q11394,  #Endangered
               wd:Q219127, #critcally endangered
               wd:Q278113  #vulnurable
              )
          ).

        # Only return common names in English
        FILTER(LANGMATCHES(LANG(?common_name), "en"))
      }
      GROUP BY ?animal
   }.
   ?animal wdt:P141 ?status.
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?animal"):::projected v1("?common_name") v6("?common_names"):::projected v4("?scientific_name") v5("?scientific_names"):::projected v2("?status") c9(["bd:serviceParam"]):::iri c1(["en"]):::literal f0[["langmatch(?common_name,'en')"]] f0 --> v1 list0c1(["wd:Q11394"]):::iri list0c2(["wd:Q219127"]):::iri list0c3(["wd:Q278113"]):::iri list0c1 --o f1 list0c2 --o f1 list0c3 --o f1 f1[[" in "]] f1 --> v2 v3 --"wdt:P141"--> v2 v3 --"wdt:P225"--> v4 v3 --"wdt:P1843"--> v1 bind4[/"?scientific_name"/] v4 --o bind4 bind4 --as--o v5 bind5[/"?common_name"/] v1 --o bind5 bind5 --as--o v6 v3 --"wdt:P141"--> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c1 end