-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed the behavior of
rdf_serialize
to accept a vector of prefix …
…to namespace bindings. (#22) * Update rdf_serialize.R Changed the `rdf_serialize` function to accept multiple prefix to namespace mappings via the `namespace` parameter. The `namespace` parameter needs now to be a named character. `names(namespace)` contains the prefixes, whereas `namespace` itself contains the namespaces. Example: ``` infile <- system.file("extdata", "dc.rdf", package="redland") out <- tempfile("file", fileext = ".rdf") some_rdf <- rdf_parse(infile) rdf_add(some_rdf, subject = "http://www.dajobe.org/dave-beckett", predicate = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", object = "http://xmlns.com/foaf/0.1/Person") rdf_serialize(some_rdf, out, format = "turtle", namespace = c(dc = "http://purl.org/dc/elements/1.1/", foaf = "http://xmlns.com/foaf/0.1/") ) readLines(out) ``` * changes to documentation regarding fix * backward compatibility change * fixed documentation as well * added check for length(prefix) == length(namespace) * added myself as contributor :)
- Loading branch information
1 parent
39ff7c9
commit d5105ed
Showing
3 changed files
with
45 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.