diff --git a/html/tutorial/tutorial4/MyApp.java b/html/tutorial/tutorial4/MyApp.java index 708542b84cd894294815fca2890e7acb418addb5..1e0809f826cae8ed703ae15341e49b42599dc8b9 100644 --- a/html/tutorial/tutorial4/MyApp.java +++ b/html/tutorial/tutorial4/MyApp.java @@ -446,11 +446,19 @@ public class MyApp { displayQueryAnswer( model, QueryFactory.create( transformedQuery ) ); System.out.println( " ***** SPARQL Query answering in the merged ontology ***** " ); - model = (OntModel)ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM_RULE_INF, null ); - model.read( "file:"+merged.getPath() ); - model.loadImports(); - /* + // model = (OntModel)ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM_RULE_INF, null ); + //model.read( "file:"+merged.getPath() ); + //model.loadImports(); try { + merged = new File( "results/alignment.rdf" ); + InputStream in = new FileInputStream( merged ); + //OntModelSpec.OWL_MEM_RDFS_INF or no arguments to see the difference... + model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_RDFS_INF,null); + model.read( in, "file:"+merged.getPath() ); + in.close(); + model.loadImports(); + + /* // Not better InputStream in = com.hp.hpl.jena.util.FileManager.get().open( merged.getPath() ); model = ModelFactory.createOntologyModel( OntModelSpec.OWL_DL_MEM_RULE_INF, null ); @@ -467,7 +475,9 @@ public class MyApp { model = ModelFactory.createOntologyModel( s ); model.read( FileManager.get().open( merged.getPath() ), "file:"+merged.getPath() ); System.out.println( "NB Modles= "+model.countSubModels()+" ~~ "+model.hasLoadedImport( "http://alignapi.gforge.inria.fr/tutorial/tutorial4/ontology1.owl" )); + in.close(); model.loadImports(); + */ OntClass cl = model.getOntClass( "http://alignapi.gforge.inria.fr/tutorial/tutorial4/ontology1.owl#Estudiante" ) ; if ( cl != null ) { @@ -479,13 +489,11 @@ public class MyApp { } else { System.err.println( "Cannot find class" ); } - in.close(); } catch (FileNotFoundException fnfe) { fnfe.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } - */ displayQueryAnswer( model, QueryFactory.read( "file:query.sparql" ) );