Menu

#830 Clone but only partially

3.5.x
closed-accepted
nobody
None
5
2016-06-08
2016-06-07
No

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?

Related

Bugs: #830

Discussion

  • brenoust

    brenoust - 2016-06-07

    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:


    Status: open
    Group: 3.5.x
    Created: Tue Jun 07, 2016 08:06 PM UTC by Melançon Guy
    Last Updated: Tue Jun 07, 2016 08:06 PM UTC
    Owner: nobody

    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?

    Sent from sourceforge.net because tulipdev@labri.fr is subscribed to
    https://sourceforge.net/p/auber/bugs/

    To unsubscribe from further messages, a project admin can change settings
    at https://sourceforge.net/p/auber/admin/bugs/options. Or, if this is a
    mailing list, you can unsubscribe from the mailing list.

     

    Related

    Bugs: #830

    • Melançon Guy

      Melançon Guy - 2016-06-07

      You 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.

       
  • Patrick Mary

    Patrick Mary - 2016-06-08

    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.

     
  • Melançon Guy

    Melançon Guy - 2016-06-08

    Great, thanks Patrick.

     
  • Patrick Mary

    Patrick Mary - 2016-06-08
    • status: open --> closed-accepted
     
    • brenoust

      brenoust - 2016-06-08

      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:

      • status: open --> closed-accepted
      • Comment:

      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.


      Status: closed-accepted
      Group: 3.5.x
      Created: Tue Jun 07, 2016 08:06 PM UTC by Melançon Guy
      Last Updated: Wed Jun 08, 2016 02:52 PM UTC
      Owner: nobody

      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?

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/auber/bugs/830/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #830

      • Patrick Mary

        Patrick Mary - 2016-06-09

        It 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.

         
  • Patrick Mary

    Patrick Mary - 2016-06-08

    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.

     

Log in to post a comment.