I would like to have access to my ontology and SWRL rule through OWL API using Eclipse. Can anyone help with the exact procedure that can tell me what to do?
I have tried the following code but I do not seem to get any response from it. Please bear in mind that my Java skills are very poor.
I would need an exact procedure on how to go about and resolve this issue.
The code that I have already is:
public static void main(String[] args) {
File file = new File("file:c:/Users/DTN/Desktop/Final SubmissionFilteringMechanism_Ontology.owl");
OWLOntologyManager m = OWLManager.createOWLOntologyManager();
OWLDataFactory f = OWLManager.getOWLDataFactory();
OWLOntology o = null;
public void testAddAxioms() {
try {
o = m.loadOntologyFromOntologyDocument(Ont_Base_IRI);
OWLClass clsA = f.getOWLClass(IRI.create(Ont_Base_IRI + "ClassA"));
OWLClass clsB = f.getOWLClass(IRI.create(Ont_Base_IRI + "ClassB"));
OWLAxiom ax1 = f.getOWLSubClassOfAxiom(clsA, clsB);
AddAxiom addAxiom1 = new AddAxiom(o, ax1);
m.applyChange(addAxiom1);
for (OWLClass cls : o.getClassesInSignature()) {
EditText edit = (EditText) findViewById(R.id.editText1);
edit.setText((CharSequence) cls);
}
m.removeOntology(o);
} catch (Exception e) {
EditText edit = (EditText) findViewById(R.id.editText1);
edit.setText("Not successfull");
}
}
}