Skip to contents

OWL is an S7 class to compose and manage SPARQL queries. OWL objects. Have an attached environment, in which to keep track of the "non-SPARQL query code" parts of the OWL object. This includes custom triple generating functions (terms), but also the variables named in the query so far.

Usage

OWL(
  .env = list(V = character(0L), prefixes = data.frame()),
  C = list(),
  P = list(),
  prefix = "",
  query = "SELECT * ",
  where = ""
)

Arguments

.env

Named list. Contains additional information, for instance those generated from map_endpoint()

C, P

OWL_env objects containing term functions, for instance generated by map_endpoint().

prefix

Named list of character scalars, where values are long-form and names are the corresponding abbreviation.

query

Named list of character vectors, with first element indicating query form (SELECT, ASK, DESCRIBE), and the second indicating the content of the query itself.

where

List of triples

Value

a OWL object.

Slots

.env

Named list. Contains additional envitonmental information besides convenience functions generated from map_endpoint()

.sparql

Named list. Contains SPARQL code in three sections: prefix, query and where.

to_SPARQL

Retrieves the contained SPARQL query as a Character scalar.

Examples

OWL()
#> pallas::OWL tbl S7_object.
#> 
#> SELECT * 
#> WHERE
#> {
#> 
#> }
#> No 'prefix' found. Add one or more prefixes with `add_prefix()`.
#> No 'where' found. Add where-clauses with `where_clause()`.