- All Known Implementing Classes:
BufferingPrefixMap,PrefixMapAdapter,PrefixMapBase,PrefixMapNull,PrefixMapProxy,PrefixMapSink,PrefixMapStd,PrefixMapUnmodifiable,PrefixMapWrapper,PrefixMapZero
public interface PrefixMap
Interface for lightweight prefix maps, this is similar to
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.
-
Method Summary
Modifier and TypeMethodDescriptionAbbreviate an IRI and return a pair of prefix and local parts, or null.abbreviate(String uriStr) Abbreviate an IRI or return nullvoidAdd a prefix, overwrites any existing associationvoidclear()Clear all prefixes.booleancontainsPrefix(String prefix) Gets whether the map contains a given prefixvoidDelete a prefixExpand a prefix named, return null if it can't be expandedExpand a prefix, return null if it can't be expandedvoidforEach(BiConsumer<String, String> action) Apply aBiConsumer<String, String> to each entry in the PrefixMap.Return the URI for the prefix, or null if there is no entry for this prefix.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.Return a fresh copy of the underlying mapping, should be safe to modify unlike the mapping returned fromgetMapping()booleanisEmpty()Return whether the prefix map is empty or not.voidAdd a prefix, overwrites any existing associationvoidAdd a prefix, overwrites any existing associationvoidputAll(org.apache.jena.shared.PrefixMapping pmap) Add a prefix, overwrites any existing associationintsize()Return the number of entries in the prefix map.stream()Return a stream ofPrefixEntry, pairs of prefix and URI.
-
Method Details
-
get
Return the URI for the prefix, or null if there is no entry for this prefix. -
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.- Returns:
- Underlying mapping
- See Also:
-
getMappingCopy
Return a fresh copy of the underlying mapping, should be safe to modify unlike the mapping returned fromgetMapping()- Returns:
- Copy of the mapping
-
forEach
Apply aBiConsumer<String, String> to each entry in the PrefixMap. -
stream
Stream<PrefixEntry> stream()Return a stream ofPrefixEntry, pairs of prefix and URI. -
add
Add a prefix, overwrites any existing association- Parameters:
prefix- PrefixiriString- Namespace IRI
-
putAll
Add a prefix, overwrites any existing association- Parameters:
pmap- Prefix Map
-
putAll
Add a prefix, overwrites any existing association- Parameters:
mapping- A Map of prefix name to IRI string
-
delete
Delete a prefix- Parameters:
prefix- Prefix to delete
-
clear
void clear()Clear all prefixes. -
containsPrefix
Gets whether the map contains a given prefix- Parameters:
prefix- Prefix- Returns:
- True if the prefix is contained in the map, false otherwise
-
abbreviate
Abbreviate an IRI or return null- Parameters:
uriStr- URI to abbreviate- Returns:
- URI in prefixed name form if possible, null otherwise
-
abbrev
Abbreviate an IRI and return a pair of prefix and local parts, or null.- Parameters:
uriStr- URI string to abbreviate- Returns:
- Pair of prefix and local name
- See Also:
-
expand
Expand a prefix named, return null if it can't be expanded- Parameters:
prefixedName- Prefixed Name- Returns:
- Expanded URI if possible, null otherwise
-
expand
Expand a prefix, return null if it can't be expanded- Parameters:
prefix- PrefixlocalName- Local name- Returns:
- Expanded URI if possible, null otherwise
-
isEmpty
boolean isEmpty()Return whether the prefix map is empty or not. -
size
int size()Return the number of entries in the prefix map.
-