|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.aksw.commons.util.Prefixer
public class Prefixer
Note this class is supposed to use certain terminology: uri - the full uri http://dbpedia.org/resource/London prefix - the shortcut canonical to prefix.cc namespace - the "common part" of uris, e.g. http://dbpedia.org/resource/ prefixedUri - namespace replaced with prefix: dbpedia:London NOTE: to use a base prefix add an empty prefix to the map: ""->"http://dbpedia.org/resource/" NOTE: Currently no order is used, namespaces could include other namespaces Created by Sebastian Hellmann - http://bis.informatik.uni-leipzig.de/SebastianHellmann A class for handling prefixes Date: 28.01.11
| Constructor Summary | |
|---|---|
Prefixer()
|
|
Prefixer(Map<String,String> prefixToNamespace,
boolean appendPopularPrefixes)
|
|
| Method Summary | |
|---|---|
String |
nicen(String uri)
http://dbpedia.org/resource/J%C3%BCrgen_Prochnow will be rendered as: Jürgen Prochnow by the following operations: - strip namespace - urldecode - replace _ by whitespace |
String |
prefixUri(String uri)
http://dbpedia.org/resource/London -> dbpedia:London |
void |
setPrefixToNamespace(Map<String,String> prefixToNamespace)
resets everything |
String |
stripNamespace(String uri)
this function calls stripNamespace(uri, true); |
String |
stripNamespace(String uri,
boolean useHeuristic)
strips the namespace, either by base or known prefix or a heuristic |
static String |
stripNamespaceHeuristic(String uri)
currently implemented to cut after the last # or if not available after the last / |
Map<String,String> |
theMostPopulars()
|
String |
toSparqlPrefix()
NOTE base recognition is not implemented |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Prefixer()
public Prefixer(Map<String,String> prefixToNamespace,
boolean appendPopularPrefixes)
| Method Detail |
|---|
public void setPrefixToNamespace(Map<String,String> prefixToNamespace)
prefixToNamespace - public Map<String,String> theMostPopulars()
public String toSparqlPrefix()
public String nicen(String uri)
uri -
public String stripNamespace(String uri)
uri -
public String stripNamespace(String uri,
boolean useHeuristic)
uri - e.g. http://dbpedia.org/resource/LondonuseHeuristic - if true
public static String stripNamespaceHeuristic(String uri)
uri - e.g. http://dbpedia.org/resource/
public String prefixUri(String uri)
uri -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||