NIHVIVO-2887 display model migration
This commit is contained in:
parent
d3c39033fd
commit
7a7333c4f0
1 changed files with 53 additions and 0 deletions
|
@ -0,0 +1,53 @@
|
|||
package edu.cornell.mannlib.vitro.webapp.servlet.setup;
|
||||
|
||||
import java.io.StringReader;
|
||||
|
||||
import junit.framework.Assert;
|
||||
|
||||
import com.hp.hpl.jena.rdf.model.Model;
|
||||
import com.hp.hpl.jena.rdf.model.ModelFactory;
|
||||
|
||||
import edu.cornell.mannlib.vitro.testing.AbstractTestClass;
|
||||
|
||||
public class UpdateKnowledgeBaseTest extends AbstractTestClass {
|
||||
|
||||
@org.junit.Test
|
||||
public void testMigrateDisplayModel() {
|
||||
|
||||
String version12DisplayModel = "\n" +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#PrimaryLuceneIndex> " +
|
||||
" a <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#Organizations> \n" +
|
||||
" a <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#ClassGroupPage> , \n" +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#Page> ; \n" +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#forClassGroup> \n " +
|
||||
" <http://vivoweb.org/ontology#vitroClassGrouporganizations> ; \n " +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#title> \n" +
|
||||
" \"Organizations\" ; \n" +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#urlMapping> \n " +
|
||||
" \"/organizations\" . ";
|
||||
|
||||
String version13DisplayModel = "\n" +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#SearchIndex> " +
|
||||
" a <http://www.w3.org/2002/07/owl#Thing> . \n" +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#Organizations> \n" +
|
||||
" a <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#Page> ; \n " +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#hasDataGetter> \n " +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#OrganizationsDataGetter1> ; " +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#title> \n " +
|
||||
" \"Organizations\" ; \n" +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#urlMapping> \n" +
|
||||
" \"/organizations\" . \n" +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#OrganizationsDataGetter1> \n" +
|
||||
" a <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#ClassGroupPage> ; \n" +
|
||||
" <http://vitro.mannlib.cornell.edu/ontologies/display/1.1#forClassGroup> \n" +
|
||||
" <http://vivoweb.org/ontology#vitroClassGrouporganizations> .";
|
||||
|
||||
Model preMigrate = ModelFactory.createDefaultModel().read(new StringReader(version12DisplayModel), null, "N3");
|
||||
Model postMigrate = ModelFactory.createDefaultModel().read(new StringReader(version13DisplayModel), null, "N3");
|
||||
UpdateKnowledgeBase.migrateDisplayModel(preMigrate);
|
||||
Assert.assertTrue(preMigrate.isIsomorphicWith(postMigrate));
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue