VIVO-778 Some renaming and moving.

This commit is contained in:
Jim Blake 2014-12-03 10:44:28 -05:00
parent 0c46f1d14e
commit 3d65a708b7
7 changed files with 31 additions and 27 deletions

View file

@ -48,7 +48,7 @@ import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerWrapper; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasoner;
public class JenaAdminActions extends BaseEditController { public class JenaAdminActions extends BaseEditController {
@ -191,7 +191,7 @@ public class JenaAdminActions extends BaseEditController {
} }
private void printRestrictions() { private void printRestrictions() {
TBoxReasonerWrapper reasoner = (TBoxReasonerWrapper) getServletContext().getAttribute("tboxReasonerWrapper"); TBoxReasoner reasoner = (TBoxReasoner) getServletContext().getAttribute("tboxReasonerWrapper");
for (Restriction rest : reasoner.listRestrictions() ) { for (Restriction rest : reasoner.listRestrictions() ) {
//System.out.println(); //System.out.println();
if (rest.isAllValuesFromRestriction()) { if (rest.isAllValuesFromRestriction()) {

View file

@ -24,8 +24,8 @@ import edu.cornell.mannlib.vitro.webapp.startup.StartupStatus;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.BasicTBoxReasonerDriver; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.BasicTBoxReasonerDriver;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ReasonerConfiguration; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ReasonerConfiguration;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerDriver; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerDriver;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerWrapper; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasoner;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.impl.pellet.PelletTBoxReasonerDriver; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.impl.pellet.PelletTBoxReasoner;
/** /**
* Start the Pellet reasoner on the TBox. * Start the Pellet reasoner on the TBox.
@ -46,7 +46,7 @@ public class PelletReasonerSetup implements ServletContextListener {
OntModel tboxUnionModel = contextModels.getOntModel(TBOX_UNION); OntModel tboxUnionModel = contextModels.getOntModel(TBOX_UNION);
WebappDaoFactory wadf = contextModels.getWebappDaoFactory(); WebappDaoFactory wadf = contextModels.getWebappDaoFactory();
TBoxReasonerWrapper reasoner = new PelletTBoxReasonerDriver( TBoxReasoner reasoner = new PelletTBoxReasoner(
ReasonerConfiguration.DEFAULT); ReasonerConfiguration.DEFAULT);
TBoxReasonerDriver driver = new BasicTBoxReasonerDriver( TBoxReasonerDriver driver = new BasicTBoxReasonerDriver(
tboxAssertionsModel, tboxInferencesModel, tboxUnionModel, tboxAssertionsModel, tboxInferencesModel, tboxUnionModel,

View file

@ -41,12 +41,12 @@ public class BasicTBoxReasonerDriver implements TBoxReasonerDriver {
private final ExecutorService executorService; private final ExecutorService executorService;
private final TBoxReasonerWrapper reasoner; private final TBoxReasoner reasoner;
private TBoxReasonerDriver.Status status; private TBoxReasonerDriver.Status status;
public BasicTBoxReasonerDriver(OntModel assertionsModel, public BasicTBoxReasonerDriver(OntModel assertionsModel,
Model inferencesModel, OntModel fullModel, TBoxReasonerWrapper reasoner, Model inferencesModel, OntModel fullModel, TBoxReasoner reasoner,
ReasonerConfiguration reasonerConfiguration) { ReasonerConfiguration reasonerConfiguration) {
this.lockableAssertionsModel = new LockableOntModel(assertionsModel); this.lockableAssertionsModel = new LockableOntModel(assertionsModel);
this.lockableInferencesModel = new LockableModel(inferencesModel); this.lockableInferencesModel = new LockableModel(inferencesModel);

View file

@ -1,6 +1,6 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */ /* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.dao.jena.pellet; package edu.cornell.mannlib.vitro.webapp.tboxreasoner;
import java.util.List; import java.util.List;
@ -14,7 +14,7 @@ import com.hp.hpl.jena.rdf.model.Statement;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ConfiguredReasonerListener; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ConfiguredReasonerListener;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ConfiguredReasonerListener.Suspension; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ConfiguredReasonerListener.Suspension;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ReasonerStatementPattern; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ReasonerStatementPattern;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerWrapper; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasoner;
import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockableModel; import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockableModel;
import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockableOntModel; import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockableOntModel;
import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockedModel; import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockedModel;
@ -28,7 +28,7 @@ public class InferenceModelUpdater {
private static final Log log = LogFactory private static final Log log = LogFactory
.getLog(InferenceModelUpdater.class); .getLog(InferenceModelUpdater.class);
private final TBoxReasonerWrapper reasoner; private final TBoxReasoner reasoner;
private final LockableModel lockableInferencesModel; private final LockableModel lockableInferencesModel;
private final LockableOntModel lockableFullModel; private final LockableOntModel lockableFullModel;
private final ConfiguredReasonerListener listener; private final ConfiguredReasonerListener listener;
@ -44,7 +44,7 @@ public class InferenceModelUpdater {
return retractCount; return retractCount;
} }
public InferenceModelUpdater(TBoxReasonerWrapper reasoner, public InferenceModelUpdater(TBoxReasoner reasoner,
LockableModel lockableInferencesModel, LockableModel lockableInferencesModel,
LockableOntModel lockableFullModel, LockableOntModel lockableFullModel,
ConfiguredReasonerListener listener) { ConfiguredReasonerListener listener) {

View file

@ -1,6 +1,6 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */ /* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.dao.jena.pellet; package edu.cornell.mannlib.vitro.webapp.tboxreasoner;
import static com.hp.hpl.jena.rdf.model.ResourceFactory.createProperty; import static com.hp.hpl.jena.rdf.model.ResourceFactory.createProperty;
@ -13,7 +13,7 @@ import com.hp.hpl.jena.ontology.ObjectProperty;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ReasonerConfiguration; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ReasonerConfiguration;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ReasonerStatementPattern; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ReasonerStatementPattern;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxChanges; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxChanges;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerWrapper; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasoner;
/** /**
* The list of patterns for filtering the models will include: * The list of patterns for filtering the models will include:
@ -27,11 +27,11 @@ public class PatternListBuilder {
private static final String OWL_NS = "http://www.w3.org/2002/07/owl#"; private static final String OWL_NS = "http://www.w3.org/2002/07/owl#";
private final ReasonerConfiguration reasonerConfiguration; private final ReasonerConfiguration reasonerConfiguration;
private final TBoxReasonerWrapper reasoner; private final TBoxReasoner reasoner;
private final TBoxChanges changes; private final TBoxChanges changes;
public PatternListBuilder(ReasonerConfiguration reasonerConfiguration, public PatternListBuilder(ReasonerConfiguration reasonerConfiguration,
TBoxReasonerWrapper reasoner, TBoxChanges changes) { TBoxReasoner reasoner, TBoxChanges changes) {
this.reasonerConfiguration = reasonerConfiguration; this.reasonerConfiguration = reasonerConfiguration;
this.reasoner = reasoner; this.reasoner = reasoner;
this.changes = changes; this.changes = changes;

View file

@ -12,9 +12,13 @@ import com.hp.hpl.jena.rdf.model.Statement;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerDriver.Status; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerDriver.Status;
/** /**
* TODO * The functionality of a TBox reasoner.
*
* The reasoner will maintain its own TBox model. It will receive updates to
* that model and perform reasoning on it. It will answer queries about the
* contents of the model, when reasoning is complete.
*/ */
public interface TBoxReasonerWrapper { public interface TBoxReasoner {
/** /**
* Add the additions and remove the removals. * Add the additions and remove the removals.
@ -38,16 +42,16 @@ public interface TBoxReasonerWrapper {
*/ */
List<DatatypeProperty> listDatatypeProperties(); List<DatatypeProperty> listDatatypeProperties();
/**
* List all of the statements that satisfy any of these patterns, after
* updating and reasoning.
*/
List<Statement> filterResults(List<ReasonerStatementPattern> patternList);
/** /**
* List all of the restrictions in the reasoner model, after updating and * List all of the restrictions in the reasoner model, after updating and
* reasoning. * reasoning.
*/ */
List<Restriction> listRestrictions(); List<Restriction> listRestrictions();
/**
* List all of the statements that satisfy any of these patterns, after
* updating and reasoning.
*/
List<Statement> filterResults(List<ReasonerStatementPattern> patternList);
} }

View file

@ -23,20 +23,20 @@ import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ReasonerConfiguration;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ReasonerStatementPattern; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.ReasonerStatementPattern;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxChanges; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxChanges;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerDriver.Status; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerDriver.Status;
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerWrapper; import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasoner;
import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockableOntModel; import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockableOntModel;
import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockedOntModel; import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockedOntModel;
/** /**
* An implementation the TBoxReasonerWrapper for Pellet. * An implementation the TBoxReasonerWrapper for Pellet.
*/ */
public class PelletTBoxReasonerDriver implements TBoxReasonerWrapper { public class PelletTBoxReasoner implements TBoxReasoner {
private static final Log log = LogFactory private static final Log log = LogFactory
.getLog(PelletTBoxReasonerDriver.class); .getLog(PelletTBoxReasoner.class);
private final LockableOntModel lockablePelletModel; private final LockableOntModel lockablePelletModel;
public PelletTBoxReasonerDriver(ReasonerConfiguration reasonerConfiguration) { public PelletTBoxReasoner(ReasonerConfiguration reasonerConfiguration) {
this.lockablePelletModel = new LockableOntModel( this.lockablePelletModel = new LockableOntModel(
ModelFactory.createOntologyModel(reasonerConfiguration ModelFactory.createOntologyModel(reasonerConfiguration
.getOntModelSpec())); .getOntModelSpec()));