Class LocationMapper


public class LocationMapper extends 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:
  • Field Details

  • Constructor Details

    • LocationMapper

      @Deprecated public LocationMapper()
      Use StreamManager and LocationMapper from
      Create a LocationMapper with no mapping yet
    • LocationMapper

      @Deprecated public LocationMapper(LocationMapper locMapper)
      Use StreamManager and LocationMapper from
      Create a LocationMapper made like another one This is a deep copy of the location and prefix maps.
    • LocationMapper

      @Deprecated public LocationMapper(Model model)
      Use StreamManager and LocationMapper from
      Create a LocationMapper from an existing model
      See Also:
    • LocationMapper

      @Deprecated public LocationMapper(String config)
      Use StreamManager and LocationMapper from
      Create a LocationMapper from a config file
  • Method Details

    • getInternal

      public static LocationMapper getInternal()
      For use within Jena libraries only.
    • get

      @Deprecated public static LocationMapper get()
      Use StreamManager and LocationMapper from
      Get the global LocationMapper.
    • setGlobalLocationMapper

      public static void setGlobalLocationMapper(LocationMapper globalLocationMapper)
      Set the global location mapper. (as returned by get()) If called before any call to get(), then the usual default global location mapper is not created
      globalLocationMapper -
    • makeGlobal

      public static LocationMapper makeGlobal()
      Make a location mapper from the path settings
    • altMapping

      public String altMapping(String uri)
    • altMapping

      public String 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.
      uri -
      otherwise -
      The alternative location chosen
    • addAltEntry

      public void addAltEntry(String uri, String alt)
    • addAltPrefix

      public void addAltPrefix(String uriPrefix, String altPrefix)
    • listAltEntries

      public Iterator<String> listAltEntries()
      Iterate over all the entries registered
    • listAltPrefixes

      public Iterator<String> listAltPrefixes()
      Iterate over all the prefixes registered
    • removeAltEntry

      public void removeAltEntry(String uri)
    • removeAltPrefix

      public void removeAltPrefix(String uriPrefix)
    • getAltEntry

      public String getAltEntry(String uri)
    • getAltPrefix

      public String getAltPrefix(String uriPrefix)
    • hashCode

      public int hashCode()
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      equals in class Object
    • toString

      public String toString()
      toString in class Object
    • toModel

      public Model toModel()
    • toModel

      public void toModel(Model model)
    • processConfig

      public void processConfig(Model m)