1
我想導入並列出eclipse中的語義web(owl)文件的類。我沒有導入小球和保護庫我的eclipse程序,但仍然看到強制關閉我的android項目。沒有紅線或錯誤的代碼,因爲我在net beans中使用了相同的代碼。我的代碼低於..如何將貓頭鷹類導入eclipse
public static final IRI localLocation_IRI = IRI.create("file:c:///rdfex.owl");
public static final IRI Ont_Base_IRI = IRI.create("http://www.emkarhafriyat.com/owlex.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"));
// Now create the axiom
OWLAxiom ax1 = f.getOWLSubClassOfAxiom(clsA, clsB);
// add the axiom to the ontology.
AddAxiom addAxiom1 = new AddAxiom(o, ax1);
// We now use the manager to apply the change
m.applyChange(addAxiom1);
// print all classes
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");
}
}
我有錯誤,該代碼段
public static final IRI localLocation_IRI = IRI.create("file:c:///rdfex.owl");
public static final IRI Ont_Base_IRI = IRI.create("http://www.emkarhafriyat.com/owlex.owl");
感謝您的回答,但我沒有做任何本地路徑,也沒有URL。本地路徑應該是電話路徑? – freemat3
是的,我想你可以使用電話路徑(本地路徑)來導入它。 – loopasam