IFactory factory = new CoreFactory();
NormalisedOntology no = new NormalisedOntology(factory);
System.out.println("Importing axioms");
InputStream conceptsFile = this.getClass().getResourceAsStream("/"+conceptsBase);
InputStream relsFile = this.getClass().getResourceAsStream("/"+relsBase);
RF1Importer imp = new RF1Importer(conceptsFile, relsFile, version);
Iterator<Ontology> it = imp.getOntologyVersions(new NullProgressMonitor());
Ontology ont = null;
while(it.hasNext()) {
Ontology o = it.next();
if(o.getVersion().equals("snomed")) {
ont = o;
break;
}
}
if(ont == null) {
System.out.println("Could not find version " + version + " in input files");
}
System.out.println("Loading axioms");
no.loadAxioms(new HashSet<Axiom>(ont.getStatedAxioms()));
System.out.println("Running classification");
no.classify();
System.out.println("Computing taxonomy");
no.buildTaxonomy();
System.out.println("Done");
// If a relationship that is part of a role group is added incrementally
// on its own then it will not be added to the correct role group
// because that information is missing. Therefore care must be taken to
// remove all relationships that belong to a role group when deriving
// a test case for incremental classification using RF1.
System.out.println("Running incremental classification");
imp = new RF1Importer(
this.getClass().getResourceAsStream("/"+conceptsInc),
this.getClass().getResourceAsStream("/"+relsInc),
version);
long start = System.currentTimeMillis();
System.out.println("Transforming axioms");
it = imp.getOntologyVersions(new NullProgressMonitor());
ont = null;
while(it.hasNext()) {
Ontology o = it.next();
if(o.getVersion().equals("snomed")) {