VIVO-237 changed "attach to TBox" function to "attach snapshot to ontology" using in-memory copies so older ingest examples should still work while avoiding a performance hit.

This commit is contained in:
brianjlowe 2013-09-27 17:05:41 -04:00
parent 9ef5e783a3
commit 4202f30ea7
2 changed files with 5 additions and 10 deletions

View file

@ -822,13 +822,11 @@ public class JenaIngestController extends BaseEditController {
private void doAttachModel(String modelName, ModelMaker modelMaker) {
if (attachedModels.containsKey(modelName)) {
return;
doDetachModel(modelName, modelMaker);
}
Model m = modelMaker.getModel(modelName);
ModelAccess.on(getServletContext()).getOntModel(ModelID.BASE_ABOX).addSubModel(m);
Model m = ModelFactory.createDefaultModel();
m.add(modelMaker.getModel(modelName));
ModelAccess.on(getServletContext()).getOntModel(ModelID.BASE_TBOX).addSubModel(m);
ModelAccess.on(getServletContext()).getOntModel(ModelID.UNION_ABOX).addSubModel(m);
ModelAccess.on(getServletContext()).getOntModel(ModelID.UNION_TBOX).addSubModel(m);
attachedModels.put(modelName, m);
log.info("Attached " + modelName + " (" + m.hashCode() + ") to webapp");
}
@ -838,10 +836,7 @@ public class JenaIngestController extends BaseEditController {
if (m == null) {
return;
}
ModelAccess.on(getServletContext()).getOntModel(ModelID.BASE_ABOX).removeSubModel(m);
ModelAccess.on(getServletContext()).getOntModel(ModelID.BASE_TBOX).removeSubModel(m);
ModelAccess.on(getServletContext()).getOntModel(ModelID.UNION_ABOX).removeSubModel(m);
ModelAccess.on(getServletContext()).getOntModel(ModelID.UNION_TBOX).removeSubModel(m);
attachedModels.remove(modelName);
log.info("Detached " + modelName + " (" + m.hashCode() + ") from webapp");
}

View file

@ -96,7 +96,7 @@ function init(){
<input type="hidden" name="action" value="attachModel"/>
<input type="hidden" name="modelName" value="${modelName}"/>
<input type="hidden" name="modelType" value="${modelType}"/>
<input type="submit" name="submit" value="attach to TBox (ontology)"/>
<input type="submit" name="submit" value="attach snapshot to ontology"/>
</form>
</td>
<td>
@ -104,7 +104,7 @@ function init(){
<input type="hidden" name="action" value="detachModel"/>
<input type="hidden" name="modelName" value="${modelName}"/>
<input type="hidden" name="modelType" value="${modelType}"/>
<input type="submit" name="submit" value="detach from TBox (ontology)"/>
<input type="submit" name="submit" value="detach snapshot from ontology"/>
</form>
</td>
<td>