简体   繁体   English

Rstudio 上的 SPARQL 错误

[英]Error with SPARQL on Rstudio

I'm using the sparql package in Rstudio, to query OMIM through bio2rdf.我在 Rstudio 中使用 sparql 包,通过 bio2rdf 查询 OMIM。 I have tested my query in yasgui and it works correctly.我已经在 yasgui 中测试了我的查询并且它可以正常工作。 But from Rstudio he returns the following error:但是从 Rstudio 他返回以下错误:

> qde <- SPARQL(endpoint,query)
Opening and ending tag mismatch: hr line 5 and body
Opening and ending tag mismatch: body line 3 and html
Premature end of data in tag html line 1
Error: 1: Opening and ending tag mismatch: hr line 5 and body
2: Opening and ending tag mismatch: body line 3 and html
3: Premature end of data in tag html line 1

Thanks!!谢谢!!

I had the same problem on RStudio a while ago.不久前我在 RStudio 上遇到了同样的问题。 This problem was package dependencies.这个问题是包依赖。 You do install the "sparql" package and its dependencies as below.您确实安装了“sparql”包及其依赖项,如下所示。

install.packages(c("SPARQL", "XML", "RCurl"))

It would be great if you could run the below sample code.如果您可以运行以下示例代码,那就太好了。

d <- SPARQL(url="http://statistics.data.gov.uk/sparql",
            query="SELECT * WHERE { ?s ?p ?o . } LIMIT 10",
            ns=c('time','<http://www.w3.org/2006/time#>'))
is.data.frame(d$results)
head(d$results)

I hope it useful for you.我希望它对你有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM