This might not be a bug, but simply is the way things were done.
Suppose that I have a graph G and that I want to add a clone H of this graph as a sibling.
Now, it seems the clone H will not contian any user property part of the cloned graph G.
System properties, on the contrary are properly copied to the clone. One could imagine the addCloneSubGraph method to include a parameter specifying whether user properties should be preserved or not.
Or am I missing something here?
Hello Guy,
Can you give us some more details on how you're processing exactly?
From what I understand, and to my experience, if your create a clone
subgraph,
not really any property are created, instead, it's a matter of when
properties are
accessed. Thus if no 'local' property is defined (which is a good thing)
your subgraph
will by default inherit from the parent graph's properties (as 'inherited'
property).
So the behavior you are mentioning, using 'addCloneSubGraph' would be to
create
a given number of duplicate entries.
Does that help?
--
Benjamin
On 8 June 2016 at 05:06, Melançon Guy melancon@users.sf.net wrote:
Related
Bugs:
#830You missed my point.
Take the root graph R. Add a subgraph G. Create a property p for that subgraph G.
Clone G to obtain H as a sibling of G. Then what I saw is that property p was not brought into H -- when p is a user defined property. it seems system defined properties like viewMetric will indeed be copied into H. Looks ackward since I could well copy into viewMetric anything I had stored into a double property.
When cloning a subgraph G into a sibling H, none of the G local properties are copied
into H, but as G and H having the same graph ancestor, they share the same inherited
properties.
Surely it might be useful to add a new argument to addCloneSubGraph to enable the
the cloning of existing local properties (no cloning will be the default).
So I propose to close this bug and to add this new behaviour for the next release.
Great, thanks Patrick.
Since we're talking about copying properties, I'm just feeding the
discussion. I noticed we don't have helpers to duplicate properties in
local, which comes handy. Of course, this is quickly written by ourselves,
but copying properties in local is something that we often deal with
especially when we have a deep hierarchy of graphs.
Something behaving like graph.addNode(node) maybe
graph_target.add/copyProperty(property, graph_source), in contrast with the
getProperty(propertyname). By extension, we could have also something like
graph_target.copyAllLocalProperties(graph_source), which will do what you
need Guy.
--
Benjamin
On 9 June 2016 at 00:18, Patrick Mary pmary@users.sf.net wrote:
Related
Bugs:
#830It seems that the Python binding of the PropertyInterface class does not
provide all the clone/copy stuff provided by the C++ implementation.
It shoud be fixed for the next release.
I will implement the new behaviour for the next release,
in adding a new boolean argument 'addSiblingProperties'.
If set to true the local properties will be cloned into the sibling of the graph, if false (the default) the local properties will not be cloned.