Class 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 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.
        Use StreamManager and LocationMapper from org.apache.jena.riot.system.stream.
        Create a LocationMapper with no mapping yet
      • LocationMapper

        @Deprecated
        public LocationMapper​(LocationMapper locMapper)
        Deprecated.
        Use StreamManager and LocationMapper from org.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.
        Use StreamManager and LocationMapper from org.apache.jena.riot.system.stream.
        Create a LocationMapper from an existing model
        See Also:
        LocationMappingVocab
      • LocationMapper

        @Deprecated
        public LocationMapper​(java.lang.String config)
        Deprecated.
        Use StreamManager and LocationMapper from org.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.
        Use StreamManager and LocationMapper from org.apache.jena.riot.system.stream.
        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
        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 class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toModel

        public Model toModel()
      • toModel

        public void toModel​(Model model)
      • processConfig

        public void processConfig​(Model m)