Serializer-class: An RDF Serializer object.

Serializer-classR Documentation

An RDF Serializer object.

Description

The Serializer class provides methods to convert a Model object to other forms, for example, write out a Model to a file.

Slots

librdf_serializer

A redland statement object

Methods

  • Serializer-initialize: Initialize a Serializer object.

  • setNameSpace: Set a namespace for the serializer.

  • serializeToCharacter: Serialize a model to a character vector.

  • serializeToFile: Serialize a model to a file.

  • freeSerializer: Free memory used by a librdf serializer.

See Also

redland: redland package

Examples

world <- new("World")
storage <- new("Storage", world, "hashes", name="", options="hash-type='memory'")
model <- new("Model", world, storage, options="")
filePath <- system.file("extdata/example.rdf", package="redland")
parser <- new("Parser", world)
parseFileIntoModel(parser, world, filePath, model)
# Creat the default "rdfxml" serizlizer
serializer <- new("Serializer", world)
# Add a namespace definition to the serializer
status <- setNameSpace(serializer, world, namespace="http://purl.org/dc/elements/1.1/", prefix="dc")
rdf <- serializeToCharacter(serializer, world, model, baseUri="")

redland documentation built on May 31, 2023, 6:32 p.m.