edu.stanford.smi.protegex.owl.jena
Interface URIResolver

All Known Implementing Classes:
DefaultURIResolver

public interface URIResolver

An interface for objects used by the ProtegeOWLParser to convert logical URIs to physical URLs. This is used to redirect imports and file loading in general, and to determine the file to save a model into.

Author:
Holger Knublauch

Method Summary
 URL getPhysicalURL(URI uri)
          Converts a logical URI into a physical URL.
 String getPreferredNamespacePrefix(String namespace)
          Gets the prefix that should be used for a namespace if no other prefix has been defined yet.
 String getRelativePhysicalFileName(URI uri)
          If the result of getPhysicalURL() is internally derived from a relative file, then this returns the relative file name.
 boolean isEditableImport(URI uri)
          Checks if a given import is editable for the current OWLModel.
 void setEditableImport(URI uri, boolean value)
           
 void setPhysicalURL(URI uri, String relativeFileName)
          Sets the physical URL of an URI to point to a relative file.
 void setPhysicalURL(URI uri, URL physicalURL)
          Sets the physical URL of an URI.
 

Method Detail

getPhysicalURL

public URL getPhysicalURL(URI uri)
Converts a logical URI into a physical URL.

Parameters:
uri - the logical URI
Returns:
the physical URL (often the same as url)

getRelativePhysicalFileName

public String getRelativePhysicalFileName(URI uri)
If the result of getPhysicalURL() is internally derived from a relative file, then this returns the relative file name.

Parameters:
uri - the logical URI
Returns:
the relative file name or null if the URL is absolute

getPreferredNamespacePrefix

public String getPreferredNamespacePrefix(String namespace)
Gets the prefix that should be used for a namespace if no other prefix has been defined yet. If no such entry is found during loading, the system will generate one automatically (e.g., "p1").

Parameters:
namespace - the namespace to get a prefix for (including '#')
Returns:
a valid, non-empty namespace prefix or null for default

isEditableImport

public boolean isEditableImport(URI uri)
Checks if a given import is editable for the current OWLModel. This is used to determine whether a given TripleStore shall be editable or not. Not editable TripleStores will not be saved to disc. If the method returns true, then there must be a physical file URL for the URI.

Parameters:
uri - the URI of the import (usually the name of the associated TripleStore)
Returns:
true if uri points to an editable file

setEditableImport

public void setEditableImport(URI uri,
                              boolean value)

setPhysicalURL

public void setPhysicalURL(URI uri,
                           URL physicalURL)
Sets the physical URL of an URI.

Parameters:
uri - the URI to set the URL of
physicalURL - the new physcial URL or null to reset this URI

setPhysicalURL

public void setPhysicalURL(URI uri,
                           String relativeFileName)
Sets the physical URL of an URI to point to a relative file.

Parameters:
uri - the URI to set the URL of
relativeFileName - the name of the file (not null)