java.lang.Object
org.apache.jena.riot.system.stream.LocationMapper
Alternative locations for URIs. Maintains two maps:
single item alternatives and alternative prefixes.
To suggest an alternative location, first check the single items,
then check the prefixes.
A LocationMapper can be configured by an RDF file. The default for this
is "etc/location-mapping.n3".
There is a default LocationMapper which is used by the global @link{StreamManager}.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAltEntry
(String uri, String alt) void
addAltPrefix
(String uriPrefix, String altPrefix) altMapping
(String uri) altMapping
(String uri, String otherwise) Apply mappings: first try for an exact alternative location, then try to remap by prefix, finally, try the special case of filenames in a specific base directory.clone()
Deep copy of location and prefix mapsboolean
containsMapping
(String uri) void
copyFrom
(LocationMapper lmap2) boolean
getAltEntry
(String uri) getAltPrefix
(String uriPrefix) int
hashCode()
boolean
isEmpty()
Iterate over all the entries registeredIterate over all the entries registeredIterate over all the prefixes registeredvoid
removeAltEntry
(String uri) void
removeAltPrefix
(String uriPrefix) org.apache.jena.rdf.model.Model
toModel()
void
toModel
(org.apache.jena.rdf.model.Model model) toString()
-
Constructor Details
-
LocationMapper
public LocationMapper()Create a LocationMapper with no mapping yet
-
-
Method Details
-
clone
Deep copy of location and prefix maps -
copyFrom
-
containsMapping
-
altMapping
-
altMapping
Apply mappings: first try for an exact alternative location, then try to remap by prefix, finally, try the special case of filenames in a specific base directory.- Parameters:
uri
-otherwise
-- Returns:
- The alternative location chosen
-
addAltEntry
-
addAltPrefix
-
listAltEntries
Iterate over all the entries registered -
listAltPrefixes
Iterate over all the prefixes registered -
removeAltEntry
-
removeAltPrefix
-
getAltEntry
-
getAltPrefix
-
isEmpty
public boolean isEmpty()Iterate over all the entries registered -
hashCode
public int hashCode() -
equals
-
toString
-
toModel
public org.apache.jena.rdf.model.Model toModel() -
toModel
public void toModel(org.apache.jena.rdf.model.Model model)
-