Simple program has error

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Simple program has error

k6509090
Hi,everyone
My program has error.Please help me. Thanks!
This is Protege-Owl API's sample program.
the error message is
at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
I don't know why do I have the error.
 
Program code:
import edu.stanford.smi.protegex.owl.model.*;
//OWLModel;
import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
import edu.stanford.smi.protegex.owl.*;
//ProtegeOWL;
import java.util.*;
import edu.stanford.smi.protege.plugin.*;
import java.net.*;
import java.lang.*;
import sun.misc.*;
import java.awt.*;
 
public class owl3 {
 
 /**
  * @param args
  */
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  OWLModel owlM3 = ProtegeOWL.createJenaOWLModel();
  OWLNamedClass personClass = owlM3.createOWLNamedClass("Person");
     OWLNamedClass manClass = owlM3.createOWLNamedSubclass("Man", personClass);
     OWLNamedClass womanClass = owlM3.createOWLNamedSubclass("Woman", personClass);
 
     // Create expression  (PersonClass & !(Man | Woman))
     OWLUnionClass unionClass = owlM3.createOWLUnionClass();
     unionClass.addOperand(manClass);
     unionClass.addOperand(womanClass);
     OWLComplementClass complementClass = owlM3.createOWLComplementClass(unionClass);
     OWLIntersectionClass intersectionClass = owlM3.createOWLIntersectionClass();
     intersectionClass.addOperand(personClass);
     intersectionClass.addOperand(complementClass);
 
     OWLNamedClass kidClass = owlM3.createOWLNamedClass("Kid");
     kidClass.addSuperclass(intersectionClass);
    owlM3.createRDFSClassFromExpression("Person & !(Man | Woman)");
    
     String parsable = intersectionClass.getParsableExpression();
     System.out.println("Expression: " + parsable);
 
    RDFSClass c = owlM3.createRDFSClassFromExpression("!(" + parsable + ")");
     System.out.println("New expression: " + c.getParsableExpression());
 }
 
}
Reply | Threaded
Open this post in threaded view
|

Re: Simple program has error

Nick Drummond
Hi k650...

1) Please provide a full stacktrace - I cannot debug from a single error
line
2) Where have you found the syntax you are using in the
createRDFSClassFromExpression() calls? If you have the manchester syntax
turned on (by default it is) expressions should be of the form described
in [1].
3) I'm not sure what you are trying to do with the getParsableExpression
- you can clone classes using the ResourceCopier visitor.

Nick

[1] http://www.co-ode.org/resources/reference/manchester_syntax/

[hidden email] wrote:

> Hi,everyone
> My program has error.Please help me. Thanks!
> This is Protege-Owl API's sample program.
> the error message is
> at
> edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
> I don't know why do I have the error.
> Program code:
> import edu.stanford.smi.protegex.owl.model.*;
> //OWLModel;
> import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
> import edu.stanford.smi.protegex.owl.*;
> //ProtegeOWL;
> import java.util.*;
> import edu.stanford.smi.protege.plugin.*;
> import java.net.*;
> import java.lang.*;
> import sun.misc.*;
> import java.awt.*;
> public class owl3 {
> /**
> * @param args
> */
> public static void main(String[] args) {
> // TODO Auto-generated method stub
> OWLModel owlM3 = ProtegeOWL.createJenaOWLModel();
> OWLNamedClass personClass = owlM3.createOWLNamedClass("Person");
> OWLNamedClass manClass = owlM3.createOWLNamedSubclass("Man", personClass);
> OWLNamedClass womanClass = owlM3.createOWLNamedSubclass("Woman",
> personClass);
> // Create expression (PersonClass & !(Man | Woman))
> OWLUnionClass unionClass = owlM3.createOWLUnionClass();
> unionClass.addOperand(manClass);
> unionClass.addOperand(womanClass);
> OWLComplementClass complementClass =
> owlM3.createOWLComplementClass(unionClass);
> OWLIntersectionClass intersectionClass =
> owlM3.createOWLIntersectionClass();
> intersectionClass.addOperand(personClass);
> intersectionClass.addOperand(complementClass);
> OWLNamedClass kidClass = owlM3.createOWLNamedClass("Kid");
> kidClass.addSuperclass(intersectionClass);
> owlM3.createRDFSClassFromExpression("Person & !(Man | Woman)");
>
> String parsable = intersectionClass.getParsableExpression();
> System.out.println("Expression: " + parsable);
> RDFSClass c = owlM3.createRDFSClassFromExpression("!(" + parsable + ")");
> System.out.println("New expression: " + c.getParsableExpression());
> }
> }

