log.info("=============== INIT OrrClient =================");
OrrClientConfiguration config = new OrrClientConfiguration();
config.setOntServiceUrl(ONT_SERVICE_URL);
config.setPreviewDirectory(PREVIEW_DIRECTORY);
IOrrClient orrClient = IOrrClient.Manager.init(config);
orrClient.getMetadataBaseInfo(false, resourceTypeClassUri, authorityClassUri);
log.info("=============== GET getTempOntologyInfo =================");
TempOntologyInfo tempOntologyInfo = orrClient.getTempOntologyInfo(fileType, filename, false, false);
assertNull("No error in getTempOntologyInfo", tempOntologyInfo.getError());
String namespace = tempOntologyInfo.getUri();
log.info("tempOntologyInfo.getUri() = " +namespace);
assertNotNull("namespace must be present", namespace);
log.info("=============== authenticate user =================");
LoginResult loginResult = _authenticateUser(orrClient);
log.info("=============== createOntology =================");
CreateOntologyInfo createOntologyInfo = new CreateOntologyInfo();
OtherDataCreationInfo dataCreationInfo = new OtherDataCreationInfo();
dataCreationInfo.setTempOntologyInfo(tempOntologyInfo);
// createOntologyInfo.setBaseOntologyInfo(tempOntologyInfo);
createOntologyInfo.setUri(namespace);
createOntologyInfo.setDataCreationInfo(dataCreationInfo);
createOntologyInfo.setHostingType(HostingType.RE_HOSTED);
Map<String, String> metadataValues = _getMetadataValues(prefix);
createOntologyInfo.setMetadataValues(metadataValues);
CreateOntologyResult createOntologyResult = orrClient.createOntology(createOntologyInfo);
assertNull("No error in createOntologyResult", createOntologyResult.getError());
log.debug("createOntologyResult = " +createOntologyResult);
log.info("=============== registerOntology =================");
RegisterOntologyResult registerOntologyResult = orrClient.registerOntology(createOntologyResult, loginResult);
assertNull("No error in registerOntology", registerOntologyResult.getError());
log.debug("createOntologyResult = " +createOntologyResult.getUri());
log.info("=============== getOntologyInfo =================");
RegisteredOntologyInfo registeredOntologyInfo = orrClient.getOntologyInfo(namespace);
assertNull("No error in registeredOntologyInfo", registeredOntologyInfo.getError());
orrClient.getOntologyContents(registeredOntologyInfo, null);
if ( UNREGISTER ) {
_unregister(orrClient, loginResult, registeredOntologyInfo);
}
}