org.jrdf.writer
Interface RdfNamespaceMap

All Known Implementing Classes:
RdfNamespaceMapImpl

public interface RdfNamespaceMap

Contains mappings between namespaces and partial URIs.

Author:
TurnerRX

Method Summary
 String getFullUri(String partial)
          Returns the URI that is mapped to the prefix or null if the prefix is not mapped.
 Set<Map.Entry<String,String>> getNameEntries()
          Returns the Names mapping entry set.
 String getPrefix(URIReference resource)
          Returns the prefix that is mapped to the resource or null if the URI is not mapped.
 void load(Graph graph)
          Loads namespaces from the graph.
 String replaceNamespace(URIReference resource)
          Returns a string representing the resource URI with its URI prefix replaced by the mapped namespace.
 void reset()
          Reset the name and uri mappings.
 

Method Detail

load

void load(Graph graph)
          throws GraphException
Loads namespaces from the graph.

Parameters:
graph - Graph containing URIs to load from.
Throws:
GraphException - If the graph cannot be read.

replaceNamespace

String replaceNamespace(URIReference resource)
                        throws NamespaceException
Returns a string representing the resource URI with its URI prefix replaced by the mapped namespace.

Parameters:
resource - URIReference resource URI
Returns:
String namespaced representation of resource URI
Throws:
NamespaceException - If there is no mapping for the partial resource URI.

getPrefix

String getPrefix(URIReference resource)
Returns the prefix that is mapped to the resource or null if the URI is not mapped. Extracts the uri to the last '#' or '/' character.

Parameters:
resource - prefix to look up.
Returns:
full namespace.

getFullUri

String getFullUri(String partial)
Returns the URI that is mapped to the prefix or null if the prefix is not mapped.

Parameters:
partial - prefix to lookup.
Returns:
full namespace.

getNameEntries

Set<Map.Entry<String,String>> getNameEntries()
Returns the Names mapping entry set.

Returns:
name map entries.

reset

void reset()
Reset the name and uri mappings.