Learn R Programming

RNeXML (version 2.0.7)

get_rdf: Extract rdf-xml from a NeXML file

Description

Extract rdf-xml from a NeXML file

Usage

get_rdf(file)

Arguments

file

the name of a nexml file, or otherwise a nexml object.

Value

an RDF-XML object (XMLInternalDocument). This can be manipulated with tools from the XML R package, or converted into a triplestore for use with SPARQL queries from the rrdf R package.

Examples

Run this code
# NOT RUN {
f <- system.file("examples", "meta_example.xml", package="RNeXML")
rdf <- get_rdf(f)

## Write to a file and read in with rrdf
tmp <- tempfile()
saveXML(rdf, tmp)
library(rrdf)
lib <- load.rdf(tmp)

## Perform a SPARQL query:
sparql.rdf(lib, "SELECT ?title WHERE { ?x <http://purl.org/dc/elements/1.1/title> ?title}")
# }

Run the code above in your browser using DataLab