I know this question was asked earlier but there is no proper solution anywhere right now so i am going to ask it again. How can i load an owl file in my android project?
The code works in java but they are useless in android . When i try them in an android project then the file can not be accesed . I am using OWLApi 3.4.10. I am loading the ontology from my mainActivity class. The loading is performed in loadOntology method in OntologyClass class. In main method the coding is as
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ontologyClass ontology;
ontology = new ontologyClass();
try {
ontology.ontologyLoad();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The coding of ontologyClass is as:
@Ignore
@SuppressWarnings("javadoc")
public class ontologyClass {
OWLOntology pizza;
OWLOntologyManager manager;
public ontologyClass ontologyLoad() throws OWLOntologyCreationException {
manager= OWLManager.createOWLOntologyManager();
File file= new File("assets/Pizza.owl");
pizza = manager.loadOntologyFromOntologyDocument(file);
return this;
}
The pizza.owl file is inside the assets folder. In logcat i receive warnings like
FileNotFountException: /assets/Pizza.owl: open failed:ENOENT (no such file or directory)
can anyone fix this file loading problem?
Thanks