NIHVIVO-2426b and NIHVIVO-2771 knowledge base migration work
This commit is contained in:
parent
c31e82f382
commit
2cadb8be71
2 changed files with 21 additions and 11 deletions
|
@ -24,7 +24,6 @@ import com.hp.hpl.jena.shared.Lock;
|
||||||
import com.hp.hpl.jena.vocabulary.OWL;
|
import com.hp.hpl.jena.vocabulary.OWL;
|
||||||
import com.hp.hpl.jena.vocabulary.RDF;
|
import com.hp.hpl.jena.vocabulary.RDF;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.ontology.update.AtomicOntologyChange.AtomicChangeType;
|
import edu.cornell.mannlib.vitro.webapp.ontology.update.AtomicOntologyChange.AtomicChangeType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -425,14 +424,18 @@ public class ABoxUpdater {
|
||||||
while(propItr.hasNext()){
|
while(propItr.hasNext()){
|
||||||
AtomicOntologyChange propChangeObj = propItr.next();
|
AtomicOntologyChange propChangeObj = propItr.next();
|
||||||
switch (propChangeObj.getAtomicChangeType()){
|
switch (propChangeObj.getAtomicChangeType()){
|
||||||
case ADD: addProperty(propChangeObj);
|
case ADD:
|
||||||
break;
|
addProperty(propChangeObj);
|
||||||
case DELETE: deleteProperty(propChangeObj);
|
break;
|
||||||
break;
|
case DELETE:
|
||||||
case RENAME: renameProperty(propChangeObj);
|
deleteProperty(propChangeObj);
|
||||||
break;
|
break;
|
||||||
default: logger.logError("unexpected change type indicator: " + propChangeObj.getAtomicChangeType());
|
case RENAME:
|
||||||
break;
|
renameProperty(propChangeObj);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
logger.logError("unexpected change type indicator: " + propChangeObj.getAtomicChangeType());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -419,8 +419,10 @@ public class SimpleReasoner extends StatementListener {
|
||||||
|
|
||||||
if (cls != null) {
|
if (cls != null) {
|
||||||
|
|
||||||
List<OntClass> parents = (cls.listSuperClasses(false)).toList();
|
List<OntClass> parents = null;
|
||||||
|
parents = (cls.listSuperClasses(false)).toList();
|
||||||
parents.addAll((cls.listEquivalentClasses()).toList());
|
parents.addAll((cls.listEquivalentClasses()).toList());
|
||||||
|
|
||||||
Iterator<OntClass> parentIt = parents.iterator();
|
Iterator<OntClass> parentIt = parents.iterator();
|
||||||
|
|
||||||
while (parentIt.hasNext()) {
|
while (parentIt.hasNext()) {
|
||||||
|
@ -453,7 +455,9 @@ public class SimpleReasoner extends StatementListener {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.warn("The object of this rdf:type assertion has a null URI: " + stmtString(stmt));
|
log.warn("The object of this rdf:type assertion has a null URI: " + stmtString(stmt));
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("exception while removing abox type assertions: " + e.getMessage());
|
||||||
} finally {
|
} finally {
|
||||||
tboxModel.leaveCriticalSection();
|
tboxModel.leaveCriticalSection();
|
||||||
}
|
}
|
||||||
|
@ -530,6 +534,9 @@ public class SimpleReasoner extends StatementListener {
|
||||||
if (aboxModel.contains(stmt)) return true;
|
if (aboxModel.contains(stmt)) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.debug("exception in method entailedType: " + e.getMessage());
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
aboxModel.leaveCriticalSection();
|
aboxModel.leaveCriticalSection();
|
||||||
|
|
Loading…
Add table
Reference in a new issue