From: <lor...@us...> - 2012-02-08 13:23:18
|
Revision: 3577 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3577&view=rev Author: lorenz_b Date: 2012-02-08 13:23:08 +0000 (Wed, 08 Feb 2012) Log Message: ----------- Reading ontologies from BZIP2. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/utilities/JustificationBasedCoherentOntologyExtractor.java Modified: trunk/components-core/src/main/java/org/dllearner/utilities/JustificationBasedCoherentOntologyExtractor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/JustificationBasedCoherentOntologyExtractor.java 2012-02-08 11:49:16 UTC (rev 3576) +++ trunk/components-core/src/main/java/org/dllearner/utilities/JustificationBasedCoherentOntologyExtractor.java 2012-02-08 13:23:08 UTC (rev 3577) @@ -1,7 +1,9 @@ package org.dllearner.utilities; +import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; +import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; @@ -682,8 +684,11 @@ boolean computeParallel = Boolean.valueOf(args[3]); System.out.println("Loading ontology..."); - File file = new File(filename); - OWLOntology schema = man.loadOntologyFromOntologyDocument(file); + InputStream is = new BufferedInputStream(new FileInputStream(filename)); + if(args[0].endsWith("bz2")){ + is = new CompressorStreamFactory().createCompressorInputStream("bzip2", is); + } + OWLOntology schema = man.loadOntologyFromOntologyDocument(is); man.removeAxioms(schema, schema.getAxioms(AxiomType.TRANSITIVE_OBJECT_PROPERTY)); // OWLOntology cleaned = man.createOntology(IRI.create("http://dbpedia_cleaned.owl")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |