-
Notifications
You must be signed in to change notification settings - Fork 7
Description
- There can be multiple root datanodes present in the graph.
- There can be multiple root datanodes even if you didn't specify multiple concepts in the graph, because the
constraintconcept in the graph gets added as a root datanode. (I think we always will have multiple root datanodes with this constraint concept added). - During inference, we need to select which root datanode to use (e.g., here).
- Currently, we select the first of the root datanodes to use (see above link).
Importantly, we also assume (4) when dealing with the constraint concept: we don't want this concept to be used as a root datanode (as in (3)), but we still need to add to the list of root datanodes because, otherwise, we can't access it from InferenceModel. Currently, to fix this, on each update (DataNodeBuilder.__updateRootDataNodeList), we make sure that the constraint concept is never the first concept. This means that changing the ordering of the root datanodes can break the code.
However, a better solution would be to not rely on this ordering at all to determine when root datanode. Mainly, it's not obvious that the ordering matters which might result in bugs later on. Also, this ordering can change, resulting in possibly non-deterministic errors depending on which datanode gets selected in (3).
Also, it may be useful to allow the developer to specify which concept should be used as the root as well. If the developer doesn't specify, select (arbitrarily?) using some other method.