Search Mailing List Archives
[protege-discussion] Loading an Ontology
Peris Brodsky
perisbrodsky2011 at u.northwestern.edu
Tue Mar 23 17:34:17 PDT 2010
What statement causes this error? A stack trace would help.
-Peris
On Tue, Mar 23, 2010 at 7:27 PM, Qingmai Wang <qingmai.w at gmail.com> wrote:
> 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
> file","OWL");
>
> chooser.addChoosableFileFilter(filter);
>
> *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;
>
> System.*out*.printf(uri);
>
> JenaOWLModel *owlModel* = ProtegeOWL.*createJenaOWLModelFromURI*
> (uri);
>
> }
>
>
>
> The Eclipse returns the following errors:
>
> in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
> org/apache/commons/logging/LogFactory;
>
>
>
> I have try to define the String uri straightly as “String uri =
> "file:///D:/work/ProtegeDeveloper/travel-saved.owl";” , it remains same
> errors.
>
>
>
> 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 =
> "file:///D:/work/ProtegeDeveloper/travel-saved.owl";
>
> JenaOWLModel owlModel = ProtegeOWL.*createJenaOWLModelFromURI*
> (uri);
>
> }
>
>
>
> Thanks very much if anyone could help
>
>
>
> Best regards
>
>
>
> Qingmai
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20100323/0788dad2/attachment.html>
More information about the protege-discussion
mailing list