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
- While the URI is undefined do this loop
- generate a URI of the namespace
- check models for that URI if they do contain it then return the URI
- changeNS
- ensures that the old namespace is defined
- ensures that the new namespaces is defined
- ensures that the namespaces are not the same
- calls on batchRename
- batchRename
- create query string for URIs of the old namespace
- iterate through query solution set creating a Java Set of the URIs
- Get the resources related to the URIs
- Change them to the new namespace