--

Nick Drummond

http://www.cs.man.ac.uk/~drummond/ <http://www.cs.man.ac.uk/%7Edrummond/>
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

Re: Simple program has error

k6509090
Hi,Nick..
Could you tell me what's stacktrace?
Thank you!
----- Original Message -----
From: "Nick Drummond" <[hidden email]>
To: <[hidden email]>
Sent: Monday, April 10, 2006 6:09 PM
Subject: [protege-owl] Re: Simple program has error


> Hi k650...
>
> 1) Please provide a full stacktrace - I cannot debug from a single error
> line
> 2) Where have you found the syntax you are using in the
> createRDFSClassFromExpression() calls? If you have the manchester syntax
> turned on (by default it is) expressions should be of the form described
> in [1].
> 3) I'm not sure what you are trying to do with the getParsableExpression
> - you can clone classes using the ResourceCopier visitor.
>
> Nick
>
> [1] http://www.co-ode.org/resources/reference/manchester_syntax/
>
> [hidden email] wrote:
>> Hi,everyone
>> My program has error.Please help me. Thanks!
>> This is Protege-Owl API's sample program.
>> the error message is
>> at
>> edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
>> I don't know why do I have the error.
>> Program code:
>> import edu.stanford.smi.protegex.owl.model.*;
>> //OWLModel;
>> import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
>> import edu.stanford.smi.protegex.owl.*;
>> //ProtegeOWL;
>> import java.util.*;
>> import edu.stanford.smi.protege.plugin.*;
>> import java.net.*;
>> import java.lang.*;
>> import sun.misc.*;
>> import java.awt.*;
>> public class owl3 {
>> /**
>> * @param args
>> */
>> public static void main(String[] args) {
>> // TODO Auto-generated method stub
>> OWLModel owlM3 = ProtegeOWL.createJenaOWLModel();
>> OWLNamedClass personClass = owlM3.createOWLNamedClass("Person");
>> OWLNamedClass manClass = owlM3.createOWLNamedSubclass("Man",
>> personClass);
>> OWLNamedClass womanClass = owlM3.createOWLNamedSubclass("Woman",
>> personClass);
>> // Create expression (PersonClass & !(Man | Woman))
>> OWLUnionClass unionClass = owlM3.createOWLUnionClass();
>> unionClass.addOperand(manClass);
>> unionClass.addOperand(womanClass);
>> OWLComplementClass complementClass =
>> owlM3.createOWLComplementClass(unionClass);
>> OWLIntersectionClass intersectionClass =
>> owlM3.createOWLIntersectionClass();
>> intersectionClass.addOperand(personClass);
>> intersectionClass.addOperand(complementClass);
>> OWLNamedClass kidClass = owlM3.createOWLNamedClass("Kid");
>> kidClass.addSuperclass(intersectionClass);
>> owlM3.createRDFSClassFromExpression("Person & !(Man | Woman)");
>>
>> String parsable = intersectionClass.getParsableExpression();
>> System.out.println("Expression: " + parsable);
>> RDFSClass c = owlM3.createRDFSClassFromExpression("!(" + parsable + ")");
>> System.out.println("New expression: " + c.getParsableExpression());
>> }
>> }
>
> --
>
> Nick Drummond
>
> http://www.cs.man.ac.uk/~drummond/ <http://www.cs.man.ac.uk/%7Edrummond/>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

Re: Simple program has error

Nick Drummond
k6509090,

If protege has problems, often a series of messages are printed out on
the console window.
This is useful in debugging as we can often find out where the error
came from.
You provided the first line, but it is best if we have the whole thing.

Nick

[hidden email] wrote:

