Closed dozed closed 7 years ago
@stew or @kaiserpelagic might have some insights here. Sorry I didnt notice your request earlier, @dozed :-)
@dozed I think this is at the very least a documentation bug (I could be convinced otherwise though), as a Context
in this situation should only refer to Nodes
already in the Graph
. I see a couple of options here 1) throw an error in this situation (undesirable), 2) return an Option
3) document the behavior and provide some functionality to create a Graph
from a Context
. What do you think?
Yeah, this is a documentation issue, but is working as designed. The Context
describes the context of a node within a given graph. In this case ctx
assumes a graph that contains nodes 2 and 3.
The reason to not throw an error in the presence of node 3 is that the intent is to allow adding node 3 to this graph later, in which case it would already have an edge from node 2.
Most importantly, we always want the following to be true:
g & c decomp c.vertex == Decomp(Some(c), g)
embed
should only ever add a single node: the node under focus in the Context
.
I would expect that embedding a context, embeds all the nodes from that context to the new graph. Currently in the new graph the nodes appear in the node's context, and also in
predecessors
andsuccessors
, but not innodes
.decomp
does not give the node labels in the context, which prevents adding nodes when embedding.Is this a known issue? Are there any plans to address this?