Learn R Programming

SPARQL (version 1.16)

SPARQL-package: SPARQL client

Description

Load SPARQL SELECT query result tables as a data frame, or UPDATE the triple store by connecting to an end-point over HTTP.

The development of this library has been developed in part within the COMBINE project supported by the ONR Global NICOP grant N62909-11-1-7060.

Arguments

Details

Package:
SPARQL
Type:
Package
Version:
1.15
Date:
2013-10-23
License:
GPL-3
Depends:
XML
LazyLoad:
yes

References

SPARQL specification, http://www.w3.org/TR/rdf-sparql-query/. Examples of SPARQL end-points, http://www.w3.org/wiki/SparqlEndpoints.

Examples

Run this code
## Not run: 
# d <- SPARQL(url="http://services.data.gov.uk/reference/sparql",
#             query="SELECT * WHERE { ?s ?p ?o . } LIMIT 10",
#             ns=c('time','<http://www.w3.org/2006/time#>'))
# 
# is.data.frame(d$results)
# 
# # draw a pie chart from data from the Linked Open Piracy data set
# endpoint <- "http://semanticweb.cs.vu.nl/lop/sparql/"
# q <-
#   "SELECT *
#    WHERE {
#      ?event sem:hasPlace ?place .
#      ?place eez:inPiracyRegion ?region .
#    } LIMIT 20"
# prefix <- c("lop","http://semanticweb.cs.vu.nl/poseidon/ns/instances/",
#             "eez","http://semanticweb.cs.vu.nl/poseidon/ns/eez/")
# res <- SPARQL(endpoint,q,prefix)$results
# pie(sort(table(res$region)),col=rainbow(12))
# ## End(Not run)

Run the code above in your browser using DataLab