-
-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BUG] SerializeGraph does not include TaggedEdge data #31
Comments
Hello @ende124, |
So I dug a bit in the code related to the GraphML serializer and the problem you're facing is because the serializer indeed not takes into account properties of unsupported types (types specified by the GraphML documentation) and also is limited to properties directly declared in the Edge type you are using. This means that // This will work
public class CustomEdge : Edge<Node>
{
[XmlAttribute("weight")]
public float weight { get; set; }
}
// This will NOT work
public class Data
{
[XmlAttribute("weight")]
public float weight { get; set; }
}
public class CustomEdge : TaggedEdge<Node, Data>
{
} Of course it would be better to have both working. I will try to add support of this. Note that if you have some start of work on the subject feel free to suggest it. |
@KeRNeLith That makes sense, I'm glad there is a workaround, it did not cross my mind that one can simply extend Edge. |
@ende124 If the method with a custom Edge fit your needs at least temporarily I think you can go this way. BTW I keep in mind to add support of those kind of Edge (taggued ones) for future releases as it also makes sense. But I can't promise since it requires quite some rework on the GraphML serializer. But I'm optimistic about feasability ^^ |
@KeRNeLith yeah that should not be too much of a problem for me. Appreciate your help and effort on this project :) |
Describe the bug
Serializing a graph to GraphML, discards TaggedEdge data.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Edge data to be included in the graphml as specified here: http://graphml.graphdrawing.org/primer/graphml-primer.html#AttributesDefinition
Additional context
Example code to reproduce this problem
Example code:
This code will print out:
See that this holds vertex data, but no edge data.
The text was updated successfully, but these errors were encountered: