protected static OntologyData _createVocabularyOntologyData(BaseOntologyData baseData) {
VocabularyOntologyData ontologyData = new VocabularyOntologyData();
ontologyData.setBaseOntologyData(baseData);
Map<String, ClassData> classMap = new HashMap<String, ClassData>();
List<PropertyInfo> properties = baseData.getProperties();
for ( PropertyInfo entity : properties ) {
if ( ! entity.isDatatypeProperty() ) {
continue;
}
String classUri = entity.getDomainUri();
if ( classUri == null ) {
continue;
}
ClassData classData = classMap.get(classUri);
if ( classData == null ) {
classData = new ClassData();
classMap.put(classUri, classData);
classData.setClassUri(classUri);
classData.setClassInfo(entity.getDomainClassInfo());
classData.setDatatypeProperties(new ArrayList<String>());
}
classData.getDatatypeProperties().add(entity.getLocalName());
}
// add the found classes and add corresponding individuals:
List<ClassData> classes = new ArrayList<ClassData>();
ontologyData.setClasses(classes);
for ( String classUri : classMap.keySet() ) {
ClassData classData = classMap.get(classUri);
classes.add(classData);