String entityUri = String.valueOf(rdfNode);
if ( entityUri == null ) {
continue;
}
ClassInfo entityInfo = new ClassInfo();
entityInfo.setUri(entityUri);
// is ontologyUri a prefix of entityUri?
if ( entityUri.indexOf(ontologyUri) == 0 ) {
String localName = entityUri.substring(ontologyUri.length());
localName = localName.replaceAll("^/+", "");
entityInfo.setLocalName(localName);
}
else {
// use the given entityUri as the local name.
// Note that the query is made against the ontology, so every entity
// found there should be included.
String localName = _getLocalName(entityUri);
entityInfo.setLocalName(localName);
}
if ( entityInfo != null ) {
_addProps(entityUri, entityInfo, ontModel);
entities.add(entityInfo);