This enhancement retrieves and parses SmartLinks from the persistence tier and returns them via a RelationshipMap. Additionally, this enhancement simplifies the RelationshipMap data structures.
Current State
Some SmartLinks are being created.
SmartLinks are being created upon commit of a StagedHolon, but only in a limited way. Specifically,
Outbound SmartLinks are created for each relationship, but their inverse SmartLink is NOT being created. (We need RelationshipDescriptor support to know what the inverse relationship is). This limits navigation to a single direction.
Constraint-Based SmartLinks (e.g., for keys and access_paths) are NOT being created (due to the lack of support for Descriptors and HolonSpaces).
But none are currently being retrieved.
RelationshipTarget has a set of cursors intended to be populated from SmartLinks, but they are not.
Dependencies
Issue #110
Proposal
NOTE: I edited the body of this proposal rather significantly from each original description to take into account the unification of SmartCollection and StagedCollection into HolonCollection and the replacement of RelationshipTarget with HolonCollection.
Add get_relationships_from_links to SmartLinksManager
_In the smart_linkmanager.rs file:
[x] Implement a get_relationships_from_links(source_address:HolonReference, relationship: Option<RelationshipName>)->Result<RelationshipMap, HolonError> function that uses SmartLinks retrieved from the persistence layer to build SmartReferences and aggregate them into one HolonCollection for each RelationshipName it discovers.
This function builds a GetLinksInput struct to pass to the hdk's get_links function.
base_address is set from source_address
link_type is always SmartLink
tag_prefix is set to None if no relationship_name is provided, otherwise, relationship_name is encoded in the _linktag in the same fashion as _linktags are encoded during SmartLink creation.
If links are being retrieved for a single relationship, the resulting RelationshipMap will contain a single entry. That entry's RelationshipTarget's existing HolonCollection will contain 1 SmartReference for each target of that relationship.
If links are being retrieved for all relationships, a different HolonCollection needs to be constructed for each RelationshipName and the resulting RelationshipMap should contain entries for all of the RelationshipNames discovered in the retrieved links.
Testing
No separate test cases will be defined. Full testing of this capability will be handled in #107 .
Definition of Done
[x] Everything compiles, all tests pass and a visual examination of the test log demonstrates the function is working.
This enhancement retrieves and parses SmartLinks from the persistence tier and returns them via a RelationshipMap. Additionally, this enhancement simplifies the RelationshipMap data structures.
Current State
Dependencies
Issue #110
Proposal
NOTE: I edited the body of this proposal rather significantly from each original description to take into account the unification of SmartCollection and StagedCollection into HolonCollection and the replacement of RelationshipTarget with HolonCollection.
Add get_relationships_from_links to SmartLinksManager
_In the smart_linkmanager.rs file:
get_relationships_from_links(source_address:HolonReference, relationship: Option<RelationshipName>)->Result<RelationshipMap, HolonError>
function that uses SmartLinks retrieved from the persistence layer to build SmartReferences and aggregate them into one HolonCollection for each RelationshipName it discovers.GetLinksInput
struct to pass to the hdk'sget_links
function.base_address
is set fromsource_address
link_type
is alwaysSmartLink
tag_prefix
is set toNone
if norelationship_name
is provided, otherwise,relationship_name
is encoded in the _linktag in the same fashion as _linktags are encoded during SmartLink creation.existing
HolonCollection will contain 1 SmartReference for each target of that relationship.Testing
No separate test cases will be defined. Full testing of this capability will be handled in #107 .
Definition of Done