Arachne 1.0
Arachne - the perpetual stitcher of Wikidata entities.
Loading...
Searching...
No Matches
candidates.hpp
Go to the documentation of this file.
1#ifndef ARIADNE_CANDIDATES_HPP
2#define ARIADNE_CANDIDATES_HPP
3
4#include <nlohmann/json.hpp>
5
6#include <cstddef>
7#include <filesystem>
8#include <string>
9
10namespace arachne::ariadne {
11
13 std::size_t pool_size = 3000;
14 std::size_t target_size = 1500;
15 std::size_t group_count = 4;
17 double quality_weight = 0.65;
18};
19
21public:
22 /** Canonical values whose hash identifies one candidate run policy. */
24 const candidate_configuration& configuration = {}
25 );
26
28 const nlohmann::json& external_graph,
29 const candidate_configuration& configuration = {}
30 );
31
32 /**
33 * Publish a resolved materialization artifact and return its validated
34 * research_candidate_graph_plan_v1 control contract.
35 */
37 const nlohmann::json& materialization,
38 const std::filesystem::path& destination, std::string storage_ref,
39 std::string product_snapshot_id, std::string product_snapshot_sha256,
40 const candidate_configuration& configuration, std::string created_at
41 );
42
44 const nlohmann::json& candidate_pool,
45 const nlohmann::json& available_profiles,
46 std::string source_name, std::string locator,
47 std::string created_at
48 );
49};
50
51} // namespace arachne::ariadne
52
53#endif
static nlohmann::ordered_json write_plan(const nlohmann::json &materialization, const std::filesystem::path &destination, std::string storage_ref, std::string product_snapshot_id, std::string product_snapshot_sha256, const candidate_configuration &configuration, std::string created_at)
static nlohmann::ordered_json enrichment_fetch_plan(const nlohmann::json &candidate_pool, const nlohmann::json &available_profiles, std::string source_name, std::string locator, std::string created_at)
static nlohmann::ordered_json configuration_values(const candidate_configuration &configuration={})
static nlohmann::ordered_json build(const nlohmann::json &external_graph, const candidate_configuration &configuration={})
std::vector< ranked_candidate > rank_pool(const graph_input &graph, const candidate_configuration &configuration)
void require_only_fields(const nlohmann::json &value, const std::set< std::string_view, std::less<> > &allowed, std::string_view context)
std::string selection_explanation(const ranked_candidate &candidate)
std::uint64_t natural_identifier(std::string_view value)
bool id_less(std::string_view left, std::string_view right)
void collect_profile_features(const nlohmann::json &value, std::string prefix, feature_vector &output)
void validate_configuration(const candidate_configuration &configuration)
std::map< std::string, double, std::less<> > feature_vector
feature_vector centroid(const std::vector< std::size_t > &members, const std::vector< feature_vector > &features)
graph_input parse_graph(const nlohmann::json &document)
void require_stable_id(std::string_view value, std::string_view context)
void group_and_select(std::vector< ranked_candidate > &pool, const graph_input &graph, const candidate_configuration &configuration)
void publish_immutable_file(const std::filesystem::path &destination, std::string_view bytes)
std::string required_string(const nlohmann::json &value, std::string_view field, std::string_view context)
double weighted_jaccard(const feature_vector &left, const feature_vector &right)
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