I want to import and list semantic web (owl) file's classes into the eclipse. I did import pellet and protege library my eclipse program but still I see force close my android project. nothing red line or wrong code because I used same codes in netbeans. my codes is below..

    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");
        }
    }

I have mistake this code segment

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");

asked 17 Jan '13, 04:29

freemat3's gravatar image

freemat3
11
accept rate: 0%

edited 17 Jan '13, 17:12

Jeen%20Broekstra's gravatar image

Jeen Broekstra ♦
11.6k412

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×617
×176
×19
×6

question asked: 17 Jan '13, 04:29

question was seen: 1,317 times

last updated: 17 Jan '13, 17:12