Search Mailing List Archives
[protege-discussion] Loading an Ontology
Jonathan Carter
jonathan.carter at e-asolutions.com
Tue Mar 23 16:46:43 PDT 2010
That looks like a classpath issue - the exception is reporting that it
can't find the commons logging LogFactory class.
Check to make sure you have the right commons logging JAR in your
classpath. I think it's Commons Logging version 1.1 that I've used
with developing my widgets.
Hope this helps
Regards
Jonathan
Sent from my mobile
On 23 Mar 2010, at 23:27, "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 = "fil
> e:///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/d35b7ecc/attachment.html>
More information about the protege-discussion
mailing list