VIVO-843 "every time" sub-models were being lost.

The problem comes when you wrap an OntModel around a Model. Sub-models are added to the OntModel, so unless you keep the same OntModel, those sub-models get lost.

This is a kluge, rather than a fix.
This commit is contained in:
Jim Blake 2014-08-13 15:22:39 -04:00
parent 27c62c26cc
commit a9cb42162c

View file

@ -189,9 +189,16 @@ public class RequestModelsPrep implements Filter {
private void setRawModels(RDFService contentRdfService, RDFService configurationRdfService, VitroRequest vreq) { private void setRawModels(RDFService contentRdfService, RDFService configurationRdfService, VitroRequest vreq) {
ModelAccess models = ModelAccess.on(vreq); ModelAccess models = ModelAccess.on(vreq);
ModelMaker configMM = ModelMakerUtils.getShortTermModelMaker(ctx, /**
configurationRdfService, WhichService.CONFIGURATION); * KLUGE -- VIVO-843
models.setModelMaker(CONFIGURATION, configMM); *
* We happen to know that the short-term configuration models are the
* same as the long-term ones. But if we wrap them in OntModels again,
* we will lose the everytime sub-models. So for now, just skip that.
*/
// ModelMaker configMM = ModelMakerUtils.getShortTermModelMaker(ctx,
// configurationRdfService, WhichService.CONFIGURATION);
// models.setModelMaker(CONFIGURATION, configMM);
ModelMaker contentMM = ModelMakerUtils.getShortTermModelMaker(ctx, ModelMaker contentMM = ModelMakerUtils.getShortTermModelMaker(ctx,
contentRdfService, WhichService.CONTENT); contentRdfService, WhichService.CONTENT);