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,
so a modifiable Model would make it impossible to keep the two aligned.
That said, I wonder if there is some read-only wrapper for the Jena's
Model interface, something similar to Collections.unmodifiableXXX(),
which of course, would be based on the decorator pattern, with
delegation to a base Model for most of the interface methods, except
interceptors for addXXX(), which would throw
UnsupportedOperationException. Would be easy to implement it, but I
don't like to reinvent wheels, if something like that already exists.
Thanks,
Marco.
- Read-only wrapper for Jena Model Zak Mc Kracken
-