java - Error when connect Android with ontology -
i want connect android owl file using code below, line
model = modelfactory.createontologymodel(ontmodelspec.owl_mem_trans_inf)
throws exception.
public class ontoquery { private model model; public ontoquery(string inputfilename) { model = modelfactory.createontologymodel(ontmodelspec.owl_mem_trans_inf); inputstream in = filemanager.get().open(inputfilename); if(in == null) { throw new illegalargumentexception("file: " + inputfilename + " not found"); } else { model.read(in, "rdf/xml"); } } public string executequery(string querystring) throws unsupportedencodingexception { query query = queryfactory.create(querystring); queryexecution qe = queryexecutionfactory.create(query, this.model); throwable var5 = null; string fieldvalue; try { resultset results = qe.execselect(); bytearrayoutputstream go = new bytearrayoutputstream(); resultsetformatter.out(go, results, query); fieldvalue = new string(go.tobytearray(), "utf-8"); } catch (throwable var15) { var5 = var15; throw var15; } { if(qe != null) { if(var5 != null) { try { qe.close(); } catch (throwable var14) { //var5.addsuppressed(var14); } } else { qe.close(); } } } return fieldvalue; } }
Comments
Post a Comment