Arachne 1.0
Arachne - the perpetual stitcher of Wikidata entities.
Loading...
Searching...
No Matches
viewer.hpp
Go to the documentation of this file.
1#ifndef ARIADNE_VIEWER_HPP
2#define ARIADNE_VIEWER_HPP
3
4#include <nlohmann/json.hpp>
5
6#include <filesystem>
7#include <string>
8
9namespace arachne::ariadne {
10
12public:
14 const nlohmann::json& product_export,
15 const nlohmann::json& candidate_export,
16 std::string product_snapshot_id,
17 std::string candidate_snapshot_id = "none"
18 );
19
21 const nlohmann::json& product_export,
22 std::string product_snapshot_id
23 );
24
26 const nlohmann::json& projection_data,
27 const std::filesystem::path& destination,
28 std::string storage_ref, std::string settings_sha256,
29 std::string generated_at
30 );
31
33 const nlohmann::json& projection,
34 const nlohmann::json& catalog_data,
35 const std::filesystem::path& template_root,
36 const std::filesystem::path& site_root, std::string generated_at
37 );
38};
39
40} // namespace arachne::ariadne
41
42#endif
static nlohmann::ordered_json build_site(const nlohmann::json &projection, const nlohmann::json &catalog_data, const std::filesystem::path &template_root, const std::filesystem::path &site_root, std::string generated_at)
Definition viewer.cpp:1233
static nlohmann::ordered_json catalog(const nlohmann::json &product_export, std::string product_snapshot_id)
Definition viewer.cpp:901
static nlohmann::ordered_json project(const nlohmann::json &product_export, const nlohmann::json &candidate_export, std::string product_snapshot_id, std::string candidate_snapshot_id="none")
Definition viewer.cpp:305
static nlohmann::ordered_json write_projection(const nlohmann::json &projection_data, const std::filesystem::path &destination, std::string storage_ref, std::string settings_sha256, std::string generated_at)
Definition viewer.cpp:1186
std::string read_file(const std::filesystem::path &path)
Definition viewer.cpp:202
void write_file(const std::filesystem::path &path, std::string_view content)
Definition viewer.cpp:214
void write_immutable_file(const std::filesystem::path &path, std::string_view content)
Definition viewer.cpp:236
std::optional< std::string > projection_identifier(const nlohmann::json &value, std::string_view field, std::string_view integer_namespace)
Definition viewer.cpp:35
std::string edge_id(std::string_view from, std::string_view to, std::string_view type, std::string_view source_id)
Definition viewer.cpp:143
std::string identifier(const nlohmann::json &value, std::string_view integer_namespace={})
Definition viewer.cpp:89
void upsert_node(std::map< std::string, nlohmann::ordered_json, std::less<> > &nodes, nlohmann::ordered_json node)
Definition viewer.cpp:113
void append_human_edge(nlohmann::ordered_json &edges, std::string from, std::string to, std::string type, std::string assertion_id, std::string snapshot_id, const nlohmann::json &evidence=nlohmann::json::array())
Definition viewer.cpp:155
std::string entity_label(const nlohmann::json &value, const std::string &fallback)
Definition viewer.cpp:103
void validate_site_root(const std::filesystem::path &root)
Definition viewer.cpp:290
const nlohmann::json & array_or_empty(const nlohmann::json &document, std::string_view field)
Definition viewer.cpp:22
std::optional< std::string > projection_identifier(const nlohmann::json &value, std::string_view integer_namespace)
Definition viewer.cpp:64
std::string sha256(std::span< const std::byte > bytes)
Definition crypto.cpp:209
std::string sha256_file(const std::filesystem::path &path)
Definition crypto.cpp:221