public class PrefixHelper extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
PrefixHelper.LazyLoaded |
| Constructor and Description |
|---|
PrefixHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
abbreviate(String uri)
returns the abbreviation of an uri
|
static void |
addPrefix(String prefix,
String uri)
Adds a new prefix to the PrefixHelper (not persistent).
|
static String |
addPrefixes(String query) |
static String |
expand(String shortURI)
expands an uri (reversal of abbreviation)
|
static String |
formatPrefixes(Map<String,String> prefixes)
Transforms a prefix map into sparql "PREFIX x:
<...>" statements.
|
static String[] |
generatePrefix(String fullURI)
Generated an unused prefix for a uri if there is none and add it to the
PrefixHelper (not persistent).
|
static String |
getBase(String uri) |
static String |
getPrefix(String uri)
returns prefixes
|
static Map<String,String> |
getPrefixes()
returns prefixes
|
static String |
getSuffix(String uri) |
static String |
getURI(String prefix)
returns uri
|
static Map<String,String> |
restrictPrefixes(Map<String,String> prefixes,
String query)
returns only the subset of the given prefixes that is referenced in the
query
|
public static void addPrefix(String prefix, String uri)
prefix - the abbreviated url, example "dbo"uri - the url to abbreviate, e.g. "http://dbpedia.org/ontology/public static String[] generatePrefix(String fullURI)
fullURI - the full uri, for example
"http://dbpedia.org/resource/Elephant"public static Map<String,String> restrictPrefixes(Map<String,String> prefixes, String query)
prefixes - prefixes to restrictquery - query from which the prefixes to be restricted are extractedpublic static String getPrefix(String uri)
uri - uripublic static String getURI(String prefix)
prefix - prefixpublic static String getSuffix(String uri)
uri - a URI, either in expanded form like
"http://dbpedia.org/ontology/Settlement" or in abbreviated
form like "dbo:Settlement".public static String getBase(String uri)
uri - a URI, either in expanded form like
"http://dbpedia.org/ontology/Settlement" or in abbreviated
form like "dbo:Settlement".public static String abbreviate(String uri)
uri - uripublic static String expand(String shortURI)
shortURI - shortURICopyright © 2018. All rights reserved.