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 require validation of
prefixes.
For input dominated workloads where you are primarily calling
expand(String)
or expand(String, String)
it is best to use
the default implementation - PrefixMapStd
. For output dominated
workloads where you are primarily calling abbrev(String)
or
abbreviate(String)
it is better to use the FastAbbreviatingPrefixMap
implementation. See the javadoc for those classes for more explanation
of their differences.
Modifier and Type | Method and Description |
---|---|
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
|
void |
add(String prefix,
org.apache.jena.iri.IRI iri)
Add a prefix, overwrites any existing association
|
void |
add(String prefix,
String iriString)
Add a prefix, overwrites any existing association
|
boolean |
contains(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
|
Map<String,org.apache.jena.iri.IRI> |
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,org.apache.jena.iri.IRI> |
getMappingCopy()
Return a fresh copy of the underlying mapping, should be safe to modify
unlike the mapping returned from
getMapping() |
Map<String,String> |
getMappingCopyStr()
Gets a fresh copy of the mapping with the IRIs translated into their
strings
|
boolean |
isEmpty()
return whether the
|
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,org.apache.jena.iri.IRI> getMapping()
Map<String,org.apache.jena.iri.IRI> getMappingCopy()
getMapping()
Map<String,String> getMappingCopyStr()
void add(String prefix, String iriString)
prefix
- PrefixiriString
- Namespace IRIvoid add(String prefix, org.apache.jena.iri.IRI iri)
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 deleteboolean contains(String prefix)
prefix
- PrefixString abbreviate(String uriStr)
uriStr
- URI to abbreviatePair<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