evomimic / map-holons

3 stars 1 forks source link

Implement GetHolonById #77

Closed evomimic closed 4 months ago

evomimic commented 4 months ago

Summary

This enhancement adds the _get_holon_by_id_ dance to the Uniform API. This dance retrieves an existing holon from its HolonId.

Current State:

The holons zome already offers a native get_holon function that retrieves an individual holon (but not any related holons). HolonId is not currently a recognized ValueType, so we cannot use the RequestBody's Parameters variant to supply the holon_id for the request.

Proposal

Dances Zome

pub enum RequestBody {
    None,
    Holon(Holon),
    HolonId(HolonId), // <= NEW
    ParameterValues(PropertyMap),
    Index(StagedIndex),
}
pub enum ResponseBody {
    None,
    Holon(Holon), // <===== NEW
    Holons(Vec<Holon>), // will be replaced by SmartCollection once supported
    // SmartCollection(SmartCollection),
    Index(StagedIndex),
}

Holons Adapter

/// *DanceRequest:*
/// - dance_name: "get_holon_by_id"
/// - dance_type: Standalone
/// - request_body:
///     - HolonId(HolonId)
///
/// *ResponseBody:*
///     - Holon(Holon)
///

Testing

Definition of Done:

evomimic commented 4 months ago

This enhancement has been folded into Issue #76. Closing this issue.