001/**
002 * Copyright (C) 2007-2011, 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 */
019
020package org.dllearner.algorithms.isle.textretrieval;
021
022import java.util.List;
023import java.util.Map;
024import java.util.Set;
025
026import org.dllearner.algorithms.isle.index.Token;
027import org.semanticweb.owlapi.model.OWLEntity;
028import org.semanticweb.owlapi.model.OWLOntology;
029
030/**
031 * Interface for methods, which retrieve relevant texts given an entity
032 * in an ontology. An entity text retriever can do simple operations such
033 * as converting the URI into text or retrieving an rdfs:label, but could
034 * also search web pages for textual explanations of an entity.
035 * 
036 * @author Jens Lehmann
037 *
038 */
039public interface EntityTextRetriever {
040        
041        /**
042         * The method retrieves a string or a set of strings, which is weighted by
043         * importance with respect to the entity. For instance, an rdfs:label of
044         * an entity can be given more weight than an rdfs:comment, which in turn 
045         * can be more important than a OWLClassExpression retrieved from a web page.
046         *  
047         * @param entity The entity to handle.
048         * @return A weighted set of strings. For a value x, we need to have 0 <= x <= 1.
049         */
050        Map<List<Token>, Double> getRelevantText(OWLEntity entity);
051        
052        Map<OWLEntity, Set<List<Token>>> getRelevantText(OWLOntology ontology);
053
054        /**
055         * @param entity
056         * @return
057         */
058        Map<String, Double> getRelevantTextSimple(OWLEntity entity);
059        
060}