org.ontoware.rdf2go.model
Interface NamespaceSupport

All Known Subinterfaces:
Model, ModelSet

public interface NamespaceSupport

This interface leaves it open to implementations where the prefixes go, e.g. if prefixes added to a Model change the mapping in the surrounding ModelSet if any. As namespaces do not really exist *in RDF*, only in syntaxes, there are no definitive specifications on this subject. This API is modeled after the OpenRDF 2.0 API. Discussion about this interfaces at http://issues.semweb4j.org/RTGO-20

Since:
4.6
Author:
voelkel

Method Summary
 java.lang.String getNamespace(java.lang.String prefix)
           
 java.util.Map<java.lang.String,java.lang.String> getNamespaces()
          Get all namespaces as a map of prefix to namespace.
 void removeNamespace(java.lang.String prefix)
          Throws no exception if the prefix was not present.
 void setNamespace(java.lang.String prefix, java.lang.String namespaceURI)
           
 

Method Detail

getNamespace

java.lang.String getNamespace(java.lang.String prefix)
Parameters:
prefix -
Returns:
the namespace that is associated with the specified prefix, if any. Null otherwise.

getNamespaces

java.util.Map<java.lang.String,java.lang.String> getNamespaces()
Get all namespaces as a map of prefix to namespace.

Returns:
An unmodifiable view on the namespaces. (compare to Collections.unmodifiableMap()). Never returns null.

removeNamespace

void removeNamespace(java.lang.String prefix)
Throws no exception if the prefix was not present.

Parameters:
prefix -

setNamespace

void setNamespace(java.lang.String prefix,
                  java.lang.String namespaceURI)
                  throws java.lang.IllegalArgumentException
Parameters:
prefix -
namespaceURI -
Throws:
java.lang.IllegalArgumentException - if the given namespaceURI is not a valid URI in this environment.


Copyright © 2005-2008 FZI - Forschungszentrum Informatik | Karlsruhe | Germany. All Rights Reserved.