> Hi,Nick..
> Could you tell me what's stacktrace?
> Thank you!
> ----- Original Message ----- From: "Nick Drummond"
> <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, April 10, 2006 6:09 PM
> Subject: [protege-owl] Re: Simple program has error
>
>
>> Hi k650...
>>
>> 1) Please provide a full stacktrace - I cannot debug from a single error
>> line
>> 2) Where have you found the syntax you are using in the
>> createRDFSClassFromExpression() calls? If you have the manchester syntax
>> turned on (by default it is) expressions should be of the form described
>> in [1].
>> 3) I'm not sure what you are trying to do with the getParsableExpression
>> - you can clone classes using the ResourceCopier visitor.
>>
>> Nick
>>
>> [1] http://www.co-ode.org/resources/reference/manchester_syntax/
>>
>> [hidden email] wrote:
>>> Hi,everyone
>>> My program has error.Please help me. Thanks!
>>> This is Protege-Owl API's sample program.
>>> the error message is
>>> at
>>> edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
>>>
>>> I don't know why do I have the error.
>>> Program code:
>>> import edu.stanford.smi.protegex.owl.model.*;
>>> //OWLModel;
>>> import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
>>> import edu.stanford.smi.protegex.owl.*;
>>> //ProtegeOWL;
>>> import java.util.*;
>>> import edu.stanford.smi.protege.plugin.*;
>>> import java.net.*;
>>> import java.lang.*;
>>> import sun.misc.*;
>>> import java.awt.*;
>>> public class owl3 {
>>> /**
>>> * @param args
>>> */
>>> public static void main(String[] args) {
>>> // TODO Auto-generated method stub
>>> OWLModel owlM3 = ProtegeOWL.createJenaOWLModel();
>>> OWLNamedClass personClass = owlM3.createOWLNamedClass("Person");
>>> OWLNamedClass manClass = owlM3.createOWLNamedSubclass("Man",
>>> personClass);
>>> OWLNamedClass womanClass = owlM3.createOWLNamedSubclass("Woman",
>>> personClass);
>>> // Create expression (PersonClass & !(Man | Woman))
>>> OWLUnionClass unionClass = owlM3.createOWLUnionClass();
>>> unionClass.addOperand(manClass);
>>> unionClass.addOperand(womanClass);
>>> OWLComplementClass complementClass =
>>> owlM3.createOWLComplementClass(unionClass);
>>> OWLIntersectionClass intersectionClass =
>>> owlM3.createOWLIntersectionClass();
>>> intersectionClass.addOperand(personClass);
>>> intersectionClass.addOperand(complementClass);
>>> OWLNamedClass kidClass = owlM3.createOWLNamedClass("Kid");
>>> kidClass.addSuperclass(intersectionClass);
>>> owlM3.createRDFSClassFromExpression("Person & !(Man | Woman)");
>>>
>>> String parsable = intersectionClass.getParsableExpression();
>>> System.out.println("Expression: " + parsable);
>>> RDFSClass c = owlM3.createRDFSClassFromExpression("!(" + parsable +
>>> ")");
>>> System.out.println("New expression: " + c.getParsableExpression());
>>> }
>>> }
>>
>> --
>>
>> Nick Drummond
>>
>> http://www.cs.man.ac.uk/~drummond/
>> <http://www.cs.man.ac.uk/%7Edrummond/>
>> -------------------------------------------------------------------------
>>
>> To unsubscribe go to
>> http://protege.stanford.edu/community/subscribe.html
>>
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
>

--

Nick Drummond

http://www.cs.man.ac.uk/~drummond/ <http://www.cs.man.ac.uk/%7Edrummond/>
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

回覆: [protege-owl] Re: Simple program has error

chuang grace
Hi!Nick..
I understand it.
the error message is
CONFIG: Protege 3.1.1 Build 216, JVM 1.5.0_05-b05, memory=66M, Windows XP, encoding=UTF-8, language=zh, country=TW
WARNING: Plugins directory not found: D:\workspace\test2\plugins -- PluginUtilities.findPluginsDirectory()
at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturessSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
Thank you !

Nick Drummond <[hidden email]> 說:
k6509090,

If protege has problems, often a series of messages are printed out on
the console window.
This is useful in debugging as we can often find out where the error
came from.
You provided the first line, but it is best if we have the whole thing.

Nick

[hidden email] wrote:

