org.topbraid.spin.system
Class ExtraPrefixes

java.lang.Object
  extended by org.topbraid.spin.system.ExtraPrefixes

public class ExtraPrefixes
extends java.lang.Object

Manages extra prefixes that are always available even if not explicitly declared. Examples include fn and Jena's afn.

Author:
Holger Knublauch

Constructor Summary
ExtraPrefixes()
           
 
Method Summary
static void add(Resource resource)
          Attempts to add an extra prefix for a given Resource.
static void add(java.lang.String prefix, java.lang.String namespace)
          Programmatically adds a new prefix to be regarded as an "extra" prefix.
static java.util.Map<java.lang.String,java.lang.String> getExtraPrefixes()
          Gets a Map from prefixes to namespaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtraPrefixes

public ExtraPrefixes()
Method Detail

add

public static void add(java.lang.String prefix,
                       java.lang.String namespace)
Programmatically adds a new prefix to be regarded as an "extra" prefix. These are prefixes that are assumed to be valid even if they haven't been declared in the current ontology. This method has no effect if the prefix was already set before.

Parameters:
prefix - the prefix to add
namespace - the namespace to add

add

public static void add(Resource resource)
Attempts to add an extra prefix for a given Resource. This does nothing if the prefix does not exist or is empty.

Parameters:
resource - the resource to get the namespace of

getExtraPrefixes

public static java.util.Map<java.lang.String,java.lang.String> getExtraPrefixes()
Gets a Map from prefixes to namespaces. The result should be treated as read-only.

Returns:
the extra prefixes