public Stats runBechmarkRF1 ( ) { Stats res = new Stats ( ) ; String version = "20110731" ; // Classify ontology from stated form System . out . println ( "Classifying ontology" ) ; long start = System . currentTimeMillis ( ) ; IFactory factory = new CoreFactory ( ) ; NormalisedOntology no = new NormalisedOntology ( factory ) ; System . out . println ( "Importing axioms" ) ; RF1Importer imp = new RF1Importer ( this . getClass ( ) . getResourceAsStream ( "/sct1_Concepts_Core_INT_20110731.txt" ) , this . getClass ( ) . getResourceAsStream ( "/res1_StatedRelationships_Core_INT_20110731.txt" ) , 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 ; } } // We can do this because we know there is only one ontology (RF1 does // not support multiple versions) if ( ont == null ) { throw new RuntimeException ( "Could not find version " + version + " in input files" ) ; } res . setAxiomTransformationTimeMs ( System . currentTimeMillis ( ) - start ) ; start = System . currentTimeMillis ( ) ; System . out . println ( "Loading axioms" ) ; no . loadAxioms ( new HashSet < Axiom > ( ( Collection < ? extends Axiom > ) ont . getStatedAxioms ( ) ) ) ; res . setAxiomLoadingTimeMs ( System . currentTimeMillis ( ) - start ) ; start = System . currentTimeMillis ( ) ; System . out . println ( "Running classification" ) ; no . classify ( ) ; res . setClassificationTimeMs ( System . currentTimeMillis ( ) - start ) ; start = System . currentTimeMillis ( ) ; System . out . println ( "Computing taxonomy" ) ; no . buildTaxonomy ( ) ; res . setTaxonomyBuildingTimeMs ( System . currentTimeMillis ( ) - start ) ; System . out . println ( "Done" ) ; return res ; }
Runs the benchmark using an RF1 file as input .