Overview

 Depending on how your data came in and how you generated triples for it the last step before importing the information into VIVO is to give your data proper URIs via the ChangeNamespace tool. Prior to this step, URIs may be placeholders provided by the XSLT translation (typically using aspects of the raw data that are expected to be unique, such as an ISBN number) or blank nodes from a SPARQL Construct.  If you've generated unique URI's for all of your data using a piece of unique information then you can skip this step. After this step all data has a proper VIVO URI and is ready for import into VIVO.ChangeNamespace takes a model and changes all elements within one namespace to another namespace.

Arguments

Short Option

Long Option

Parameter Value Map

Description

Required

i

inputJena-config

CONFIG_FILE

inputJena JENA configuration filename

true

I

inputOverride

override the JENA_PARAM of inputJena jena model config using VALUE

false

v

vivoModel

CONFIG_FILE

config file for VIVO

true

V

vivoOverride

override the JENA_PARAM of vivoJena jena model config using VALUE

false

u

oldNamespace

OLD_NAMESPACE

the old namespce

true

n

newNamespace

NEW_NAMESPACE

the new namespace

true

e

errorLogging

THRESHOLD

log error messages for each record changed

false

Usage

This class is used, within the example scripts, to change the namespace of the unmatched elements to the vivo's namespace. This is accomplished by making the initial namespace one which is harvest specific, then as the Match renames the nodes it will be simultaneously changing their namespace. Once the matching is done, the change in namespace is applied to each of the existing Harvest specific namespaces. This is the process by which new resources are moved into the model and thus if no Condensing of the data is preformed it can cause duplication of resources.

Methods:

  • getUnusedURI
  1. While the URI is undefined do this loop
    1. generate a URI of the namespace
    2. check models for that URI if they do contain it then return the URI
  • changeNS
  1. ensures that the old namespace is defined
  2. ensures that the new namespaces is defined
  3. ensures that the namespaces are not the same
  4. calls on batchRename
  • batchRename
  1. create query string for URIs of the old namespace
  2. iterate through query solution set creating a Java Set of the URIs
  3. Get the resources related to the URIs
  4. Change them to the new namespace