From 2b537937be77ed54003545876899c5dfa6ac8311 Mon Sep 17 00:00:00 2001 From: bjl23 Date: Mon, 12 Jul 2010 19:14:38 +0000 Subject: [PATCH] restricting TBox annotations updates to rdfs and vitro namespaces --- .../vitro/webapp/ontology/update/ABoxUpdater.java | 1 + .../vitro/webapp/ontology/update/TBoxUpdater.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/ABoxUpdater.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/ABoxUpdater.java index 5b99c58a8..6b4e491e8 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/ABoxUpdater.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/ABoxUpdater.java @@ -163,6 +163,7 @@ public class ABoxUpdater { renameCount++; Statement newStatement = ResourceFactory.createStatement(newClass, oldStatement.getPredicate(), oldStatement.getObject()); additions.add(newStatement); + retractions.add(oldStatement); } else { removeCount++; retractions.add(oldStatement); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/TBoxUpdater.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/TBoxUpdater.java index d3e10bbb5..988170763 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/TBoxUpdater.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/ontology/update/TBoxUpdater.java @@ -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.StmtIterator; import com.hp.hpl.jena.shared.Lock; +import com.hp.hpl.jena.vocabulary.RDFS; import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; @@ -107,6 +108,15 @@ public class TBoxUpdater { Property predicate = stmt.getPredicate(); 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())) { continue; // the tab autolinks are not like the other annotations