Skip to content

Ordering of DataNodeBuilder.existingDns is used to select the root datanode #406

@AlexWan0

Description

@AlexWan0
  1. There can be multiple root datanodes present in the graph.
  2. There can be multiple root datanodes even if you didn't specify multiple concepts in the graph, because the constraint concept in the graph gets added as a root datanode. (I think we always will have multiple root datanodes with this constraint concept added).
  3. During inference, we need to select which root datanode to use (e.g., here).
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions