【问题标题】:How to include diaeresis / trema in URL to query The Plant List website?如何在 URL 中包含 diaeresis / trema 以查询植物列表网站?
【发布时间】:2019-10-07 09:16:43
【问题描述】:

我从 R 查询植物列表网站 (http://www.theplantlist.org),但如果植物名称中有分音符号 (ë),这将不起作用。 通常,搜索植物物种名称,例如“Vaccinium acosta”,正确引导到 URL“http://www.theplantlist.org/tpl1.1/search?q=vaccinium+acosta”的单个物种页面(在 R 和 Firefox 中)。

如何使用 URL 中的物种名称(而不是 http://www.theplantlist.org/tpl1.1/record/tro-50262461 中的--unknown--record ID)查询“Vaccinium borneënse”的物种页面?这个网站有可能吗?

除其他外,我尝试了以下方法,但它们都指向越橘属(包含许多不同的物种)的概述页面:

http://www.theplantlist.org/tpl1.1/search?q=vaccinium+borneënse
http://www.theplantlist.org/tpl1.1/search?q=Vaccinium+borneense
http://www.theplantlist.org/tpl1.1/search?q=Vaccinium+borne%C3%ABnse
http://www.theplantlist.org/tpl1.1/search?q=Vaccinium+borneënse

最后,我想使用 read.csv 读取 R 中物种列表的特定物种页面:

read.csv("http://www.theplantlist.org/tpl1.1/search?q=vaccinium+acosta&csv=true")

【问题讨论】:

  • read.csv('http://www.theplantlist.org/tpl1.1/search?q=vaccinium+borneënse&csv=true') 的数据有什么问题?它会给出不需要的行吗?
  • 是的,它给出了不需要的行,这是我使用它的较大函数中的一个问题。 Giacomo 的解决方案效果很好!

标签: r url unicode encoding


【解决方案1】:

您可以使用:http://www.theplantlist.org/tpl1.1/search?q=Vaccinium+borne?nse,如http://www.theplantlist.org/tpl1.1/search 中的文本。您应该只为每个带有分音符号的人声转码。

恕我直言,这是植物清单的错误。分音符号不是有效字符(对于植物命名法),只是用来帮助发音,所以数据库应该允许第二次查询。

【讨论】:

    猜你喜欢
    • 2013-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多