0

I could add OWL API in my netbeans library now i want to make connection with proteje and be able to read owl file in my local computer. do u have some source sample code related to it?

thx

1 Answers1

0

A simple example is something like this:

    OWLOntologyDocumentSource source = new FileDocumentSource(new File("ontology.owl"));
    OWLOntology o = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument(source);

For more examples check out the OWLAPI wiki

Ignazio
  • 10,504
  • 1
  • 14
  • 25
  • hi-- can you make it more clear for me? please. I downaloded OWL API and I included to my netbeans library . so now I have OWL API . where should is put this code? is should be in the sertain class? – Mehdi Tarabi Apr 13 '17 at 19:17
  • You need to put the local path for your file in place of "ontology.owl". Have you checked out the examples linked in my response? https://github.com/owlcs/owlapi/blob/version4/contract/src/test/java/org/semanticweb/owlapi/examples/Examples.java should give you plenty of context on how ontology loading works. – Ignazio Apr 25 '17 at 04:27
  • yes I was browsing on that page but too much information it cause confusion . – Mehdi Tarabi Apr 27 '17 at 20:36
  • dear ignazio can you help me. .I have ontology and it has a class . the name of class is good_food and inside this class I have 3 instances . only i I need to know how to show this instances on my web page . this is critical for me .I m working with netbeans – Mehdi Tarabi May 15 '17 at 02:08
  • I wrote java with netbeans . UI is jsp pages and servelet is bridge between database and UI .I have one OWL file that I created with protege and I need to show instances on one of my classes(Good_food) in that owl file ON my UI . – Mehdi Tarabi May 15 '17 at 14:37
  • THIS IS MY EMAIL TARABI419@GMAIL.COM... If you send email to me i will send my all files to you if needed – Mehdi Tarabi May 15 '17 at 14:40
  • I already coded all SQL section and every thing is working good with my static part of project . THE ONLY PART is this OWL . my thesis is depends on to finish this project , please help me to finish it. thx – Mehdi Tarabi May 15 '17 at 15:06
  • i only have one week to finish this owl section – Mehdi Tarabi May 15 '17 at 15:24
  • I've contacted you on researchgate – Ignazio May 15 '17 at 18:54
  • HI-THX. I replayed for you – Mehdi Tarabi May 16 '17 at 13:49