Tidy SPARQL Query
tidy_sparql.Rd
Tidies SPARQL query results according to desired specifications (see
tidy_what
parameter for details).
Arguments
- query_res
The results of a SPARQL query, as a data.frame (usually produced by
owl_xml()
$query() or similar fromDOrepo()
, but can also be used to tidy results of robot("query", ...) loaded withreadr
).- tidy_what
The elements of a SPARQL-created data.frame to tidy, as a character vector. One or more of the following:
"everything"
to apply all tidy operations (has precedence over"nothing"
)."header"
to remove leading?
from header labels."unnest"
to unnest list columns withunnest_cross()
."uri_to_curie"
to convert all URIs recognized by DO.utils to CURIEs withto_curie()
."lgl_NA_FALSE"
to replaceNA
in logical columns withFALSE
."as_tibble"
to make the output a tibble."rm_lang_tag"
to remove language tags. Tags will only be removed fromcharacter
class columns, and then only if there is one unique language tag in the given column."nothing"
to prevent all tidying.
- ...
Arguments passed on to
to_curie
strip_angle_brackets
Whether to remove all
<
and>
from the input, as a boolean (default:TRUE
). Where this might have undesirable consequences, e.g. some angle brackets need to be removed, perform the removal beforehand and usestrip_angle_brackets = FALSE
.