Re: Read-only wrapper for Jena Model

2021-12-20 Thread Martynas Jusevičius
Thanks Andy. I want to resolve imports and run inferences and then wrap it to make it immutable so it can be passed around but not modified. The getOntology() method is being used so OntModel is preferred to plain Model. On Mon, 20 Dec 2021 at 13.55, Andy Seaborne wrote: > > > On 18/12/2021

Re: Read-only wrapper for Jena Model

2021-12-20 Thread Andy Seaborne
On 18/12/2021 22:00, Martynas Jusevičius wrote: Andy, A follow-up question: how would you create an immutable OntModel? OntModel ontModel = ModelFactory.createOntologyModel(ontModelSpec, modelRO); Would the ontModel still be mutable? Don't know. And what do you want with regards

Re: Read-only wrapper for Jena Model

2021-12-18 Thread Martynas Jusevičius
Andy, A follow-up question: how would you create an immutable OntModel? OntModel ontModel = ModelFactory.createOntologyModel(ontModelSpec, modelRO); Would the ontModel still be mutable? On Sat, Aug 28, 2021 at 3:43 PM Andy Seaborne wrote: > > > > On 27/08/2021 12:23, Zak Mc Kracken wrote:

Re: Read-only wrapper for Jena Model

2021-09-01 Thread Zak Mc Kracken
Thank you both, Andy and Martynas, the GraphReadOnly approach seems to work well and feels more natural than model union. Martynas, I swear I searched before asking again! :-) Best, Marco. On 28/08/2021 15:01, Martynas Jusevičius wrote: I remember asking a similar question 5 years ago :)

Re: Read-only wrapper for Jena Model

2021-08-28 Thread Martynas Jusevičius
I remember asking a similar question 5 years ago :) https://mail-archives.apache.org/mod_mbox/jena-users/201610.mbox/%3cCAE35VmwR+QjzGiEcWwO0sVJcFcnb=CTYqHc-fp7iF550=1b...@mail.gmail.com%3e ModelFactory.createUnion() might to be an option.

Re: Read-only wrapper for Jena Model

2021-08-28 Thread Andy Seaborne
On 27/08/2021 12:23, Zak Mc Kracken wrote: Hi all, I have a little RDF file (describing a dataset metadata), which I want to read in an helper class and return as a read-only view on the file. The reason to return it as read-only is that I also keep a simple cache of uri/Object, which is

Read-only wrapper for Jena Model

2021-08-27 Thread Zak Mc Kracken
Hi all, I have a little RDF file (describing a dataset metadata), which I want to read in an helper class and return as a read-only view on the file. The reason to return it as read-only is that I also keep a simple cache of uri/Object, which is a simplified view of RDF resources in the file,