Package org.apache.jena.util
Class LocationMapper
- java.lang.Object
-
- org.apache.jena.util.LocationMapper
-
public class LocationMapper extends java.lang.Object
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{FileManager}.- See Also:
FileManager
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_PATH
The default path for searching for the location mapperstatic java.lang.String
GlobalMapperSystemProperty1
static java.lang.String
GlobalMapperSystemProperty2
-
Constructor Summary
Constructors Constructor Description LocationMapper()
Deprecated.UseStreamManager
andLocationMapper
fromorg.apache.jena.riot.system.stream
.LocationMapper(java.lang.String config)
Deprecated.UseStreamManager
andLocationMapper
fromorg.apache.jena.riot.system.stream
.LocationMapper(Model model)
Deprecated.UseStreamManager
andLocationMapper
fromorg.apache.jena.riot.system.stream
.LocationMapper(LocationMapper locMapper)
Deprecated.UseStreamManager
andLocationMapper
fromorg.apache.jena.riot.system.stream
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addAltEntry(java.lang.String uri, java.lang.String alt)
void
addAltPrefix(java.lang.String uriPrefix, java.lang.String altPrefix)
java.lang.String
altMapping(java.lang.String uri)
java.lang.String
altMapping(java.lang.String uri, java.lang.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.boolean
equals(java.lang.Object obj)
static LocationMapper
get()
Deprecated.UseStreamManager
andLocationMapper
fromorg.apache.jena.riot.system.stream
.java.lang.String
getAltEntry(java.lang.String uri)
java.lang.String
getAltPrefix(java.lang.String uriPrefix)
static LocationMapper
getInternal()
For use within Jena libraries only.int
hashCode()
java.util.Iterator<java.lang.String>
listAltEntries()
Iterate over all the entries registeredjava.util.Iterator<java.lang.String>
listAltPrefixes()
Iterate over all the prefixes registeredstatic LocationMapper
makeGlobal()
Make a location mapper from the path settingsvoid
processConfig(Model m)
void
removeAltEntry(java.lang.String uri)
void
removeAltPrefix(java.lang.String uriPrefix)
static void
setGlobalLocationMapper(LocationMapper globalLocationMapper)
Set the global location mapper.Model
toModel()
void
toModel(Model model)
java.lang.String
toString()
-
-
-
Field Detail
-
DEFAULT_PATH
public static final java.lang.String DEFAULT_PATH
The default path for searching for the location mapper- See Also:
- Constant Field Values
-
GlobalMapperSystemProperty1
public static final java.lang.String GlobalMapperSystemProperty1
- See Also:
- Constant Field Values
-
GlobalMapperSystemProperty2
public static final java.lang.String GlobalMapperSystemProperty2
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LocationMapper
@Deprecated public LocationMapper()
Deprecated.UseStreamManager
andLocationMapper
fromorg.apache.jena.riot.system.stream
.Create a LocationMapper with no mapping yet
-
LocationMapper
@Deprecated public LocationMapper(LocationMapper locMapper)
Deprecated.UseStreamManager
andLocationMapper
fromorg.apache.jena.riot.system.stream
.Create a LocationMapper made like another one This is a deep copy of the location and prefix maps.
-
LocationMapper
@Deprecated public LocationMapper(Model model)
Deprecated.UseStreamManager
andLocationMapper
fromorg.apache.jena.riot.system.stream
.Create a LocationMapper from an existing model- See Also:
LocationMappingVocab
-
LocationMapper
@Deprecated public LocationMapper(java.lang.String config)
Deprecated.UseStreamManager
andLocationMapper
fromorg.apache.jena.riot.system.stream
.Create a LocationMapper from a config file
-
-
Method Detail
-
getInternal
public static LocationMapper getInternal()
For use within Jena libraries only.
-
get
@Deprecated public static LocationMapper get()
Deprecated.UseStreamManager
andLocationMapper
fromorg.apache.jena.riot.system.stream
.Get the global LocationMapper.
-
setGlobalLocationMapper
public static void setGlobalLocationMapper(LocationMapper globalLocationMapper)
Set the global location mapper. (as returned byget()
) If called before any call to get(), then the usual default global location mapper is not created- Parameters:
globalLocationMapper
-
-
makeGlobal
public static LocationMapper makeGlobal()
Make a location mapper from the path settings
-
altMapping
public java.lang.String altMapping(java.lang.String uri)
-
altMapping
public java.lang.String altMapping(java.lang.String uri, java.lang.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.- Parameters:
uri
-otherwise
-- Returns:
- The alternative location chosen
-
addAltEntry
public void addAltEntry(java.lang.String uri, java.lang.String alt)
-
addAltPrefix
public void addAltPrefix(java.lang.String uriPrefix, java.lang.String altPrefix)
-
listAltEntries
public java.util.Iterator<java.lang.String> listAltEntries()
Iterate over all the entries registered
-
listAltPrefixes
public java.util.Iterator<java.lang.String> listAltPrefixes()
Iterate over all the prefixes registered
-
removeAltEntry
public void removeAltEntry(java.lang.String uri)
-
removeAltPrefix
public void removeAltPrefix(java.lang.String uriPrefix)
-
getAltEntry
public java.lang.String getAltEntry(java.lang.String uri)
-
getAltPrefix
public java.lang.String getAltPrefix(java.lang.String uriPrefix)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toModel
public Model toModel()
-
toModel
public void toModel(Model model)
-
processConfig
public void processConfig(Model m)
-
-