001 /***************************************************************************/
002 /* Copyright (C) 2010-2011, Sebastian Hellmann */
003 /* Note: If you need parts of NLP2RDF in another licence due to licence */
004 /* incompatibility, please mail hellmann@informatik.uni-leipzig.de */
005 /* */
006 /* This file is part of NLP2RDF. */
007 /* */
008 /* NLP2RDF is free software; you can redistribute it and/or modify */
009 /* it under the terms of the GNU General Public License as published by */
010 /* the Free Software Foundation; either version 3 of the License, or */
011 /* (at your option) any later version. */
012 /* */
013 /* NLP2RDF is distributed in the hope that it will be useful, */
014 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
015 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
016 /* GNU General Public License for more details. */
017 /* */
018 /* You should have received a copy of the GNU General Public License */
019 /* along with this program. If not, see <http://www.gnu.org/licenses/>. */
020 /***************************************************************************/
021
022 package org.nlp2rdf.core;
023
024 import com.hp.hpl.jena.ontology.OntModel;
025 import opennlp.tools.util.Span;
026
027 import java.util.Set;
028
029 /**
030 * @author Sebastian Hellmann - http://bis.informatik.uni-leipzig.de/SebastianHellmann
031 */
032 public interface URIGenerator {
033
034 /**
035 * Depending on the implementation, it might be necessary to call init before calling this function
036 *
037 * @param prefix
038 * @param text
039 * @param span
040 * @return
041 */
042 public String makeUri(String prefix, String text, Span span);
043
044 /**
045 * Additionally creates the uri in the model and assigns the recipe class
046 * @param prefix
047 * @param text
048 * @param span
049 * @param model
050 * @return
051 */
052 public String makeUri(String prefix, String text, Span span, OntModel model);
053
054 public Span getSpanFor(String prefix, String uri, String text, String anchoredPart) ;
055
056 public void init(String text, Set<Span> spans);
057
058 /**
059 * This returns the recipe class form the String ontology:
060 * http://nlp2rdf.lod2.eu/schema/string/
061 *
062 * @return a URI from http://nlp2rdf.lod2.eu/schema/string/
063 */
064 public String getRecipeUri();
065
066 /**
067 * adds an rdf:type statement to model for the respective recipe
068 *
069 * @param uri
070 * @param model
071 */
072 public void assignRecipeClass(String uri, OntModel model);
073
074
075
076 }