Commit graph

8 commits

Author SHA1 Message Date
Yann Lanthony
0594f593f2 [core][graphIO] PartialSerializer: fix List/GroupAttribute link serialization
Ensure attribute input connection is serialized, even for List/GroupAttributes.
Note: while connecting GroupAttributes is not yet supported, this will benefit
this type of attribute once it is.
2025-02-06 18:19:19 +01:00
Yann Lanthony
25094ac877 [core] Handle missing link nodes when deserializing edges
Avoid uncaught errors when deserializing edges in case linked
nodes are missing.
Handle missing nodes the same way missing attributes are dealt with.
2025-02-06 16:46:05 +01:00
Yann Lanthony
87fbcee06d [core][graphIO] Improve node type version handling
* Deserialization: Replace the logic that defaulted the node type version to "0.0" when unspecified,
and assume that unspecified version on a node is targetting current node type version.
* Serialization: Only serialize node type versions for which a version info is available.

* Test suites:
  * Add helper context manager to manually override the version of a given node type.
  * Add new unit tests to cover version conflicts handling is various scenarios.
2025-02-06 16:46:05 +01:00
Yann Lanthony
4e29b83226 [test] Extra partial serialization tests 2025-02-06 16:46:05 +01:00
Yann Lanthony
bfc642e2dc [core] Add Graph.copy method
Add a new method to create a copy of a graph instance, relying on
chaining serialization and deserialization operations.
Add test suite to validate its behavior, and the underlying serialization processes.
2025-02-06 16:46:04 +01:00
Yann Lanthony
6b75dcb356 [core][graphIO] Introduce PartialGraphSerializer
Add a new serializer class to manage partial graph serialization logic,
ensuring to remove link expressions on attributes refering to nodes
that are not in the subset of nodes to serialize.
2025-02-06 16:46:04 +01:00
Yann Lanthony
3064cb9b35 [core] CompatibilityNode: do not use link expressions as default values for unknown File attributes
When creating a compatibility description for an unknown attribute, do not
consider a link expression as the default value for a File attribute.
This is breaking how the link expression solving system works, as it's resetting
the attribute to its default value after applying the link.
If that expression is kept as the default value, it can be re-evaluated several
times incorrectly.
Added a test case that was failing before that change to illustrate the issue.
2025-02-06 16:46:04 +01:00
Yann Lanthony
4aec741a89 [core] Graph: add importGraphContent API
Extract the logic of importing the content of a graph within a graph instance from
the graph loading logic.
Add `Graph.importGraphContent` and `Graph.importGraphContentFromFile`
methods.
Use the deserialization API to load the content in another temporary graph instance,
to handle the renaming of nodes using the Graph API, rather than manipulating
entries in a raw dictionnary.
2025-02-06 16:46:04 +01:00