On 10/05/13 11:46, Andy Seaborne wrote:
The users@ message said "a few weeks" and I was all set to do the
release ...

Then the JENA-450 report came in. JENA-450 is the problem that code
can't create OntModels inside read transactions when the model is new --
it tries to set prefixes and read-only really is read-only.

The OntModelImpl constructor copies in prefixes from the profile.  If
the model is new, the prefixes aren't defined in the model, and the code
sets them.  But it can't.

A couple of possible fixes:

1/ Put try{} around the setNsPrefix loop and skip if an exception occurs.

2/ Always have an updatable in-memory prefix mapping for read-only model.

(2) seems better but I'm not absolutely sure how to achieve it yet
within the current mechanism.
It would be so, so much better if a prefix mapping was a thing that a model had by composition, rather than a thing that a model subclassed. That might be a good change to think about making in future. I've never liked the current setup :)

Is there a way of telling whether a model is read-only, other than trying a write and catching the exception?

An alternative behaviour-altering change would be to remove the default prefixes from OntModel altogether, hence no need to do any updates in the constructor. OntModel is the only model that does set default prefixes, and the ones it sets are rdf:, rdfs:, owl: and xsd:. One could argue that there's utility in those being available in all models by default, in which case it could be a read-only extension to the base mapping.


Long term, beyond 2.10.1, changing the design of TDB graphs to have
graphs work across transaction boundaries looks like the right thing to
do.  The graph also carries around internal details used by the query
execution engine. Then model.begin/model.commit can work as a write
transaction.  Not the sort of thing to do just before a release after
people have tested for us.

For this release, I suggest a short amount of time to see if there is
some temporary fix for JENA-450 (e.g. 1), then do the release
regardless.  This isn't a regression; it does need fixing; there are
many other things in 2.10.1 that are better than 2.10.0.
I can do that if you'd like me to.

Ian

Reply via email to