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.algorithms.qtl.operations.nbr;
020
021import java.util.Collections;
022import java.util.List;
023
024import org.dllearner.algorithms.qtl.datastructures.impl.RDFResourceTree;
025import org.dllearner.algorithms.qtl.operations.nbr.strategy.BruteForceNBRStrategy;
026import org.dllearner.algorithms.qtl.operations.nbr.strategy.NBRStrategy;
027
028/**
029 * 
030 * @author Lorenz Bühmann
031 *
032 */
033public class NBRGeneratorImpl implements NBRGenerator{
034        
035        NBRStrategy strategy;
036        
037        public NBRGeneratorImpl(){
038                this.strategy = new BruteForceNBRStrategy();
039        }
040        
041        public NBRGeneratorImpl(NBRStrategy strategy){
042                this.strategy = strategy;
043        }
044
045        @Override
046        public RDFResourceTree getNBR(RDFResourceTree posExampleTree,
047                        RDFResourceTree negExampleTree) {
048                return strategy.computeNBR(posExampleTree, Collections.singletonList(negExampleTree));
049        }
050
051        @Override
052        public RDFResourceTree getNBR(RDFResourceTree posExampleTree,
053                        List<RDFResourceTree> negExampleTrees) {
054                return strategy.computeNBR(posExampleTree, negExampleTrees);
055        }
056
057        @Override
058        public List<RDFResourceTree> getNBRs(RDFResourceTree posExampleTree,
059                        RDFResourceTree negExampleTree) {
060                return strategy.computeNBRs(posExampleTree, Collections.singletonList(negExampleTree));
061        }
062
063        @Override
064        public List<RDFResourceTree> getNBRs(RDFResourceTree posExampleTree,
065                        List<RDFResourceTree> negExampleTrees) {
066                return strategy.computeNBRs(posExampleTree, negExampleTrees);
067        }
068
069        @Override
070        public List<RDFResourceTree> getNBRs(RDFResourceTree posExampleTree,
071                        RDFResourceTree negExampleTree, int limit) {
072                // TODO Auto-generated method stub
073                return null;
074        }
075
076        @Override
077        public List<RDFResourceTree> getNBRs(RDFResourceTree posExampleTree,
078                        List<RDFResourceTree> negExampleTrees, int limit) {
079                // TODO Auto-generated method stub
080                return null;
081        }
082        
083
084}