baseOntologyData.setProperties(properties);
baseOntologyData.setClasses(classes);
// now, determine the type of ontology data to be created:
OntologyData ontologyData;
if ( OntServiceUtil.isOntResolvableUri(ontologyUri) ) {
//
// apply the ad hoc rules to determine type of ontology only if
// the ontologyUri is resolvable by the Ont service.
//
List<Mapping> mappings = _getSkosRelations(null, ontModel);
boolean containSkos = mappings.size() > 0 || _containsSkos(ontModel, individuals);
// determine type of ontologyData to create
// TODO NOTE: these are just heuristics to determine the ontologyData type:
// Pending: use omv:useOntologyEngineeringTool for example.
if ( containSkos ) {
baseOntologyInfo.setType(OntologyType.MAPPING);
ontologyData = _createMappingOntologyData(baseOntologyData, mappings, individuals);
}
else if ( classes.size() == 1 && individuals.size() > 0 && containDatatype ) {
baseOntologyInfo.setType(OntologyType.VOCABULARY);
ontologyData = _createVocabularyOntologyData(baseOntologyData);
}
else {
baseOntologyInfo.setType(OntologyType.OTHER);
ontologyData = _createOtherOntologyData(baseOntologyData);
}
}
else {
// otherwise (the URI is not Ont resolvable), always create the "other" type of ontology data
baseOntologyInfo.setType(OntologyType.OTHER);
ontologyData = _createOtherOntologyData(baseOntologyData);
}
ontologyData.setBaseOntologyData(baseOntologyData);
baseOntologyInfo.setOntologyData(ontologyData);
return baseOntologyInfo;
}