rvesse commented on issue #2169:
URL: https://github.com/apache/jena/issues/2169#issuecomment-1981144339

   > Could someone take a look at this improvement?
   > 
   > Unfortunately, I don't see a way to implement really fast cloning of 
graphs as a lightweight sidecar or in a separate module or project. I have 
extended the underlying collections and then implemented the function within 
the graphs.
   
   Tbh the branch doesn't look that heavyweight to me.
   
   What I might consider is generalising your approach by adding a new 
interface `Copyable<T>` which provides a single `T copy()` method and having 
all relevant interfaces/classes extend/implement as appropriate.
   
   You could then consider adding a new utility method `Graph G.copy(Graph 
original)` that could check whether the provided instance implements the new 
interface, and if so defers to the `copy()` method, otherwise does 
`G.copyGraphSrcToDst(original, GraphFactory.createGraphMem())`
   
   > 
   > If I want to use fast cloning today, I need to maintain duplicates of the 
source code of the collections and the graphs in my project. --> Do you see the 
extension as beneficial for the Jena project? --> Otherwise, I would also be 
happy if someone had an idea for a less invasive implementation.
   
   Yes there's definitely value here
   
   Generalising it and making it opt-in may make it less invasive and allow us 
to adopt it over time in other places as appropriate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to