Skip to contents

a_class() is a helper function to mimic the a <Class> pattern in sparql. While a_class() could be called directly, the intended use is to serve as a template to generate prefix-specific functions for each type known by the endpoint.

Arguments

x

name. Likely referring to some variable, i.e., ?some_variable.

what

Character scalar. Which type to use.

prefix

Character scalar. Name of the prefix the class is from. (Default: "")

...

additional arguments

Value

a triple object.

Examples

# a_class defines a triple:
# a_class() handles '?' symbols.
a_class(A, what = "type", prefix = "p")
#> pallas::triple character S7_object.
#> subject  predicate  object     
#>       A          a  p:type  .  
a_class(?A, what = "type", prefix = "p")
#> pallas::triple character S7_object.
#> subject  predicate  object     
#>      ?A          a  p:type  .  
a_class(p_A:A, what = "type", prefix = "p")
#> pallas::triple character S7_object.
#> subject  predicate  object     
#>   p_A:A          a  p:type  .