Wednesday, October 17, 2012
start reasoner in virtuoso
load Model from virtuoso
VirtGraph set = new VirtGraph(GraphIri, "jdbc:virtuoso://" + uriServer + ":"
+ portJDBC + "", db_user, db_pass);
System.out.println("Start inference!");
Reasoner reasoner = PelletReasonerFactory.theInstance().create();
reasoner = reasoner.bindSchema(set);
InfModel infModel = ModelFactory.createInfModel(reasoner, modelVirtuoso);
System.out.println("Stop inference!");
Model m2 = vd.getNamedModel(GraphIri);
save inference in virtuoso
System.out.print("instancias "+m2.size());
if(m2.containsAll(infModel)){ System.out.print("no hay inferencia ");
}else{ System.out.print("hay inferencia "); }
if(m2.containsAny(infModel)){ System.out.print("es correcto ");
}else{ System.out.print("es incorrecto "); }
Model inferido = infModel.difference(m2);
m2.add(inferido);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment