org.vivoweb.harvester.qualify
Class ChangeNamespace

java.lang.Object
  extended by org.vivoweb.harvester.qualify.ChangeNamespace

public class ChangeNamespace
extends java.lang.Object

Changes the namespace for all matching uris

Author:
Christopher Haines (hainesc@ctrip.ufl.edu)

Constructor Summary
ChangeNamespace(ArgList argList)
          Constructor
ChangeNamespace(JenaConnect model, JenaConnect vivo, java.lang.String oldName, java.lang.String newName, boolean errorLog)
          Constructor
ChangeNamespace(java.lang.String[] args)
          Constructor
 
Method Summary
static void changeNS(JenaConnect model, JenaConnect vivo, java.lang.String oldNamespace, java.lang.String newNamespace, boolean errorLog)
          Changes the namespace for all matching uris
 void execute()
          Change namespace
static java.lang.String getUnusedURI(java.lang.String namespace, JenaConnect... models)
          Gets an unused URI in the the given namespace for the given models
static void main(java.lang.String... args)
          Main method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeNamespace

public ChangeNamespace(java.lang.String[] args)
                throws java.io.IOException
Constructor

Parameters:
args - commandline arguments
Throws:
java.io.IOException - error creating task

ChangeNamespace

public ChangeNamespace(JenaConnect model,
                       JenaConnect vivo,
                       java.lang.String oldName,
                       java.lang.String newName,
                       boolean errorLog)
Constructor

Parameters:
model - model to change uris in
vivo - model in which to search for previously used uris
oldName - old namespace
newName - new namespacey
errorLog - log error messages for changed nodes

ChangeNamespace

public ChangeNamespace(ArgList argList)
                throws java.io.IOException
Constructor

Parameters:
argList - parsed argument list
Throws:
java.io.IOException - error reading config
Method Detail

getUnusedURI

public static java.lang.String getUnusedURI(java.lang.String namespace,
                                            JenaConnect... models)
                                     throws java.lang.IllegalArgumentException
Gets an unused URI in the the given namespace for the given models

Parameters:
namespace - the namespace
models - models to check in
Returns:
the uri
Throws:
java.lang.IllegalArgumentException - empty namespace

changeNS

public static void changeNS(JenaConnect model,
                            JenaConnect vivo,
                            java.lang.String oldNamespace,
                            java.lang.String newNamespace,
                            boolean errorLog)
                     throws java.lang.IllegalArgumentException
Changes the namespace for all matching uris

Parameters:
model - the model to change namespaces for
vivo - the model to search for uris in
oldNamespace - the old namespace
newNamespace - the new namespace
errorLog - log error messages for changed nodes
Throws:
java.lang.IllegalArgumentException - empty namespace

execute

public void execute()
Change namespace


main

public static void main(java.lang.String... args)
Main method

Parameters:
args - commandline arguments