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-dev] Protege-API 3.5 - Help me please

Martin O'Connor martin at zippyrate.com
Wed Feb 26 22:09:00 PST 2014


An OWL reasoner will typically produce quite a few entailments. You should take a look at SQWRL [1] if you want to look for specific inferences.

Here is an example SQWRL query for your case:

Tourist(?x) ∧ hasAgeRank(?x, Age19-25) ∧ Waterfall(?a) →  sqwrl:select(?x, ?a)

Martin

[1] http://protege.cim3.net/cgi-bin/wiki.pl?SQWRL

On Feb 26, 2014, at 12:28 AM, Naruepon Panawong <jnaruepon.p at gmail.com> wrote:

> Dear Martin
> 
>        I write this rule (Tourist(?x) ∧ hasAgeRank(?x, Age19-25) ∧ Waterfall(?a) →  hasAttraction(?x, ?a)) in Protege Editor. I run jess and result (waterfall) show in tourist. but I use rule in program that return all data. (see also attachment file).
> 
> Thank you and Best Regards.
> Naruepon.p
> 
> 
> 2014-02-26 10:45 GMT+07:00 Martin O'Connor <martin at zippyrate.com>:
> 
> Sorry - I don’t understand. Can you show me what output you are getting (and what you are expecting).
> 
> Martin
> 
> On Feb 23, 2014, at 7:09 PM, Naruepon Panawong <jnaruepon.p at gmail.com> wrote:
> 
>> Thank you for your jar file (fixed) 
>> 
>> I still confuse about rule becase I write rule and Program show all Data in my Ontology.
>> I want to show Waterfall only. I test my rule in Protege Editor that it work.
>> 
>> Some code
>>                 OWLNamedClass touristClass = owlModel.getOWLNamedClass("Tourist"); 
>> 		OWLObjectProperty ageProperty = owlModel.getOWLObjectProperty("hasAgeRank"); 
>> 		
>> 		OWLIndividual individual1 = touristClass.createOWLIndividual("Naruepon.p");
>> 		individual1.setPropertyValue(ageProperty, "Age19-25");
>> 		
>> 		SWRLFactory factory = new SWRLFactory(owlModel);
>> 		factory.enableAll();
>> 		
>> 		SWRLImp imp = factory.createImp("Tourist(?x) ^ hasAgeRank(?x,Age19-25) ^ Waterfall(?a) -> hasAttraction(?x,?a)");
>> 		imp.enable();
>> 		
>> 		ruleEngine.infer();
>> 
>> Thank you and Best Regards.
>> Naruepon.p
>> 
>> 
>> 2014-02-23 11:43 GMT+07:00 Naruepon Panawong <jnaruepon.p at gmail.com>:
>> Thank you for your jar file (fixed) 
>> 
>> I still confuse about rule becase I write rule and Program show all Data in my Ontology.
>> I want to show Waterfall only. I test my rule in Protege Editor that it work.
>> 
>> Some code
>>                 OWLNamedClass touristClass = owlModel.getOWLNamedClass("Tourist"); 
>> 		OWLObjectProperty ageProperty = owlModel.getOWLObjectProperty("hasAgeRank"); 
>> 		
>> 		OWLIndividual individual1 = touristClass.createOWLIndividual("Naruepon.p");
>> 		individual1.setPropertyValue(ageProperty, "Age19-25");
>> 		
>> 		SWRLFactory factory = new SWRLFactory(owlModel);
>> 		factory.enableAll();
>> 		
>> 		SWRLImp imp = factory.createImp("Tourist(?x) ^ hasAgeRank(?x,Age19-25) ^ Waterfall(?a) -> hasAttraction(?x,?a)");
>> 		imp.enable();
>> 		
>> 		ruleEngine.infer();
>> 
>> Thank you and Best Regards.
>> Naruepon.p
>> 
>> 
>> 2014-02-23 3:22 GMT+07:00 Martin O'Connor <martin at zippyrate.com>:
>> 
>> 
>> I think this may be a bug. I enclose a JAR with a fix. Copy it to your Protege-OWL plugins directory (e.g., /Applications/Protege_3.5/plugins/edu.stanford.smi.protegex.owl) and restert Protege.
>> 
>> Let me know if this works.
>> 
>> Martin
>> 
>> 
>> 
>> 
>> _______________________________________________
>> protege-dev mailing list
>> protege-dev at lists.stanford.edu
>> https://mailman.stanford.edu/mailman/listinfo/protege-dev
> 
> 
> _______________________________________________
> protege-dev mailing list
> protege-dev at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-dev
> 
> 
> <exam.doc>_______________________________________________
> protege-dev mailing list
> protege-dev at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-dev/attachments/20140226/287b41e8/attachment.html>


More information about the protege-dev mailing list