ropensci / rdflib

:package: High level wrapper around the redland package for common rdf applications
https://docs.ropensci.org/rdflib
Other
57 stars 9 forks source link

Function to tabulize triples (quads) #8

Closed cboettig closed 6 years ago

cboettig commented 6 years ago

Sometimes convenient to return triples as a data frame.

cboettig commented 6 years ago

Should be sufficient to use a SPARQL query for this; e.g.

sparql <-'
  SELECT ?subject ?predicate ?object
  WHERE { ?subject ?predicate ?object . }
'

doc <- system.file("extdata", "dc.rdf", package="redland")
rdf <- rdf_parse(doc)

rdf_query(rdf, sparql)

prefixes and column names could of course be adjusted as desired.