VIVO-778 Some renaming and moving.
This commit is contained in:
parent
0c46f1d14e
commit
3d65a708b7
7 changed files with 31 additions and 27 deletions
|
@ -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.dao.VitroVocabulary;
|
||||
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 {
|
||||
|
||||
|
@ -191,7 +191,7 @@ public class JenaAdminActions extends BaseEditController {
|
|||
}
|
||||
|
||||
private void printRestrictions() {
|
||||
TBoxReasonerWrapper reasoner = (TBoxReasonerWrapper) getServletContext().getAttribute("tboxReasonerWrapper");
|
||||
TBoxReasoner reasoner = (TBoxReasoner) getServletContext().getAttribute("tboxReasonerWrapper");
|
||||
for (Restriction rest : reasoner.listRestrictions() ) {
|
||||
//System.out.println();
|
||||
if (rest.isAllValuesFromRestriction()) {
|
||||
|
|
|
@ -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.ReasonerConfiguration;
|
||||
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerDriver;
|
||||
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasonerWrapper;
|
||||
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.impl.pellet.PelletTBoxReasonerDriver;
|
||||
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.TBoxReasoner;
|
||||
import edu.cornell.mannlib.vitro.webapp.tboxreasoner.impl.pellet.PelletTBoxReasoner;
|
||||
|
||||
/**
|
||||
* Start the Pellet reasoner on the TBox.
|
||||
|
@ -46,7 +46,7 @@ public class PelletReasonerSetup implements ServletContextListener {
|
|||
OntModel tboxUnionModel = contextModels.getOntModel(TBOX_UNION);
|
||||
WebappDaoFactory wadf = contextModels.getWebappDaoFactory();
|
||||
|
||||
TBoxReasonerWrapper reasoner = new PelletTBoxReasonerDriver(
|
||||
TBoxReasoner reasoner = new PelletTBoxReasoner(
|
||||
ReasonerConfiguration.DEFAULT);
|
||||
TBoxReasonerDriver driver = new BasicTBoxReasonerDriver(
|
||||
tboxAssertionsModel, tboxInferencesModel, tboxUnionModel,
|
||||
|
|
|
@ -41,12 +41,12 @@ public class BasicTBoxReasonerDriver implements TBoxReasonerDriver {
|
|||
|
||||
private final ExecutorService executorService;
|
||||
|
||||
private final TBoxReasonerWrapper reasoner;
|
||||
private final TBoxReasoner reasoner;
|
||||
|
||||
private TBoxReasonerDriver.Status status;
|
||||
|
||||
public BasicTBoxReasonerDriver(OntModel assertionsModel,
|
||||
Model inferencesModel, OntModel fullModel, TBoxReasonerWrapper reasoner,
|
||||
Model inferencesModel, OntModel fullModel, TBoxReasoner reasoner,
|
||||
ReasonerConfiguration reasonerConfiguration) {
|
||||
this.lockableAssertionsModel = new LockableOntModel(assertionsModel);
|
||||
this.lockableInferencesModel = new LockableModel(inferencesModel);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* $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;
|
||||
|
||||
|
@ -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.Suspension;
|
||||
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.LockableOntModel;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.jena.criticalsection.LockedModel;
|
||||
|
@ -28,7 +28,7 @@ public class InferenceModelUpdater {
|
|||
private static final Log log = LogFactory
|
||||
.getLog(InferenceModelUpdater.class);
|
||||
|
||||
private final TBoxReasonerWrapper reasoner;
|
||||
private final TBoxReasoner reasoner;
|
||||
private final LockableModel lockableInferencesModel;
|
||||
private final LockableOntModel lockableFullModel;
|
||||
private final ConfiguredReasonerListener listener;
|
||||
|
@ -44,7 +44,7 @@ public class InferenceModelUpdater {
|
|||
return retractCount;
|
||||
}
|
||||
|
||||
public InferenceModelUpdater(TBoxReasonerWrapper reasoner,
|
||||
public InferenceModelUpdater(TBoxReasoner reasoner,
|
||||
LockableModel lockableInferencesModel,
|
||||
LockableOntModel lockableFullModel,
|
||||
ConfiguredReasonerListener listener) {
|
|
@ -1,6 +1,6 @@
|
|||
/* $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;
|
||||
|
||||
|
@ -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.ReasonerStatementPattern;
|
||||
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:
|
||||
|
@ -27,11 +27,11 @@ public class PatternListBuilder {
|
|||
private static final String OWL_NS = "http://www.w3.org/2002/07/owl#";
|
||||
|
||||
private final ReasonerConfiguration reasonerConfiguration;
|
||||
private final TBoxReasonerWrapper reasoner;
|
||||
private final TBoxReasoner reasoner;
|
||||
private final TBoxChanges changes;
|
||||
|
||||
public PatternListBuilder(ReasonerConfiguration reasonerConfiguration,
|
||||
TBoxReasonerWrapper reasoner, TBoxChanges changes) {
|
||||
TBoxReasoner reasoner, TBoxChanges changes) {
|
||||
this.reasonerConfiguration = reasonerConfiguration;
|
||||
this.reasoner = reasoner;
|
||||
this.changes = changes;
|
|
@ -12,9 +12,13 @@ import com.hp.hpl.jena.rdf.model.Statement;
|
|||
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.
|
||||
|
@ -38,16 +42,16 @@ public interface TBoxReasonerWrapper {
|
|||
*/
|
||||
List<DatatypeProperty> listDatatypeProperties();
|
||||
|
||||
/**
|
||||
* List all of the restrictions in the reasoner model, after updating and
|
||||
* reasoning.
|
||||
*/
|
||||
List<Restriction> listRestrictions();
|
||||
|
||||
/**
|
||||
* 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
|
||||
* reasoning.
|
||||
*/
|
||||
List<Restriction> listRestrictions();
|
||||
|
||||
}
|
|
@ -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.TBoxChanges;
|
||||
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.LockedOntModel;
|
||||
|
||||
/**
|
||||
* An implementation the TBoxReasonerWrapper for Pellet.
|
||||
*/
|
||||
public class PelletTBoxReasonerDriver implements TBoxReasonerWrapper {
|
||||
public class PelletTBoxReasoner implements TBoxReasoner {
|
||||
private static final Log log = LogFactory
|
||||
.getLog(PelletTBoxReasonerDriver.class);
|
||||
.getLog(PelletTBoxReasoner.class);
|
||||
|
||||
private final LockableOntModel lockablePelletModel;
|
||||
|
||||
public PelletTBoxReasonerDriver(ReasonerConfiguration reasonerConfiguration) {
|
||||
public PelletTBoxReasoner(ReasonerConfiguration reasonerConfiguration) {
|
||||
this.lockablePelletModel = new LockableOntModel(
|
||||
ModelFactory.createOntologyModel(reasonerConfiguration
|
||||
.getOntModelSpec()));
|
Loading…
Add table
Reference in a new issue