001    /**
002     * Copyright (C) 2007-2009, Jens Lehmann
003     *
004     * This file is part of DL-Learner.
005     * 
006     * DL-Learner is free software; you can redistribute it and/or modify
007     * it under the terms of the GNU General Public License as published by
008     * the Free Software Foundation; either version 3 of the License, or
009     * (at your option) any later version.
010     *
011     * DL-Learner is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014     * GNU General Public License for more details.
015     *
016     * You should have received a copy of the GNU General Public License
017     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018     *
019     */
020    package org.dllearner.test;
021    
022    import java.io.File;
023    import java.net.URI;
024    import java.util.HashSet;
025    import java.util.Set;
026    
027    import org.apache.log4j.Level;
028    import org.apache.log4j.Logger;
029    import org.semanticweb.owl.apibinding.OWLManager;
030    import org.semanticweb.owl.inference.OWLReasoner;
031    import org.semanticweb.owl.inference.OWLReasonerException;
032    import org.semanticweb.owl.model.OWLOntology;
033    import org.semanticweb.owl.model.OWLOntologyCreationException;
034    import org.semanticweb.owl.model.OWLOntologyManager;
035    
036    /**
037     * @author Jens Lehmann
038     *
039     */
040    public class PelletPerformanceProblem {
041    
042            public static void main(String[] args) throws OWLOntologyCreationException, OWLReasonerException {
043                    Logger pelletLogger = Logger.getLogger("org.mindswap.pellet");
044                    pelletLogger.setLevel(Level.WARN);              
045            OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
046    
047            File f = new File("examples/epc/conf/sap_modell_komplett_2.owl");
048            URI physicalURI = f.toURI();
049            OWLOntology ontology = manager.loadOntologyFromPhysicalURI(physicalURI);
050            
051            Set<OWLOntology> ontologies = new HashSet<OWLOntology>();
052            ontologies.add(ontology);
053            OWLReasoner reasoner = new org.mindswap.pellet.owlapi.Reasoner(manager);
054            reasoner.loadOntologies(ontologies);
055            System.out.println("ontology loaded");
056            
057            reasoner.classify();
058            System.out.println("ontology classified");
059            reasoner.realise();
060            System.out.println("ontology realised");
061            }
062            
063    }