public OWLReasonerFactory getReasonerFactory() { return new ProtegeOWLReasonerFactoryWrapper(modelManager.getOWLReasonerManager().getCurrentReasonerFactory()); }
public ProtegeOWLReasonerFactoryWrapper(OWLEditorKit editorKit) { this(editorKit.getOWLModelManager().getOWLReasonerManager().getCurrentReasonerFactory()); }
public Set<OWLClass> getRootUnsatisfiableClasses() throws ExplanationException { if(dirty) { rootUnsatClses.clear(); dirty = false; OWLReasonerFactory rf = new ProtegeOWLReasonerFactoryWrapper(modelManager.getOWLReasonerManager().getCurrentReasonerFactory()); RootDerivedReasoner gen = new StructuralRootDerivedReasoner(OWLManager.createOWLOntologyManager(), modelManager.getReasoner(), rf); rootUnsatClses.addAll(gen.getRootUnsatisfiableClasses()); } return Collections.unmodifiableSet(rootUnsatClses); }
public void run() { try { OWLModelManager p4Manager = owlEditorKit.getOWLModelManager(); successfulExplanation = phase01.run(p4Manager.getActiveOntology(), p4Manager.getOWLReasonerManager().getCurrentReasonerFactory().getReasonerFactory()); } catch (OWLOntologyCreationException oce) { ProtegeApplication.getErrorLog().logError(oce); } finally { dialog.dispose(); } if (successfulExplanation) { createGui(); } } }, "Protege Explanation Thread").start();
public ExplanationResult explain(OWLAxiom axiom) { OWLOntology activeOntology = getOWLModelManager().getActiveOntology(); OWLReasonerFactory rFactory = getOWLModelManager().getOWLReasonerManager().getCurrentReasonerFactory().getReasonerFactory(); OWLReasoner reasoner = getOWLModelManager().getOWLReasonerManager().getCurrentReasoner(); BlackBoxExplanation explain = new BlackBoxExplanation(activeOntology, rFactory, reasoner); Set<OWLAxiom> axioms = explain.getExplanation(getClassExpression(axiom)); AxiomListFrame frame = new AxiomListFrame(getOWLEditorKit()); frame.setRootObject(axioms); final OWLFrameList<Set<OWLAxiom>> frameList = new OWLFrameList<Set<OWLAxiom>>(getOWLEditorKit(), frame); frameList.setPreferredSize(new Dimension(800, 600)); frameList.refreshComponent(); ExplanationResult result = new ExplanationResult() { @Override public void dispose() { frameList.dispose(); } }; result.setLayout(new BorderLayout()); result.add(new JScrollPane(frameList), BorderLayout.CENTER); return result; }
/** * When the active ontology is new (first one or differs from the last one) */ private void handleNewActiveOntology() { initializing = true; // flag on OWLModelManager mmgr = owlEditorKit.getOWLWorkspace().getOWLModelManager(); OWLOntology ontology = mmgr.getActiveOntology(); PrefixDocumentFormat owlPrefixManager = PrefixUtilities.getPrefixOWLOntologyFormat(ontology); // Resets the OBDA and loads the vocabulary and the prefixes obdaModel.reset(owlPrefixManager); loadVocabularyAndDefaultPrefix(obdaModel, mmgr.getOntologies(), ontology); configurationManager.clearImplicitDBConstraintFile(); DisposableProperties settings = (DisposableProperties) owlEditorKit.get(DisposableProperties.class.getName()); configurationManager.resetProperties(settings.clone()); ProtegeOWLReasonerInfo factory = owlEditorKit.getOWLModelManager().getOWLReasonerManager().getCurrentReasonerFactory(); if (factory instanceof OntopReasonerInfo) { OntopReasonerInfo questfactory = (OntopReasonerInfo) factory; questfactory.setConfigurationGenerator(configurationManager); } fireActiveOBDAModelChange(); initializing = false; // flag off }