|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.semanticweb.HermiT.Namespaces
public class Namespaces
This class is responsible for mapping between URIs and "identifiers", which can be given in any of three different formats: 1) <uri> 2) prefix:localpart 3) localpart Forms 2 and 3 are dependent upon a set of namespace declarations which associates namespaces with prefices. An identifier encoded in form 2 which uses an unregistered prefix is invalid---expanding it will result in an exception. Form 3 can only be used if a "default namespace" (a namespace associated with an empty prefix) has been declared. Neither prefices nor localparts may contain colon characters.
| Field Summary | |
|---|---|
static Namespaces |
none
|
static Namespaces |
semanticWebNamespaces
Commonly-used semantic web namespaces (OWL, RDF, SWRL, etc.) |
| Constructor Summary | |
|---|---|
Namespaces(java.util.Map<java.lang.String,java.lang.String> prefixDeclarations,
Namespaces... sources)
Create a new Namespaces object from a set of prefix declarations and a sequence of other Namespaces objects to copy. |
|
Namespaces(java.lang.String defaultNamespace,
Namespaces... sources)
Create a new Namespaces object with declarations copied from `sources` (given in order of precedence) and using `defaultNamespace` as (surprisingly enough) a default namespace. |
|
| Method Summary | |
|---|---|
java.util.Map<java.lang.String,java.lang.String> |
getDeclarations()
Return an unmodifiable map from prefices to their expansions. |
java.lang.String |
idFromUri(java.lang.String uri)
Abbreviate the given string, which must be a full URI. |
java.lang.String |
uriFromId(java.lang.String id)
Expand a full URI from `id`, which is of one of the following forms: `name`, where `name` is an identifier containing no colon characters, `prefix:name`, where `prefix` is a registered namespace prefix, or `<uri>`, where `uri` is a URI. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Namespaces semanticWebNamespaces
public static final Namespaces none
| Constructor Detail |
|---|
public Namespaces(java.util.Map<java.lang.String,java.lang.String> prefixDeclarations,
Namespaces... sources)
prefixDeclarations - map from prefices to namespace namessources - other declarations to include, in order of precedence
public Namespaces(java.lang.String defaultNamespace,
Namespaces... sources)
| Method Detail |
|---|
public java.util.Map<java.lang.String,java.lang.String> getDeclarations()
public java.lang.String idFromUri(java.lang.String uri)
public java.lang.String uriFromId(java.lang.String id)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||