001/** 002 * Copyright (C) 2007 - 2016, Jens Lehmann 003 * 004 * This file is part of DL-Learner. 005 * 006 * DL-Learner is free software; you can redistribute it and/or modify 007 * it under the terms of the GNU General Public License as published by 008 * the Free Software Foundation; either version 3 of the License, or 009 * (at your option) any later version. 010 * 011 * DL-Learner is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU General Public License for more details. 015 * 016 * You should have received a copy of the GNU General Public License 017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 018 */ 019package org.dllearner.core.ref; 020 021import org.semanticweb.owlapi.model.OWLClassExpression; 022import org.semanticweb.owlapi.model.OWLDataFactory; 023import org.semanticweb.owlapi.reasoner.OWLReasoner; 024import org.semanticweb.owlapi.util.OWLClassExpressionVisitorExAdapter; 025 026import java.util.SortedSet; 027import java.util.TreeSet; 028 029/** 030 * @author Lorenz Buehmann 031 * 032 */ 033public abstract class ClassExpressionRefinementOperatorBase extends 034 OWLClassExpressionVisitorExAdapter<SortedSet<OWLClassExpression>> implements ClassExpressionRefinementOperator { 035 036 protected OWLReasoner reasoner; 037 protected OWLDataFactory dataFactory; 038 039 public ClassExpressionRefinementOperatorBase(OWLReasoner reasoner, OWLDataFactory dataFactory) { 040 super(new TreeSet<>()); 041 this.reasoner = reasoner; 042 this.dataFactory = dataFactory; 043 } 044 045 /* (non-Javadoc) 046 * @see org.dllearner.core.ref.RefinementOperator#refineNode(org.dllearner.core.ref.SearchTreeNode) 047 */ 048 @Override 049 public SortedSet<OWLClassExpression> refineNode(OWLClassExpression ce) { 050 return ce.accept(this); 051 } 052 053}