Learn R Programming

datapack (version 1.0.0)

serializeRDF: Serialize a ResouceMap.

Description

The Redland RDF library is used to serialize the ResourceMap RDF model to a file as RDF/XML.

Usage

serializeRDF(x, ...)
"serializeRDF"(x, file, syntaxName = "rdfxml", mimeType = "application/rdf+xml", namespaces = data.frame(namespace = character(), prefix = character(), stringsAsFactors = FALSE), syntaxURI = as.character(NA))

Arguments

x
a ResourceMap
...
Additional parameters
file
the file to which the ResourceMap will be serialized
syntaxName
name of the syntax to use for serialization - default is "rdfxml"
mimeType
the mimetype of the serialized output - the default is "application/rdf+xml"
namespaces
a data frame containing one or more namespaces and their associated prefix
syntaxURI
A URI of the serialized syntax

Value

status of the serialization (non)

See Also

ResourceMap-class

Examples

Run this code
dp <- new("DataPackage")
data <- charToRaw("1,2,3\n4,5,6")
do1 <- new("DataObject", id="id1", data, format="text/csv")
do2 <- new("DataObject", id="id2", data, format="text/csv")
dp <- addData(dp, do1)
dp <- addData(dp, do2)
dp <- insertRelationship(dp, subjectID="id1", objectIDs="id2", 
  predicate="http://www.w3.org/ns/prov#wasDerivedFrom")
tf <- tempfile(fileext=".xml")
relations <- getRelationships(dp)
resmap <- new("ResourceMap")
resmap <- createFromTriples(resmap, relations, id="myuniqueid")
## Not run: 
# serializeRDF(resmap, tf)
# ## End(Not run)

Run the code above in your browser using DataLab