> Hi,Nick..
> Could you tell me what's stacktrace?
> Thank you!
> ----- Original Message ----- From: "Nick Drummond"
>
> To:
> Sent: Monday, April 10, 2006 6:09 PM
> Subject: [protege-owl] Re: Simple program has error
>
>
>> Hi k650...
>>
>> 1) Please provide a full stacktrace - I cannot debug from a single error
>> line
>> 2) Where have you found the syntax you are using in the
>> createRDFSClassFromExpression() calls? If you have the manchester syntax
>> turned on (by default it is) expressions should be of the form described
>> in [1].
>> 3) I'm not sure what you are trying to do with the getParsableExpression
>> - you can clone classes using the ResourceCopier visitor.
>>
>> Nick
>>
>> [1] http://www.co-ode.org/resources/reference/manchester_syntax/
>>
>> [hidden email] wrote:
>>> Hi,everyone
>>> My program has error.Please help me. Thanks!
>>> This is Protege-Owl API's sample program.
>>> the error message is
>>> at
>>> edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
>>>
>>> I don't know why do I have the error.
>>> Program code:
>>> import edu.stanford.smi.protegex.owl.model.*;
>>> //OWLModel;
>>> import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
>>> import edu.stanford.smi.protegex.owl.*;
>>> //ProtegeOWL;
>>> import java.util.*;
>>> import edu.stanford.smi.protege.plugin.*;
>>> import java.net.*;
>>> import java.lang.*;
>>> import sun.misc.*;
>>> import java.awt.*;
>>> public class owl3 {
>>> /**
>>> * @param args
>>> */
>>> public static void main(String[] args) {
>>> // TODO Auto-generated method stub
>>> OWLModel owlM3 = ProtegeOWL.createJenaOWLModel();
>>> OWLNamedClass personClass = owlM3.createOWLNamedClass("Person");
>>> OWLNamedClass manClass = owlM3.createOWLNamedSubclass("Man",
>>> personClass);
>>> OWLNamedClass womanClass = owlM3.createOWLNamedSubclass("Woman",
>>> personClass);
>>> // Create expression (PersonClass & !(Man | Woman))
>>> OWLUnionClass unionClass = owlM3.createOWLUnionClass();
>>> unionClass.addOperand(manClass);
>>> unionClass.addOperand(womanClass);
>>> OWLComplementClass complementClass =
>>> owlM3.createOWLComplementClass(unionClass);
>>> OWLIntersectionClass intersectionClass =
>>> owlM3.createOWLIntersectionClass();
>>> intersectionClass.addOperand(personClass);
>>> intersectionClass.addOperand(complementClass);
>>> OWLNamedClass kidClass = owlM3.createOWLNamedClass("Kid");
>>> kidClass.addSuperclass(intersectionClass);
>>> owlM3.createRDFSClassFromExpression("Person & !(Man | Woman)");
>>>
>>> String parsable = intersectionClass.getParsableExpression();
>>> System.out.println("Expression: " + parsable);
>>> RDFSClass c = owlM3.createRDFSClassFromExpression("!(" + parsable +
>>> ")");
>>> System.out.println("New expression: " + c.getParsableExpression());
>>> }
>>> }
>>
>> --
>>
>> Nick Drummond
>>
>> http://www.cs.man.ac.uk/~drummond/
>>
>> -------------------------------------------------------------------------
>>
>> To unsubscribe go to
>> http://protege.stanford.edu/community/subscribe.html
>>
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanfordd.edu/community/subscribe.html
>
>

--

Nick Drummond

http://www.cs.man.ac.uk/~drummond/
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html


___________________________________________________ 最新版 Yahoo!奇摩即時通訊 7.0,免費網路電話任你打! http://messenger.yahoo.com.tw/

Reply | Threaded
Open this post in threaded view
|

Re: 回覆: [protege-owl] Re: Simple program has error

Steve Wartik
Is D:\workspace\test2 the directory in which you are executing your program?

Protege expects the property "protege.dir" to be set to the directory in which Protege is installed. Since you are running version 3.1.1, you probably installed Protege in C:\Program Files\Protege 3.1.1. That folder should contain a folder named "plugins".

When you run your application, use the flag:

java "-Dprotege.dir=C:\Program Files\Protege 3.1.1"

That should solve your problem.

Good luck!


chuang grace wrote:
Hi!Nick..
I understand it.
the error message is
CONFIG: Protege 3.1.1 Build 216, JVM 1.5.0_05-b05, memory=66M, Windows XP, encoding=UTF-8, language=zh, country=TW
WARNING: Plugins directory not found: D:\workspace\test2\plugins -- PluginUtilities.findPluginsDirectory()
at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
Thank you !

Nick Drummond [hidden email] 說:
k6509090,

If protege has problems, often a series of messages are printed out on
the console window.
This is useful in debugging as we can often find out where the error
came from.
You provided the first line, but it is best if we have the whole thing.

