java.lang.Object
org.apache.jena.sparql.graph.PrefixMappingBase
- All Implemented Interfaces:
PrefixMapping
- Direct Known Subclasses:
PrefixMappingAdapter
,PrefixMappingMem
,PrefixMappingSink
Framework for implementing
PrefixMapping
. It is stateless (unlike
PrefixMappingImpl
) and implements the contract of PrefixMapping
,
providing the key algorithm and delegating storage to the subclasses.
Reverse mapping, looking up a URI to find a prefix is complex because there may be several possibilities. Applications should not rely on every implementation being consistent when there is a choice of which prefix to use to shorten a URI.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jena.shared.PrefixMapping
PrefixMapping.Factory, PrefixMapping.IllegalPrefixException, PrefixMapping.JenaLockedException
-
Field Summary
Fields inherited from interface org.apache.jena.shared.PrefixMapping
Extended, Standard
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkLegalPrefix
(String prefix) Checks that a prefix is "legal" - it must be a valid XML NCName or "".expandPrefix
(String prefixed) getNsPrefixURI
(String prefix) getNsURIPrefix
(String uri) boolean
lock()
int
removeNsPrefix
(String prefix) boolean
samePrefixMappingAs
(PrefixMapping other) setNsPrefix
(String prefix, String uri) setNsPrefixes
(Map<String, String> map) setNsPrefixes
(PrefixMapping pmap) toString()
-
Method Details
-
setNsPrefix
- Specified by:
setNsPrefix
in interfacePrefixMapping
-
removeNsPrefix
- Specified by:
removeNsPrefix
in interfacePrefixMapping
-
clearNsPrefixMap
- Specified by:
clearNsPrefixMap
in interfacePrefixMapping
-
checkLegalPrefix
Checks that a prefix is "legal" - it must be a valid XML NCName or "". XML rules for RDF/XML output.This is a recurring user question - why does
Resource.getNamespace
,Resource.getLocalname
not abbreviate when it is legal Turtle.Answer - legacy for RDF/XML.
See also
qnameFor(java.lang.String)
. -
setNsPrefixes
- Specified by:
setNsPrefixes
in interfacePrefixMapping
-
getNsPrefixURI
- Specified by:
getNsPrefixURI
in interfacePrefixMapping
-
getNsURIPrefix
- Specified by:
getNsURIPrefix
in interfacePrefixMapping
-
getNsPrefixMap
- Specified by:
getNsPrefixMap
in interfacePrefixMapping
-
expandPrefix
- Specified by:
expandPrefix
in interfacePrefixMapping
-
qnameFor
- Specified by:
qnameFor
in interfacePrefixMapping
-
shortForm
- Specified by:
shortForm
in interfacePrefixMapping
-
lock
- Specified by:
lock
in interfacePrefixMapping
-
hasNoMappings
public boolean hasNoMappings()- Specified by:
hasNoMappings
in interfacePrefixMapping
-
numPrefixes
public int numPrefixes()- Specified by:
numPrefixes
in interfacePrefixMapping
-
toString
-