Struct Graph

Nested Relationships

Nested Types

Struct Documentation

struct Graph

Public Types

using value_type = Statement
using size_type = size_t
using difference_type = ptrdiff_t
using reference = Statement const&
using const_reference = reference
using pointer = Statement const*
using const_pointer = pointer
using sentinel = std::default_sentinel_t
using const_iterator = iterator

Public Functions

explicit Graph(storage::DynNodeStoragePtr node_storage = storage::default_node_storage) noexcept
void add(Statement const &statement)
size_t size() const noexcept
bool contains(Statement const &statement) const noexcept
solution_sequence match(query::TriplePattern const &triple_pattern) const noexcept
iterator begin() const noexcept
sentinel end() const noexcept
bool serialize_turtle(writer::BufWriterParts writer) const noexcept

Serialize this graph as Turtle This function will internally create a SerializationState and call begin and flush on it when appropriate.

Parameters:

writer – writer parts

Returns:

true if serialization was successful, false if a call to W::flush was not able to make room

Graph anonymize(util::Anonymizer &anonymizer) const

Anonymize the graph by removing all information except for the graph structure itself.

See rdf4cpp::util::Anonymizer for details

Public Members

template<typename ErrF = decltype([](parser::ParsingError) noexcept {})> void load_rdf_data(std::istream &rdf_file, parser::ParsingFlags flags=parser::ParsingFlags::none(), parser::ParsingState *state=nullptr, ErrF &&errf={}) requires std bool serialize_turtle (writer::SerializationState &state, writer::BufWriterParts writer) const noexcept

Serialize this graph as N-Triples.

Param writer:

writer parts

Param writer:

writer parts

Return:

true if serialization was successful, false if a call to W::flush was not able to make room Serialize this graph as Turtle This function does not call begin or flush on the given state, it just serialized the contents of this Graph using it.

Return:

true if serialization was successful, false if a call to W::flush was not able to make room

Friends

friend std::ostream &operator<<(std::ostream &os, Graph const &graph)

Serialize this graph as N-Triples.

struct iterator

Public Types

using iterator_category = std::input_iterator_tag
using value_type = Statement
using difference_type = ptrdiff_t
using pointer = value_type const*
using reference = value_type const&

Public Functions

iterator() noexcept = default
iterator(Graph const *parent, typename triple_storage_type::const_iterator beg, typename triple_storage_type::const_iterator end) noexcept
iterator &operator++() noexcept
void operator++(int) noexcept
reference operator*() const noexcept
pointer operator->() const noexcept

Friends

friend bool operator==(iterator const &self, sentinel) noexcept
friend bool operator==(sentinel, iterator const &self) noexcept
struct solution_iterator

Public Types

using iterator_category = std::input_iterator_tag
using value_type = query::Solution
using difference_type = ptrdiff_t
using pointer = value_type const*
using reference = value_type const&

Public Functions

solution_iterator() noexcept = default
solution_iterator(typename Graph::iterator beg, query::TriplePattern const &pat) noexcept
solution_iterator &operator++() noexcept
void operator++(int) noexcept
reference operator*() const noexcept
pointer operator->() const noexcept

Friends

friend bool operator==(solution_iterator const &self, sentinel) noexcept
friend bool operator==(sentinel, solution_iterator const &self) noexcept
struct solution_sequence

Public Types

using value_type = query::Solution
using size_type = size_t
using difference_type = ptrdiff_t
using reference = value_type const&
using const_reference = reference
using pointer = value_type const*
using const_pointer = pointer
using iterator = solution_iterator
using const_iterator = solution_iterator
using sentinel = std::default_sentinel_t

Public Functions

inline explicit solution_sequence(iterator beg) noexcept
inline iterator begin() const noexcept

Public Static Functions

static inline sentinel end() noexcept