Nick

[hidden email] wrote:
> Hi,Nick..
> Could you tell me what's stacktrace?
> Thank you!
> ----- Original Message ----- From: "Nick Drummond"
>
> To:
> Sent: Monday, April 10, 2006 6:09 PM
> Subject: [protege-owl] Re: Simple program has error
>
>
>> Hi k650...
>>
>> 1) Please provide a full stacktrace - I cannot debug from a single error
>> line
>> 2) Where have you found the syntax you are using in the
>> createRDFSClassFromExpression() calls? If you have the manchester syntax
>> turned on (by default it is) expressions should be of the form described
>> in [1].
>> 3) I'm not sure what you are trying to do with the getParsableExpression
>> - you can clone classes using the ResourceCopier visitor.
>>
>> Nick
>>
>> [1] http://www.co-ode.org/resources/reference/manchester_syntax/
>>
>> [hidden email] wrote:
>>> Hi,everyone
>>> My program has error.Please help me. Thanks!
>>> This is Protege-Owl API's sample program.
>>> the error message is
>>> at
>>> edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
>>>
>>> I don't know why do I have the error.
>>> Program code:
>>> import edu.stanford.smi.protegex.owl.model.*;
>>> //OWLModel;
>>> import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
>>> import edu.stanford.smi.protegex.owl.*;
>>> //ProtegeOWL;
>>> import java.util.*;
>>> import edu.stanford.smi.protege.plugin.*;
>>> import java.net.*;
>>> import java.lang.*;
>>> import sun.misc.*;
>>> import java.awt.*;
>>> public class owl3 {
>>> /**
>>> * @param args
>>> */
>>> public static void main(String[] args) {
>>> // TODO Auto-generated method stub
>>> OWLModel owlM3 = ProtegeOWL.createJenaOWLModel();
>>> OWLNamedClass personClass = owlM3.createOWLNamedClass("Person");
>>> OWLNamedClass manClass = owlM3.createOWLNamedSubclass("Man",
>>> personClass);
>>> OWLNamedClass womanClass = owlM3.createOWLNamedSubclass("Woman",
>>> personClass);
>>> // Create expression (PersonClass & !(Man | Woman))
>>> OWLUnionClass unionClass = owlM3.createOWLUnionClass();
>>> unionClass.addOperand(manClass);
>>> unionClass.addOperand(womanClass);
>>> OWLComplementClass complementClass =
>>> owlM3.createOWLComplementClass(unionClass);
>>> OWLIntersectionClass intersectionClass =
>>> owlM3.createOWLIntersectionClass();
>>> intersectionClass.addOperand(personClass);
>>> intersectionClass.addOperand(complementClass);
>>> OWLNamedClass kidClass = owlM3.createOWLNamedClass("Kid");
>>> kidClass.addSuperclass(intersectionClass);
>>> owlM3.createRDFSClassFromExpression("Person & !(Man | Woman)");
>>>
>>> String parsable = intersectionClass.getParsableExpression();
>>> System.out.println("Expression: " + parsable);
>>> RDFSClass c = owlM3.createRDFSClassFromExpression("!(" + parsable +
>>> ")");
>>> System.out.println("New expression: " + c.getParsableExpression());
>>> }
>>> }
>>
>> --
>>
>> Nick Drummond
>>
>> http://www.cs.man.ac.uk/~drummond/
>>
>> -------------------------------------------------------------------------
>>
>> To unsubscribe go to
>> http://protege.stanford.edu/community/subscribe.html
>>
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
>

--

Nick Drummond

http://www.cs.man.ac.uk/~drummond/
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html


___________________________________________________ 最新版 Yahoo!奇摩即時通訊 7.0,免費網路電話任你打! http://messenger.yahoo.com.tw/


Reply | Threaded
Open this post in threaded view
|

回覆: [protege-owl] Re: 回覆: [protege-owl] Re: Simple program has error

chuang grace
Steven
thanks
But I dont' know how do I do?
I am a new java program user, I use Eclipse write java code.
if I complier on command model,how do I do?


Steven Wartik <[hidden email]> 說:
Is D:\workspace\test2 the directory in which you are executing your program?

Protege expects the property "protege.dir" to be set to the directory in which Protege is installed. Since you are running version 3.1.1, you probably installed Protege in C:\Program Files\Protege 3.1.1. That folder should contain a folder named "plugins".

