You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commonsrdf.apache.org by "Stian Soiland-Reyes (JIRA)" <ji...@apache.org> on 2015/05/07 01:14:59 UTC

[jira] [Updated] (COMMONSRDF-23) Indication of graph immutability?

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

Stian Soiland-Reyes updated COMMONSRDF-23:
------------------------------------------
    Description: 
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 :)


  was:
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 :)



> Indication of graph immutability?
> ---------------------------------
>
>                 Key: COMMONSRDF-23
>                 URL: https://issues.apache.org/jira/browse/COMMONSRDF-23
>             Project: Apache Commons RDF
>          Issue Type: Wish
>    Affects Versions: 0.1
>            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)