for ( String uri : preferredPrefixMap.keySet() ) {
String prefix = preferredPrefixMap.get(uri);
newOntModel.setNsPrefix(prefix, uri);
}
Ontology ont = newOntModel.createOntology(base_);
log.info("New ontology created with namespace " + ns_ + " base " + base_);
// Indicate Voc2RDF as the engineering tool:
ont.addProperty(Omv.usedOntologyEngineeringTool, OmvMmi.voc2rdf);
Map<String, Property> uriPropMap = MdHelper.getUriPropMap();
for ( String uri : values.keySet() ) {
String value = values.get(uri).trim();
if ( value.length() > 0 ) {
Property prop = uriPropMap.get(uri);
if ( prop == null ) {
log.warn("No property found for uri='" +uri+ "'");
continue;
}
//log.debug("adding property " + prop + " = " + value);
ont.addProperty(prop, value);
}
}
// set Omv.uri from final
ont.addProperty(Omv.uri, finalUri);
// set Omv.acronym from primaryClass
ont.addProperty(Omv.acronym, primaryClass);
String classUri = values.get("classUri");
if ( classUri != null ) {
ont.addProperty(OmvMmi.shortNameUri, classUri);
}
// fixed issue #120: "title doesn't get carried forward"
// problem was that Omv.name was assigned BOTH the class name and the fulltitle.
// Only the fullTitle is now assigned.
// ont.addProperty(Omv.name,
// setFirstUpperCase(cleanStringforID(primaryClass)) + " Vocabulary");
String fullTitle = values.get("fullTitle");
if ( fullTitle != null ) {
ont.addProperty(Omv.name, fullTitle);
}
String creator = values.get("creator");
if ( creator != null ) {
ont.addProperty(Omv.hasCreator, creator);
}
String briefDescription = values.get("briefDescription");
if ( briefDescription != null ) {
ont.addProperty(Omv.description, briefDescription);
}
if ( orgAbbreviation != null && orgAbbreviation.trim().length() > 0 ) {
ont.addProperty(OmvMmi.origMaintainerCode, orgAbbreviation.trim());
}
createOntologIndividuals();
}