When you run your application, use the flag:

java "-Dprotege.dir=C:\Program Files\Protege 3.1.1"

That should solve your problem.

Good luck!


chuang grace wrote:
Hi!Nick..
I understand it.
the error message is
CONFIG: Protege 3.1.1 Build 216, JVM 1.5.0_05-b05, memory=66M, Windows XP, encoding=UTF-8, language=zh, country=TW
WARNING: Plugins directory not found: D:\workspace\test2\plugins -- PluginUtilities.findPluginsDirectory()
at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturessSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
 at edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
Thank you !

Nick Drummond [hidden email] 說:
k6509090,

If protege has problems, often a series of messages are printed out on
the console window.
This is useful in debugging as we can often find out where the error
came from.
You provided the first line, but it is best if we have the whole thing.

Nick

[hidden email] wrote:

> Hi,Nick..
> Could you tell me what's stacktrace?
> Thank you!
> ----- Original Message ----- From: "Nick Drummond"
>
> To:
> Sent: Monday, April 10, 2006 6:09 PM
> Subject: [protege-owl] Re: Simple program has error
>
>
>> Hi k650...
>>
>> 1) Please provide a full stacktrace - I cannot debug from a single error
>> line
>> 2) Where have you found the syntax you are using in the
>> createRDFSClassFromExpression() calls? If you have the manchester syntax
>> turned on (by default it is) expressions should be of the form described
>> in [1].
>> 3) I'm not sure what you are trying to do with the getParsableExpression
>> - you can clone classes using the ResourceCopier visitor.
>>
>> Nick
>>
>> [1] http://www.co-ode.org/resources/reference/manchester_syntax/
>>
>> [hidden email] wrote:
>>> Hi,everyone
>>> My program has error.Please help me. Thanks!
>>> This is Protege-Owl API's sample program.
>>> the error message is
>>> at
>>> edu.stanford.smi.protegex.owl.ui.profiles.ProfilesManager.getFeaturesSet(ProfilesManager.java:164)
>>>
>>> I don't know why do I have the error.
>>> Program code:
>>> import edu.stanford.smi.protegex.owl.model.*;
>>> //OWLModel;
>>> import edu.stanford.smi.protegex.owl.model.OWLNamedClass;
>>> import edu.stanford.smi.protegex.owl.*;
>>> //ProtegeOWL;
>>> import java.util.*;
>>> import edu.stanford.smi.protege.plugin.*;
>>> import java.net.*;
>>> import java.lang.*;
>>> import sun.misc.*;
>>> import java.awt.*;
>>> public class owl3 {
>>> /**
>>> * @param args
>>> */
>>> public static void main(String[] args) {
>>> // TODO Auto-generated method stub
>>> OWLModel owlM3 = ProtegeOWL.createJenaOWLModel();
>>> OWLNamedClass personClass = owlM3.createOWLNamedClass("Person");
>>> OWLNamedClass manClass = owlM3.createOWLNamedSubclass("Man",
>>> personClass);
>>> OWLNamedClass womanClass = owlM3.createOWLNamedSubclass("Woman",
>>> personClass);
>>> // Create expression (PersonClass & !(Man | Woman))
>>> OWLUnionClass unionClass = owlM3.createOWLUnionClass();
>>> unionClass.addOperand(manClass);
>>> unionClass.addOperand(womanClass);
>>> OWLComplementClass complementClass =
>>> owlM3.createOWLComplementClass(unionClass);
>>> OWLIntersectionClass intersectionClass =
>>> owlM3.createOWLIntersectionClass();
>>> intersectionClass.addOperand(personClass);
>>> intersectionClass.addOperand(complementClass);
>>> OWLNamedClass kidClass = owlM3.createOWLNamedClass("Kid");
>>> kidClass.addSuperclass(intersectionClass);
>>> owlM3.createRDFSClassFromExpression("Person & !(Man | Woman)");
>>>
>>> String parsable = intersectionClass.getParsableExpression();
>>> System.out.println("Expression: " + parsable);
>>> RDFSClass c = owlM3.createRDFSClassFromExpression("!(" + parsable +
>>> ")");
>>> System.out.println("New expression: " + c.getParsableExpression());
>>> }
>>> }
>>
>> --
>>
>> Nick Drummond
>>
>> http://www.cs.man.ac.uk/~drummond/
>>
>> -------------------------------------------------------------------------
>>
>> To unsubscribe go to
>;> http://protege.stanford.edu/community/subscribe.html
>>
>
> -------------------------------------------------------------------------
> To unsubscribe go to http://protege.stanford.edu/community/subscribe.html
>
>

