Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] Loading an Ontology

Qingmai Wang qingmai.w at
Tue Mar 23 16:27:02 PDT 2010

Hi All,


I am new to protege and also new to this discussion list. I am just starting
to program an JAVA GUI to manage OWL ontology using protege jars. I meet
some problem when I try to load a ontology from a local file. Following is
the code, in which a JFileChooser is used to select the file .


private void OpenFile() throws OntologyLoadException{ 

      JFileChooser chooser = new JFileChooser();

      FileNameExtensionFilter filter = new FileNameExtensionFilter("OWL


      int result = chooser.showOpenDialog(this);

    if(result == JFileChooser.CANCEL_OPTION) return;

      File file = chooser.getSelectedFile();

      String path = file.getPath();

      path = path.replaceAll("\\\\", "/");

      String uri = "file:///" + path;


      JenaOWLModel owlModel = ProtegeOWL.createJenaOWLModelFromURI(uri);



The Eclipse returns the following errors:

in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:


I have try to define the String uri straightly as "String uri =
"file:///D:/work/ProtegeDeveloper/travel-saved.owl";" , it remains same


By the way, it is really confused because it works well when I try the
loading process in a independent normal java main class as following:


public static void main(String[] args) throws OntologyLoadException {

            String uri =

            JenaOWLModel owlModel =



Thanks very much if anyone could help


Best regards



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the protege-discussion mailing list