You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jena.apache.org by "sszuev (via GitHub)" <gi...@apache.org> on 2023/08/16 10:04:17 UTC

[GitHub] [jena] sszuev opened a new issue, #1990: UnmodifiableGraph does not work as expected

sszuev opened a new issue, #1990:
URL: https://github.com/apache/jena/issues/1990

   ### Version
   
   4.9.0
   
   ### What happened?
   
   Expect all modify operations are prohibited.
   ```java
   import org.apache.jena.graph.Graph;
   import org.apache.jena.graph.NodeFactory;
   import org.apache.jena.graph.Triple;
   import org.apache.jena.sparql.graph.GraphFactory;
   
   public class TmpUnmodifiableGraph {
   
       public static void main(String[] args) {
           Graph graph = new org.apache.jena.sparql.graph.UnmodifiableGraph(GraphFactory.createGraphMem());
           try {
               graph.add(Triple.create(NodeFactory.createURI("a"), NodeFactory.createURI("b"), NodeFactory.createURI("c")));
               throw new AssertionError();
           } catch (Exception e) {
               e.printStackTrace();
           }
       }
   }
   ```
   
   This is quite an old problem (also in 3.x.x)
   So, probably, this is by design. But strange.
   
   ### Relevant output and stacktrace
   
   _No response_
   
   ### Are you interested in making a pull request?
   
   None


-- 
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: issues-unsubscribe@jena.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org


[GitHub] [jena] afs closed issue #1990: UnmodifiableGraph does not work as expected

Posted by "afs (via GitHub)" <gi...@apache.org>.
afs closed issue #1990: UnmodifiableGraph does not work as expected
URL: https://github.com/apache/jena/issues/1990


-- 
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: issues-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org


[GitHub] [jena] afs commented on issue #1990: UnmodifiableGraph does not work as expected

Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #1990:
URL: https://github.com/apache/jena/issues/1990#issuecomment-1680538344

   #1991 should address the issue.
   
   It is draft at the moment.
   


-- 
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: issues-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org


[GitHub] [jena] afs commented on issue #1990: UnmodifiableGraph does not work as expected

Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #1990:
URL: https://github.com/apache/jena/issues/1990#issuecomment-1681164041

   It's a consequence of the wrapper pattern. `UnmodifiableGraph.add` calls `base.add` which will calls `base.performAdd`.
   
   `UnmodifiableGraph` would need to intercept `add(Triple)` and `delete(Triple)`, as well as `remove` and `clear`.
   
   But probably better to delete it because there is `GraphReadOnly` (#1991 fixes immutability for the prefixmapping).


-- 
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: issues-unsubscribe@jena.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org