--

Nick Drummond

http://www.cs.man.ac.uk/~drummond/
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html


___________________________________________________ 最新版 Yahoo!奇摩即時通訊 7.0,免費網路電話任你打! http://messenger.yahoo.com.tw/


___________________________________________________ 最新版 Yahoo!奇摩即時通訊 7.0,免費網路電話任你打! http://messenger.yahoo.com.tw/

Reply | Threaded
Open this post in threaded view
|

Re: 回覆Simple program has error

Steve Wartik
Grace,

If you are using Eclipse, then I recommend a different approach. You should set the protege.dir property by invoking Java's setProperty method. Put the call somewhere in main(), before you invoke any methods in the Protege library. The following should work (of course, you need to check that the path to Protege is correct for your computer):

public static void main(String args[]) {
    System.setProperty("protege.dir", "C:\\Program Files\\Protege 3.1.1");
    // followed by the rest of your application


See http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#setProperty(java.lang.String,%20java.lang.String)
for a description of what this method does.

Steve Wartik

chuang grace wrote:
Steven
thanks
But I dont' know how do I do?
I am a new java program user, I use Eclipse write java code.
if I complier on command model,how do I do?


Steven Wartik [hidden email] 說:
Is D:\workspace\test2 the directory in which you are executing your program?

Protege expects the property "protege.dir" to be set to the directory in which Protege is installed. Since you are running version 3.1.1, you probably installed Protege in C:\Program Files\Protege 3.1.1. That folder should contain a folder named "plugins".

When you run your application, use the flag:

java "-Dprotege.dir=C:\Program Files\Protege 3.1.1"

That should solve your problem.

Good luck!



Reply | Threaded
Open this post in threaded view
|

Re: [protege-owl] Re: 回覆Simple program has error

k6509090

Hi!Steven..
I use your method,but it has many warning.
 
CONFIG: Protege 3.1.1 Build 216, JVM 1.5.0_05-b05, memory=66M, Windows XP, encoding=UTF-8, language=zh, country=TW
CONFIG: Loaded plugin org.algernon - Algernon
CONFIG: Loaded plugin edu.washington.datagenie
CONFIG: Loaded plugin edu.stanford.smi.protegex.pal_tabs - PAL Tabs
CONFIG: Loaded plugin edu.stanford.smi.protegex.ezpal - EZPal Tab
CONFIG: Loaded plugin edu.stanford.smi.protegex.facets_tab
CONFIG: Loaded plugin edu.stanford.smi.protegex.instance_tree
CONFIG: Loaded plugin edu.stanford.smi.protegex.owl - OWL Plugin
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.menu.OWLMenuProjectPlugin -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.SingleLiteralAreaWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.properties.types.OWLDatatypePropertyTypesWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.ResourceListWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.SingleLiteralWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.conditions.InferredConditionsWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.RDFPropertiesWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.SingleResourceWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.metadata.AnnotationsWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.metadata.OWLMetadataWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.database.CreateOWLDatabaseProjectPlugin -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.properties.types.RDFPropertyTypesWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.properties.OWLPropertiesTab -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.properties.range.OWLRangeWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.individuals.OWLIndividualsTab -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.properties.EquivalentPropertiesWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.cls.ClassTypeConverterWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.cls.OWLClassesTab -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.jena.JenaExportPlugin -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.metadata.RDFPropertyMetadataWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.swrl.ui.tab.SWRLTab -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.OWLFormWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.MultiResourceWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.MultiLiteralWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.swrl.ui.SWRLProjectPlugin -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.metadatatab.OWLMetadataTab -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.DataRangeFieldWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.properties.types.OWLObjectPropertyTypesWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.metadata.RDFSNamedClassMetadataWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.database.OWLDatabaseKnowledgeBaseFactory -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.metadatatab.OWLNamespacesWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.conditions.AssertedConditionsWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.conditions.ConditionsWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.jena.JenaKnowledgeBaseFactory -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.RDFSSubClassOfWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.properties.OWLInversePropertyWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.OWLDateTimeWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.OWLTimeWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.jena.OWLFilesCreateProjectPlugin -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.jena.importer.JenaImportPlugin -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.clsproperties.PropertyRestrictionsTreeWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.RDFListWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.metadatatab.NamespacesWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.cls.SwitchableClassDefinitionWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.ExternalResourceURLWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.metadatatab.alldifferent.AllDifferentWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.widget.OWLDateWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.properties.domain.OWLDomainWidget -- PluginUtilities.checkPlugin()
WARNING: Duplicate plugin: edu.stanford.smi.protegex.owl.ui.clsdesc.DisjointClassesWidget -- PluginUtilities.checkPlugin()
CONFIG: Loaded plugin ca.uvic.cs.chisel.jambalaya - Jambalaya
CONFIG: Loaded plugin JessTab - JessTab Plugin
CONFIG: Loaded plugin edu.stanford.smi.protege.script - Script Plugin
CONFIG: Loaded plugin dfki.protege.ontoviz
CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.owldoc
CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.owlviz
CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.protege.wizard - Basic Wizards
CONFIG: Loaded plugin uk.ac.man.cs.mig.coode.protege.wizard.owl - OWL Wizards
CONFIG: Loaded plugin edu.stanford.smi.protegex.prompt - PROMPT tab
CONFIG: Loaded plugin edu.stanford.smi.protegex.psm - PSM Librarian
<?xml version="1.0"?>
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns="http://www.owl-ontologies.com/unnamed.owl#"
  xml:base="http://www.owl-ontologies.com/unnamed.owl">
  <owl:Ontology rdf:about=""/>
  <owl:Class rdf:ID="�?"/>
  <owl:DatatypeProperty rdf:ID="年�??">
    <rdfs:domain rdf:resource="#�?"/>
    <rdfs:range rdf:resource="<A href='http://www.w3.org/2001/XMLSchema#int"/'>http://www.w3.org/2001/XMLSchema#int"/>
  </owl:DatatypeProperty>
  <�? rdf:ID="Holger">
    <年�?? rdf:datatype="<A href='http://www.w3.org/2001/XMLSchema#int">33http://www.w3.org/2001/XMLSchema#int">33</年�??>
  </�?>
</rdf:RDF>
CONFIG: Loaded plugin edu.stanford.smi.protegex.rdf_backend - RDF Backend
CONFIG: Loaded plugin edu.stanford.smi.protegex.standard_extensions - Graph Widget, Table Widget
CONFIG: Loaded plugin edu.stanford.smi.protege.stringsearch - String Search Tab
CONFIG: Loaded plugin uk.ac.ecs.iam.akt.tgviztab - TGVizTab
CONFIG: Loaded plugin edu.stanford.smi.protegex.umls_tab - UMLS Tab
CONFIG: Loaded plugin edu.stanford.smi.protegex.wordnet - WordNet Tab
CONFIG: Loaded plugin edu.stanford.smi.protegex.xml_tab - XML Tab
CONFIG: Loaded plugin ontolt
CONFIG: Loaded plugin owltest
CONFIG: Loaded plugin logs
----- Original Message -----
Sent: Thursday, April 13, 2006 2:37 AM
Subject: [protege-owl] Re: 回覆Simple program has error

Grace,

If you are using Eclipse, then I recommend a different approach. You should set the protege.dir property by invoking Java's setProperty method. Put the call somewhere in main(), before you invoke any methods in the Protege library. The following should work (of course, you need to check that the path to Protege is correct for your computer):

public static void main(String args[]) {
    System.setProperty("protege.dir", "C:\\Program Files\\Protege 3.1.1");
    // followed by the rest of your application


See http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#setProperty(java.lang.String,%20java.lang.String)
for a description of what this method does.

Steve Wartik

chuang grace wrote:
Steven
thanks
But I dont' know how do I do?
I am a new java program user, I use Eclipse write java code.
if I complier on command model,how do I do?


Steven Wartik [hidden email] 說:
Is D:\workspace\test2 the directory in which you are executing your program?

Protege expects the property "protege.dir" to be set to the directory in which Protege is installed. Since you are running version 3.1.1, you probably installed Protege in C:\Program Files\Protege 3.1.1. That folder should contain a folder named "plugins".

When you run your application, use the flag:

java "-Dprotege.dir=C:\Program Files\Protege 3.1.1"

That should solve your problem.

Good luck!