private void extractInferences() {
if( selector.size() == 0 )
throw new PelletCmdException( "Selector is empty, provide types to extract" );
ModelExtractor extractor = new ModelExtractor( getKB() );
extractor.setSelector( selector );
Model extracted = ModelFactory.createDefaultModel();
if( SetUtils.intersects( selector, ModelExtractor.StatementType.ALL_CLASS_STATEMENTS ) ) {
startTask( "Extracting class statements" );
extractor.extractClassModel( extracted );
finishTask( "Extracting class statements" );
}
if( SetUtils.intersects( selector, ModelExtractor.StatementType.ALL_PROPERTY_STATEMENTS ) ) {
startTask( "Extracting property statements" );
extractor.extractPropertyModel( extracted );
finishTask( "Extracting property statements" );
}
if( SetUtils.intersects( selector, ModelExtractor.StatementType.ALL_INDIVIDUAL_STATEMENTS ) ) {
startTask( "Extracting individual statements" );
extractor.extractIndividualModel( extracted );
finishTask( "Extracting individual statements" );
}
output( extracted );
}