org.nlp2rdf.core.util
Class URIGeneratorHelper
java.lang.Object
org.nlp2rdf.core.util.URIGeneratorHelper
public class URIGeneratorHelper
- extends Object
- Author:
- Sebastian Hellmann - http://bis.informatik.uni-leipzig.de/SebastianHellmann
Created: 29.06.11
This class contains static helper methods for handling and validating a model
URIGeneratorHelper
public URIGeneratorHelper()
getSpans
public static List<opennlp.tools.util.Span> getSpans(List<IString> strings,
String prefix,
String text,
URIGenerator uriGenerator)
determineGenerator
public static URIGenerator determineGenerator(String recipe)
determineGenerator
public static URIGenerator determineGenerator(com.hp.hpl.jena.ontology.OntModel model)
- determines the respective generator from a model
currently it is only recognized if the respective class is assigned once.
No heuristic is used to determine the URI Recipe, otherwise.
- Parameters:
model -
- Returns:
getContextBefore
public static String getContextBefore(opennlp.tools.util.Span span,
String text,
int contextLength)
getContextAfter
public static String getContextAfter(opennlp.tools.util.Span span,
String text,
int contextLength)
getFirstCharacters
public static String getFirstCharacters(String anchoredPart,
int firstCharLength)
- return the first characters of the anchored part urlencoded
- Parameters:
anchoredPart - firstCharLength -
- Returns:
Copyright © 2011. All Rights Reserved.