org.jrdf.writer
Interface RdfNamespaceMap

All Known Implementing Classes:
RdfNamespaceMapImpl

public interface RdfNamespaceMap

Contains mappings between namespaces and partial URIs.

Version:
$Id: RdfNamespaceMap.java 3281 2010-05-27 21:41:59Z newmana $
Author:
TurnerRX

Method Summary
 void addNamespace(String namespace, String partialUri)
          Adds a new namespace mapping, if no mapping already exists.
 Set<Map.Entry<String,String>> getNameEntries()
          Returns the Names mapping entry set.
 QName getQName(String uri)
          Parses a string and finds the last # or / and treats the characters before that as the namespace URI and the characters after it as the local part.
 void load(Graph graph)
          Loads namespaces from the graph.
 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.

addNamespace

void addNamespace(String namespace,
                  String partialUri)
                  throws NamespaceException
Adds a new namespace mapping, if no mapping already exists.

Parameters:
namespace - the shortened name to add, e.g. rdf.
partialUri - the URI to map, e.g. http://www.w3.org/1999/02/22-rdf-syntax-ns#.
Throws:
NamespaceException

getNameEntries

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

Returns:
name map entries.

getQName

QName getQName(String uri)
Parses a string and finds the last # or / and treats the characters before that as the namespace URI and the characters after it as the local part.

Parameters:
uri - the uri to parse
Returns:
either a QName with a namespace URI and local part if a # or / is found or a QName with the given string as the namespace uri and an empty string as the local part.

reset

void reset()
Reset the name and uri mappings.