#' @export
root_id = function(node, access_options, xml_schema, xml, schema_name, mongo_key, prefix = NA, blank = FALSE)
{
# Is the root id set?
root_node = xml2::xml_find_all(node, xpath = "/*")
if (is.na(xml2::xml_attr(root_node, "obkms_id"))) {
ltitle <- literal(
xml2::xml_text( xml2::xml_find_all(node, xml_schema$atoms["title"]))[1],
xsd_type = rdf4r::xsd_string,
lang = NA
)
id = identifier_new(root_node, xml, schema_name, mongo_key, prefix = NA, blank = FALSE)
xml2::xml_attr(root_node, "obkms_id") = id
#save_mongo - use ltitle as label
}
id = xml2::xml_attr(root_node, "obkms_id")
uri = strip_angle(pasteif(prefix[1], "/",id, cond = (!is.na(prefix)),
return_value = id), reverse = TRUE)
qname = pasteif(names(prefix)[1], id, sep = ":", cond = !is.na(prefix), return_value = uri)
ll = list(id = id, uri = uri, qname = qname, prefix = prefix)
class(ll) = "identifier"
ll
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.