martaannaj / RecommenderServer

GNU General Public License v3.0
1 stars 2 forks source link

Consider simplifying the output of the recommender by hiding the IItem #54

Open miselico opened 1 year ago

miselico commented 1 year ago

Currently, the interface of the recommender returns PropertyRecommendations

type PropertyRecommendations []RankedPropertyCandidate

type RankedPropertyCandidate struct {
    Property    *IItem
    Probability float64
}

type IItem struct {
    Str              *string
    TotalCount       uint64
    SortOrder        uint32
    traversalPointer *SchemaNode // node traversal pointer
}

This means that the caller receives the full information on the IItem, which seems much more than necessary. The TotalCount, SortOrder, and TraversalPointer are more like implementation details the caller should not have to worry about. Maybe it can be simplified returning a type which only gives the property string and probability. To be checked: does this interfer with the workflow implementation?