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