Struct Variable

Inheritance Relationships

Base Type

Struct Documentation

struct Variable : public rdf4cpp::Node

Public Functions

Variable() noexcept
explicit Variable(storage::identifier::NodeBackendHandle handle) noexcept
explicit Variable(std::string_view name, bool anonymous = false, storage::DynNodeStoragePtr node_storage = storage::default_node_storage)
Variable to_node_storage(storage::DynNodeStoragePtr node_storage) const
Variable try_get_in_node_storage(storage::DynNodeStoragePtr node_storage) const noexcept
bool is_anonymous() const
CowString name() const
FetchOrSerializeResult fetch_or_serialize_name(std::string_view &out, writer::BufWriterParts writer) const noexcept

bool serialize(writer::BufWriterParts writer) const noexcept

See Node::serialize

explicit operator std::string() const
bool is_blank_node() const = delete
bool is_literal() const = delete
bool is_variable() const = delete
bool is_iri() const = delete
std::strong_ordering order(Variable const &other) const noexcept
bool order_eq(Variable const &other) const noexcept
bool order_ne(Variable const &other) const noexcept
bool eq(Variable const &other) const noexcept
bool ne(Variable const &other) const noexcept

Public Static Functions

static Variable make_named(std::string_view name, storage::DynNodeStoragePtr node_storage = storage::default_node_storage)
static Variable make_anonymous(std::string_view name, storage::DynNodeStoragePtr node_storage = storage::default_node_storage)
static Variable make_unchecked(std::string_view name, bool anonymous = false, storage::DynNodeStoragePtr node_storage = storage::default_node_storage)
static Variable find_named(std::string_view name, storage::DynNodeStoragePtr node_storage = storage::default_node_storage) noexcept

searches for a named Variable in the specified node storage and returns it. returns a null Variable, if not found.

Parameters:
  • name

  • node_storage

Returns:

static Variable find_anonymous(std::string_view name, storage::DynNodeStoragePtr node_storage = storage::default_node_storage) noexcept

searches for an anonymous Variable in the specified node storage and returns it. returns a null Variable, if not found.

Parameters:
  • name

  • node_storage

Returns:

static void validate(std::string_view var_name, bool anonymous = false)

Validates that the given name is a valid Variable name

Parameters:
  • var_name – name to check

  • anonymous – if the variable is supposed to be anonymous

Throws:

ParsingError – if the variable name is not valid

Friends

friend struct Node
friend std::ostream &operator<<(std::ostream &os, const Variable &variable)