Skip to content

Commit 9cfbfae

Browse files
committed
Handle JenaException when importing ontologies
1 parent 894efb0 commit 9cfbfae

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/ubic/basecode/ontology/jena/OntologyLoader.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.hp.hpl.jena.ontology.OntModel;
2222
import com.hp.hpl.jena.ontology.OntModelSpec;
2323
import com.hp.hpl.jena.rdf.model.*;
24+
import com.hp.hpl.jena.shared.JenaException;
2425
import org.apache.commons.io.FileUtils;
2526
import org.apache.commons.lang3.StringUtils;
2627
import org.apache.commons.lang3.time.StopWatch;
@@ -205,8 +206,8 @@ public Model getModel( String URL, ModelReader loadIfAbsent ) {
205206
if ( urlc != null ) {
206207
try ( InputStream in = urlc.getInputStream() ) {
207208
return model.read( in, URL );
208-
} catch ( IOException e ) {
209-
log.error( String.format( "Failed to load from %s.", URL ), e );
209+
} catch ( JenaException | IOException e ) {
210+
log.error( String.format( "Failed to resolve import %s for %s: %s.", URL, url, e.getMessage() ) );
210211
}
211212
}
212213
return loadIfAbsent.readModel( model, URL );

0 commit comments

Comments
 (0)