Struct IRI

Inheritance Relationships

Base Type

Struct Documentation

struct IRI : public rdf4cpp::Node

IRI Resource node.

Public Functions

operator datatypes::registry::DatatypeIDView() const noexcept

Constructs the corresponding datatype id for this iri. Return value can be safely used to index the registry and yields the correct result.

explicit IRI(storage::identifier::NodeBackendHandle handle) noexcept

Constructs an IRI from a node backend handle

IRI() noexcept

Constructs the null-iri

explicit IRI(std::string_view iri, storage::DynNodeStoragePtr node_storage = storage::default_node_storage)

Constructs an IRI object from a IRI string

Parameters:
  • iriIRI string

  • node_storage – optional custom node_storage used to store the IRI

Throws:

rdf4cpp::ParsingError – if iri is invalid

IRI to_node_storage(storage::DynNodeStoragePtr node_storage) const
IRI try_get_in_node_storage(storage::DynNodeStoragePtr node_storage) const noexcept
std::string_view identifier() const noexcept

Get the IRI string of this.

Returns:

IRI string

FetchOrSerializeResult fetch_or_serialize_identifier(std::string_view &out, writer::BufWriterParts writer) const noexcept

bool serialize(writer::BufWriterParts writer) const noexcept

See Node::serialize

explicit operator std::string() const noexcept
bool is_literal() const noexcept = delete
bool is_variable() const noexcept = delete
bool is_blank_node() const noexcept = delete
bool is_iri() const noexcept = delete
TriBool is_default_graph() const noexcept
Returns:

err if this is null, otherwise true iff this IRI is the default graph IRI

TriBool is_rdf_type() const noexcept

Check if this IRI is rdf:type

Returns:

err if this is null, otherwise true iff this IRI is rdf:type

template<datatypes::LiteralDatatype T>
inline TriBool is_datatype() const noexcept

Check if this IRI is the IRI of the given datatype

Template Parameters:

T – datatype

Returns:

err if this is null, otherwise true iff this IRI is the datatype IRI of the given datatype

Public Static Functions

static IRI make_null() noexcept

Constructs the null-iri

static IRI make(std::string_view iri, storage::DynNodeStoragePtr node_storage = storage::default_node_storage)

Constructs an IRI object from a IRI string.

Parameters:
  • iriIRI string

  • node_storage – optional custom node_storage used to store the IRI

Throws:

rdf4cpp::ParsingError – if iri is invalid

static IRI make_unchecked(std::string_view iri, storage::DynNodeStoragePtr node_storage = storage::default_node_storage)

Constructs an IRI object from a IRI string without checking if the IRI is valid.

Parameters:
  • iriIRI string

  • node_storage – optional custom node_storage used to store the IRI

static IRI make_uuid(storage::DynNodeStoragePtr node_storage = storage::default_node_storage)

creates a new IRI containing a random UUID (Universally Unique IDentifier)

Returns:

UUID IRI

static IRI find(std::string_view iri, storage::DynNodeStoragePtr node_storage = storage::default_node_storage) noexcept

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

Parameters:
  • iri

  • node_storage

Returns:

static void validate(std::string_view iri)

Validates that the given input string is a valid IRI

Parameters:

iri – iri string to validate

Throws:

ParsingError – if the given IRI is invalid

static IRI default_graph(storage::DynNodeStoragePtr node_storage = storage::default_node_storage)

Get the default graph IRI.

Parameters:

node_storage – optional custom node_storage where the returned IRI lives

Returns:

default graph IRI

static IRI rdf_type(storage::DynNodeStoragePtr node_storage = storage::default_node_storage)

Get the IRI for rdf:type

Parameters:

node_storage – optional custom node_storage where the returned IRI lives

Returns:

rdf:type IRI

template<datatypes::LiteralDatatype T>
static inline IRI datatype(storage::DynNodeStoragePtr node_storage = storage::default_node_storage)

Get the IRI for the given datatype

Template Parameters:

T – datatype

Parameters:

node_storage – optional node storage where the returned IRI is placed

Returns:

datatype IRI

Friends

friend struct Node
friend struct Literal
friend std::ostream &operator<<(std::ostream &os, const IRI &iri)