|
Arachne 1.0
Arachne - the perpetual stitcher of Wikidata entities.
|
Batch courier for Wikidata/Commons: collects IDs, issues HTTP requests, and returns a merged JSON payload. More...
#include <include/pheidippides.hpp>

Public Member Functions | |
| nlohmann::json | fetch_json (const std::unordered_set< std::string > &batch, corespace::entity_kind kind=corespace::entity_kind::any) |
| Fetch metadata for a set of entity IDs and return a merged JSON object. | |
| nlohmann::json | sparql (const corespace::sparql_request &request) |
| Execute a SPARQL query according to the provided request. | |
| nlohmann::json | wdqs (std::string query) |
| Convenience wrapper to run a raw SPARQL query string. | |
| const corespace::network_metrics & | metrics_info () const |
| Access aggregated network metrics of the underlying client. | |
| corespace::call_preview | preview (const corespace::sparql_request &request) const |
| Produce a call preview describing the HTTP request that would be made. | |
Static Public Member Functions | |
| static std::string | join_str (std::span< const std::string > ids, std::string_view separator="|") |
| Join a span of strings with a separator (no encoding or validation). | |
Private Member Functions | |
| corespace::call_preview | build_call_preview (const corespace::sparql_request &request) const |
Private Attributes | |
| corespace::options | opt {} |
| Request shaping parameters (chunking, fields, base params). | |
| corespace::http_client | client {} |
| Reused HTTP client (not thread-safe across threads). | |
| corespace::wdqs_options | wdqs_opt {} |
Batch courier for Wikidata/Commons: collects IDs, issues HTTP requests, and returns a merged JSON payload.
Responsibilities:
Thread-safety:
Definition at line 59 of file pheidippides.hpp.
|
private |
Definition at line 143 of file pheidippides.cpp.
References corespace::service_profile::base_url, corespace::call_preview::body, corespace::choose_http_method(), corespace::call_preview::content_type, corespace::get, corespace::get_service_profile(), corespace::wdqs_options::length_threshold, corespace::call_preview::method, corespace::sparql_request::query, corespace::call_preview::timeout_sec, corespace::sparql_request::timeout_sec, corespace::wdqs_options::timeout_sec, corespace::call_preview::url, corespace::call_preview::use_form_body, corespace::wdqs, and wdqs_opt.
Referenced by preview(), and sparql().


| nlohmann::json arachnespace::pheidippides::fetch_json | ( | const std::unordered_set< std::string > & | batch, |
| corespace::entity_kind | kind = corespace::entity_kind::any ) |
Fetch metadata for a set of entity IDs and return a merged JSON object.
Behavior:
Errors:
| batch | Set of full IDs (e.g., "Q123", "L7-F1", "E42"). |
| kind | Target entity kind (selects API, fields, and filtering). |
Definition at line 29 of file pheidippides.cpp.
References corespace::entity_schema, and corespace::mediainfo.
|
static |
Join a span of strings with a separator (no encoding or validation).
Edge cases:
| ids | Input strings to join. |
| separator | Separator between elements (default: "|"). |
Definition at line 128 of file pheidippides.cpp.
|
nodiscard |
Access aggregated network metrics of the underlying client.
Definition at line 119 of file pheidippides.cpp.
|
nodiscard |
Produce a call preview describing the HTTP request that would be made.
The returned call_preview contains all information necessary to perform the request without actually executing it: resolved URL, HTTP method, query/form parameters, content type/body, Accept header, timeout, and whether the body should be sent as form data.
| request | SPARQL request used to compute the preview. |
Definition at line 124 of file pheidippides.cpp.
References build_call_preview().

| nlohmann::json arachnespace::pheidippides::sparql | ( | const corespace::sparql_request & | request | ) |
Execute a SPARQL query according to the provided request.
Builds the HTTP call preview from request, issues the HTTP call via the internal http_client and parses the returned payload as JSON.
Errors:
| request | Structured SPARQL request (query text, method hint, accept/content-type overrides, timeout, etc.). |
Definition at line 84 of file pheidippides.cpp.
References build_call_preview(), and corespace::get.

| nlohmann::json arachnespace::pheidippides::wdqs | ( | std::string | query | ) |
Convenience wrapper to run a raw SPARQL query string.
Constructs a default sparql_request with the provided query and forwards to sparql().
| query | SPARQL query string to execute. |
Definition at line 113 of file pheidippides.cpp.
References corespace::sparql_request::query.
|
private |
Reused HTTP client (not thread-safe across threads).
Definition at line 161 of file pheidippides.hpp.
|
private |
Request shaping parameters (chunking, fields, base params).
Definition at line 159 of file pheidippides.hpp.
|
private |