restricting TBox annotations updates to rdfs and vitro namespaces

This commit is contained in:
bjl23 2010-07-12 19:14:38 +00:00
parent 83e3379592
commit 2b537937be
2 changed files with 11 additions and 0 deletions

View file

@ -163,6 +163,7 @@ public class ABoxUpdater {
renameCount++; renameCount++;
Statement newStatement = ResourceFactory.createStatement(newClass, oldStatement.getPredicate(), oldStatement.getObject()); Statement newStatement = ResourceFactory.createStatement(newClass, oldStatement.getPredicate(), oldStatement.getObject());
additions.add(newStatement); additions.add(newStatement);
retractions.add(oldStatement);
} else { } else {
removeCount++; removeCount++;
retractions.add(oldStatement); retractions.add(oldStatement);

View file

@ -16,6 +16,7 @@ import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.Statement; import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.rdf.model.StmtIterator; import com.hp.hpl.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.shared.Lock; import com.hp.hpl.jena.shared.Lock;
import com.hp.hpl.jena.vocabulary.RDFS;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
@ -107,6 +108,15 @@ public class TBoxUpdater {
Property predicate = stmt.getPredicate(); Property predicate = stmt.getPredicate();
RDFNode oldObject = stmt.getObject(); RDFNode oldObject = stmt.getObject();
if (! ( (RDFS.getURI().equals(predicate.getNameSpace())) ||
(VitroVocabulary.vitroURI.equals(predicate.getNameSpace()))
) ) {
// this annotation updater is only concerned with properties
// such as rdfs:comment and properties in the vitro application
// namespace
continue;
}
if (VitroVocabulary.TAB_AUTOLINKEDTOTAB.equals(predicate.getURI())) { if (VitroVocabulary.TAB_AUTOLINKEDTOTAB.equals(predicate.getURI())) {
continue; continue;
// the tab autolinks are not like the other annotations // the tab autolinks are not like the other annotations