On Fri, Aug 24, 2012 at 2:25 PM, Reto Bachmann-Gmür <r...@apache.org> wrote: > Hello > > I doubt that CLEREZZA-715 and its resolution are correct. IIUC the > default graph is the union of the all the other triple collection. As > some of these are mutable the content of the default graph doesn't > stay constant as this is required for graph instances (for their > hashCode and equals method to be usefull), for this reason I think it > should be a (read-only) MGraph rather than a Graph, >
I had always the impression that Graphs are read-only TripleCollections and MGraphs are read- and writeable TripleCollections. I had never through about immutable Graphs, read-only MGraphs and read- and writeable MGraphs. What are the use cases for immutable graphs in Clerezza? It it really important to have immutable Graphs? Because creating those is really expensive (look at the MGraph#getGraph() implementations that create an in-memory copy of the MGrpah in an SimpleGraph instance). I have already written about that on the list [1] but at that time I was not aware about the reason for that and also the follow up discussion missed to come up with the reason for that. I imagine that a lot of users do call MGraph#getGraph() without realizing that this would clone all the data in the MGrpah. Changing the SingleTdbDatasetTcProvider so that the union-grpah is exposed as read-only MGrpah is really not a big deal. I am just wondering if I am the only one that uses the Graph interface different as the Javadoc says. In any case I would add a big WARNING to the MGrpah#getGraph() method saying that calling this method will create a copy (and not a read-only wrapper) of the MGraph. best Rupert [1] http://mail-archives.apache.org/mod_mbox/incubator-clerezza-dev/201203.mbox/%3c1f7adf98-d5f7-47f2-be72-fc248b921...@gmail.com%3E > Cheers, > Reto -- | Rupert Westenthaler rupert.westentha...@gmail.com | Bodenlehenstraße 11 ++43-699-11108907 | A-5500 Bischofshofen