public interface PrefixMap
PrefixMapping from Jena Core but it omits any reverse lookup
functionality.
The contract also does not require an implementation to do any validation
unlike the Jena Core PrefixMapping which requires validation of
prefixes.
| Modifier and Type | Method and Description |
|---|---|
org.apache.jena.atlas.lib.Pair<String,String> |
abbrev(String uriStr)
Abbreviate an IRI and return a pair of prefix and local parts, or null.
|
String |
abbreviate(String uriStr)
Abbreviate an IRI or return null
|
default void |
add(String prefix,
org.apache.jena.iri.IRI iri)
Deprecated.
|
void |
add(String prefix,
String iriString)
Add a prefix, overwrites any existing association
|
void |
clear()
Clear all prefixes.
|
default boolean |
contains(String prefix)
Deprecated.
|
boolean |
containsPrefix(String prefix)
Gets whether the map contains a given prefix
|
void |
delete(String prefix)
Delete a prefix
|
String |
expand(String prefixedName)
Expand a prefix named, return null if it can't be expanded
|
String |
expand(String prefix,
String localName)
Expand a prefix, return null if it can't be expanded
|
void |
forEach(BiConsumer<String,String> action)
Apply a
BiConsumer<String, String> to each entry in the Prefixmap. |
Map<String,String> |
getMapping()
Return the underlying mapping, this is generally unsafe to modify and
implementations may opt to return an unmodifiable view of the mapping if
they wish.
|
Map<String,String> |
getMappingCopy()
Return a fresh copy of the underlying mapping, should be safe to modify
unlike the mapping returned from
getMapping() |
boolean |
isEmpty()
Return whether the prefix map is empty or not.
|
void |
putAll(Map<String,String> mapping)
Add a prefix, overwrites any existing association
|
void |
putAll(PrefixMap pmap)
Add a prefix, overwrites any existing association
|
void |
putAll(PrefixMapping pmap)
Add a prefix, overwrites any existing association
|
int |
size()
Return the number of entries in the prefix map.
|
Map<String,String> getMapping()
getMappingCopy()Map<String,String> getMappingCopy()
getMapping()void forEach(BiConsumer<String,String> action)
BiConsumer<String, String> to each entry in the Prefixmap.void add(String prefix, String iriString)
prefix - PrefixiriString - Namespace IRI@Deprecated default void add(String prefix, org.apache.jena.iri.IRI iri)
add(String, String)prefix - Prefixiri - Namespace IRIvoid putAll(PrefixMap pmap)
pmap - Prefix Mapvoid putAll(PrefixMapping pmap)
pmap - Prefix Mappingvoid putAll(Map<String,String> mapping)
mapping - A Map of prefix name to IRI stringvoid delete(String prefix)
prefix - Prefix to deletevoid clear()
boolean containsPrefix(String prefix)
prefix - Prefix@Deprecated default boolean contains(String prefix)
containsPrefix(String)String abbreviate(String uriStr)
uriStr - URI to abbreviateorg.apache.jena.atlas.lib.Pair<String,String> abbrev(String uriStr)
uriStr - URI string to abbreviateabbreviate(java.lang.String)String expand(String prefixedName)
prefixedName - Prefixed NameString expand(String prefix, String localName)
prefix - PrefixlocalName - Local nameboolean isEmpty()
int size()
Licenced under the Apache License, Version 2.0