[ 
https://issues.apache.org/jira/browse/COMMONSRDF-23?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stian Soiland-Reyes updated COMMONSRDF-23:
------------------------------------------
    Fix Version/s:     (was: 0.3.0)

> Indication of graph immutability?
> ---------------------------------
>
>                 Key: COMMONSRDF-23
>                 URL: https://issues.apache.org/jira/browse/COMMONSRDF-23
>             Project: Apache Commons RDF
>          Issue Type: Wish
>          Components: api
>    Affects Versions: 0.1.0
>            Reporter: Stian Soiland-Reyes
>            Assignee: Stian Soiland-Reyes
>
> Alexandre Bertails notes on 
> [2015-05-06|http://mail-archives.apache.org/mod_mbox/commonsrdf-dev/201505.mbox/%3CCANvn8kzfnDoA%3DsgZLmHyN%3DbE2Gmba%3D1oNO0Haq72mi_GFkLRng%40mail.gmail.com%3E]:
> {quote}
> > Right now, there is no support in commons-rdf for immutable
> > operations. `Graph`s are mutable by default. Is there any plan to make
> > an API for immutable graphs? Graphs in banana-rdf are immutable by
> > default, and they are persistent in Plantain. We could always wrap an
> > immutable graph in a structure with a `var`, but, well, there are
> > better ways to do that.
> {quote}
> and I (Stian) replied:
> {quote}
> There has been suggestions along those lines. It is not a requirement of 
> Graph now to allow .add() etc. - but there is no method to ask if a graph is 
> mutable or not.
> In the user guide 
> http://commonsrdf.incubator.apache.org/userguide.html#Adding_triples we 
> therefore say:
> > Note: Some Graph implementations are immutable, in which case the below may 
> > throw an UnsupportedOperationException.
> We could probably add this to the Javadoc of the mutability methods of Graph 
> with an explicit @throws.
> {quote}
> Some options I can see:
> a) Add @throws UnsupportedOperationException indications as above to 
> add/remove/clear
> b) Add a ImmutableGraph marker interface -- as in Clerezza RDF Core  (.. with 
> equals() measures as well?)
> c) Add boolean isMutable() method to Graph
> d) Move add/remove/clear to a sub-type MutableGraph
> My own preferences are about that same order :)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to