我将如何从R中的RDFa中提取RDF?是否有现有的软件包或功能用于此?
或者,如果不是理想的话,简单地将文章发布到某个web服务来执行提取是可行的,但我似乎也无法让它与Apache的http://any23.org api一起工作:
httr::POST("http://any23.org/rdfxml",
body=list(file=upload_file("inst/examples/meta_example.xml")),
add_headers("Content-Type"="application/xhtml+xml"))返回一个501错误,“没有找到三元组”,尽管手动将示例文件加载到any23 web界面很好。
使用httr调用备用服务器的解决方案也很好,理想的解决方案可以将RDFa三元组提取为具有纯R函数的RDF-XML (例如类似于这个python:pyrdfa3)。
发布于 2014-04-23 17:36:07
为此目的,我可以从R处找到一个不同的RESTful服务。不是理想的而是功能性的。使用file (指向包含RDFa的文件的路径),我可以这样做:
library(httr)
response <- POST("http://rdf-translator.appspot.com/convert/rdfa/xml/content",
body=list(content=upload_file(file)))
doc <- content(response, "parsed", "text/xml")https://stackoverflow.com/questions/20026540
复制相似问题