Dav*_*uer 7 xml doi r mechanize web-scraping
我有一个引用表,其中包括第一作者的姓氏,每个引文的标题,期刊,年份和页码.
我在谷歌文档或csv版本上发布了表格的前几行(并非所有记录都有doi)
我希望能够查询每个引用的数字对象标识符.对于标题,最好是查询可以处理"模糊匹配".
我怎样才能做到这一点?
该表目前在MySQL中,但以.csv文件开始和结束就足够了(我希望从开始到结束都能得到答案)(或者,因为我主要使用R,一个R数据帧).
我不知道有任何完整的软件包或函数可以做到这一点,但这是我将使用的一般方法.crossref.org提供了一种基于网络的方法,用于从书目数据中确定DOI,网址为http://www.crossref.org/guestquery/
在该页面上有几种不同的搜索方式,包括最后一种采用XML格式搜索的方法.该页面包含有关如何创建适当的XML的信息.您需要通过HTTP提交XML(通过分离页面以确定表单目标和需要包含的任何其他信息来确定详细信息),然后解析响应.
此外,您需要验证以自动方式执行此操作不会以任何方式违反网站的服务条款.
下面是crossref questquery的xml表单,可搜索的术语包括:article_title,author,year,journal_title,volume和first page:
<?xml version = "1.0" encoding="UTF-8"?>
<query_batch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xmlns="http://www.crossref.org/qschema/2.0"
xsi:schemaLocation="http://www.crossref.org/qschema/2.0 http://www.crossref.org/qschema/crossref_query_input2.0.xsd">
<head>
<email_address>test@crossref.org</email_address>
<doi_batch_id>test</doi_batch_id>
</head>
<body>
<query enable-multiple-hits="false|exact|multi_hit_per_rule|one_hit_per_rule|true"
list-components="false"
expanded-results="false" key="key">
<article_title match="fuzzy"></article_title>
<author search-all-authors="false"></author>
<component_number></component_number>
<edition_number></edition_number>
<institution_name></institution_name>
<isbn></isbn>
<issn></issn>
<volume></volume>
<issue></issue>
<year></year>
<first_page></first_page>
<journal_title></journal_title>
<proceedings_title></proceedings_title>
<series_title></series_title>
<volume_title></volume_title>
<unstructured_citation></unstructured_citation>
</query>
</body>
</query_batch>
Run Code Online (Sandbox Code Playgroud)
这是一个开放的问题。有更好和更坏的方法来攻击它。首先阅读Karen Coyle对问题的总结。那篇文章末尾的参考书目非常好。
简而言之,量化两个书目记录之间的相同性问题很困难,并且已经围绕这个主题进行了大量的机器学习研究。
我发现了另一个有前途的解决方案,但在实践中效果不如直接上传 CSV 并在http://www.crossref.org/stqUpload/处执行文本查询。
\n然而,250 个查询中只有 18 个\xc2\xa0(\xe2\x89\x887%) 返回了 DOI。
\n根据Brian Diggs 的回答,这里尝试使用 R 编程语言完成 95% 的工作\xe2\x80\x94 编写基于 XML 的查询。它仍然有一些错误需要使用 来删除sed。但最大的问题是我在提交查询时遇到的 \xe2\x80\x9csession timed out\xe2\x80\x9d 错误。
XML 语法包括使用模糊匹配的选项。
\n该文件包含来自Brian\xe2\x80\x99s 答案的doiquery.xml模板文本;该文件在上面链接。citations.csv
library(XML)\ndoiquery.xml <- xmlTreeParse(\'doiquery.xml\')\n\nquery <- doiquery.xml$doc$children$query_batch[["body"]]\n\ncitations <- read.csv("citations.csv")\n\nnew.query <- function(citation, query = query){\n xmlValue(query[["author"]]) <- as.character(citation$author)\n xmlValue(query[["year"]]) <- as.character(citation$year)\n xmlValue(query[["article_title"]][["text"]]) <- citation$title\n xmlValue(query[["journal_title"]]) <- citation$journal\n return(query)\n}\n\nfor (i in 1:nrow(citations)){\n q <- addChildren(q, add.query(citations[i,]))\n}\naxml <- addChildren(doiquery.xml$doc$children$query_batch, q )\n\nsaveXML(axml, file = \'foo.xml\')\nRun Code Online (Sandbox Code Playgroud)\nCreativyst 软件提供了一个基于 Web 的CSV 到 XML 转换器。
\n需要采取的必要步骤如下。
\ndocument在DocID字段中输入。query字段中输入。另请参阅相关问题:Shell script to parse CSV to an XML query?
\n| 归档时间: |
|
| 查看次数: |
1522 次 |
| 最近记录: |