Use Wikidata for place names and Wikipedia descriptions

maybe something like this…

places:

SELECT ?iNatPlace ?item ?lang ?sitelink ?name WHERE {
  VALUES ?iNatPlace {"152114" "160964" } .
  ?item wdt:P7471 ?iNatPlace .
  ?sitelink schema:about ?item ;
    schema:inLanguage ?lang ;
    schema:name ?name ;
    schema:isPartOf [ wikibase:wikiGroup "wikipedia" ] .
#  FILTER(?lang in ('en')) . 
}
ORDER BY ?iNatPlace ?item ?lang

taxa:

SELECT ?iNatTaxon ?item ?lang ?sitelink ?name WHERE {
  VALUES ?iNatTaxon {"41641" "3" } .
  ?item wdt:P3151 ?iNatTaxon .
  ?sitelink schema:about ?item ;
    schema:inLanguage ?lang ;
    schema:name ?name ;
    schema:isPartOf [ wikibase:wikiGroup "wikipedia" ] .
#  FILTER(?lang in ('en')) . 
}
ORDER BY ?iNatTaxon ?item ?lang

that said, the hub tool mentioned earlier seemed to do a good / fast job of getting single pages dynamically.

(UPDATE) these could work, too, depending on what you wanted in the results:

places:

SELECT ?iNatPlace ?item ?lang ?sitelink ?name WHERE {
  VALUES ?iNatPlace {"152114" "160964" "12"} .
  OPTIONAL {
    ?item wdt:P7471 ?iNatPlace . 
    OPTIONAL {
      ?sitelink schema:about ?item ;
        schema:inLanguage ?lang ;
        schema:name ?name ;
        schema:isPartOf [ wikibase:wikiGroup "wikipedia" ] .
#      FILTER(?lang in ('en')) .
    }
  }
}
ORDER BY ?iNatPlace ?item ?lang

taxa:

SELECT ?iNatTaxon ?item ?lang ?sitelink ?name WHERE {
  VALUES ?iNatTaxon {"41641" "999999"} .
  OPTIONAL {
    ?item wdt:P3151 ?iNatTaxon . 
    OPTIONAL {
      ?sitelink schema:about ?item ;
        schema:inLanguage ?lang ;
        schema:name ?name ;
        schema:isPartOf [ wikibase:wikiGroup "wikipedia" ] .
#      FILTER(?lang in ('en')) .
    }
  }
}
ORDER BY ?iNatTaxon ?item ?lang
2 Likes