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 voidcheckLegalPrefix(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) booleanlock()intremoveNsPrefix(String prefix) booleansamePrefixMappingAs(PrefixMapping other) setNsPrefix(String prefix, String uri) setNsPrefixes(Map<String, String> map) setNsPrefixes(PrefixMapping pmap) toString()
-
Method Details
-
setNsPrefix
- Specified by:
setNsPrefixin interfacePrefixMapping
-
removeNsPrefix
- Specified by:
removeNsPrefixin interfacePrefixMapping
-
clearNsPrefixMap
- Specified by:
clearNsPrefixMapin 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.getLocalnamenot abbreviate when it is legal Turtle.Answer - legacy for RDF/XML.
See also
qnameFor(java.lang.String). -
setNsPrefixes
- Specified by:
setNsPrefixesin interfacePrefixMapping
-
getNsPrefixURI
- Specified by:
getNsPrefixURIin interfacePrefixMapping
-
getNsURIPrefix
- Specified by:
getNsURIPrefixin interfacePrefixMapping
-
getNsPrefixMap
- Specified by:
getNsPrefixMapin interfacePrefixMapping
-
expandPrefix
- Specified by:
expandPrefixin interfacePrefixMapping
-
qnameFor
- Specified by:
qnameForin interfacePrefixMapping
-
shortForm
- Specified by:
shortFormin interfacePrefixMapping
-
lock
- Specified by:
lockin interfacePrefixMapping
-
hasNoMappings
public boolean hasNoMappings()- Specified by:
hasNoMappingsin interfacePrefixMapping
-
numPrefixes
public int numPrefixes()- Specified by:
numPrefixesin interfacePrefixMapping
-
toString
-