Hi all,
I would like to ask for help regarding SPARQL endpoint and R. The endpoint is running, I can make queries. But when I try to access the data from R it gives me such an error:
SPARQL(endpoint, query)
Space required after the Public Identifier
SystemLiteral " or ' expected
SYSTEM or PUBLIC, the URI is missing
Error: 1: Space required after the Public Identifier
2: SystemLiteral " or ' expected
3: SYSTEM or PUBLIC, the URI is missing
When I do the same in Python it works partially. I can access the data, but I cannot create a data frame with such an error:
RuntimeWarning: unknown response content type 'text/sparql-results+csv;charset=UTF-8' returning raw response...
warnings.warn("unknown response content type '%s' returning raw response..." %(ct), RuntimeWarning)
My R code below.
Thank your in advance!
Best,
Ekaterina
library(DBI)
library(RPostgreSQL)
library(ggplot2)
library(XML)
library(RCurl)
library(SPARQL) # SPARQL querying package
"
q <- paste(sparql_prefix,
'SELECT DISTINCT ?apple {
?apple a :sorts .
}'
)
SPARQL(endpoint,q,ns=prefix,extra=options)$results