prefix_serializer: Serializes a Prefix Vector

Description Usage Arguments Details Value Examples

View source: R/prefix.R

Description

If reqd is left missing, all prefixes will be returned. The individual prefixes may or may not end with ":". If they don't, it will be added during function execution.

Usage

1
prefix_serializer(prefixes, reqd = names(prefixes), lang = "SPARQL")

Arguments

prefixes

named character. Contains prefixes. Names are the prefixes.

reqd

a character vector of needed prefixes, can be missing, then take all.

lang

character. The serialization language. One of "SPARQL" or "Turtle". Default is "SPARQL"

Details

Note the base prefix should be denoted as "_base". Its seriazliation is then

PREFIX : partial_uri

Value

prefix serialization.

Examples

1
2
3
4
5
6
7
prefixes = c(
  rdfs = "http://www.w3.org/2000/01/rdf-schema#",
  foaf = "http://xmlns.com/foaf/0.1/",
  openbiodiv = "http://openbiodiv.net/"
 )
prefix_serializer(prefixes, reqd = c("rdfs", "openbiodiv"))
prefix_serializer(prefixes, reqd = c("rdfs", "openbiodiv"), lang = "Turtle")

vsenderov/rdf4r documentation built on May 3, 2019, 4:02 p.m.