Struct Anonymizer

Struct Documentation

struct Anonymizer

A utility for anonymizing nodes and graphs. When used via Graph::anonymize or Dataset::anonymize will keep the graph/dataset structure intact while removing all other information.

Public Functions

explicit Anonymizer(storage::DynNodeStoragePtr node_storage = storage::default_node_storage)

Initialize the anonymizer

Parameters:

node_storage – node storage where to anonymizer will place its nodes

storage::DynNodeStoragePtr node_storage() const noexcept
Returns:

the node storage where this anonymizer places its nodes

IRI anonymize(Node const &non_anon)

Anonymize a node by replacing sensitive data with randomly generated data. Passing in the same node yield the same anonymized node as last time, this is to ensure that the graph structure stays intact.

Any node passed in gets turned into an IRI matching the following regex: <http://example.com/[a-zA-Z]{16}> except for the null node and the default graph IRI which both stay as they are.

Parameters:

non_anon – non-anonymized node to anonymize

Returns:

anonymized node

Statement anonymize(Statement const &non_anon)

Anonymize a statement by anonymizing each component (subject, predicate and object)

Quad anonymize(Quad const &non_anon)

Anonymize a quad by anonymizing each component (graph, subject, predicate and object)