From: altaf h. <alt...@ya...> - 2013-09-18 16:15:09
|
Thank you Ignazio. Kind Regards, Altaf Hussain ________________________________ From: Ignazio Palmisano <ipa...@gm...> To: owl...@li... Sent: Tuesday, September 17, 2013 3:15 PM Subject: Re: [OWLAPI-developer] Finding Inferred Individuals of a Specific Class On 17 September 2013 18:29, altaf hussain <alt...@ya...> wrote: > Thanks for letting me know this Ignazio. Seems the best practice. > > One question though, how would I specify it the precomputeInferences() > should use a specific reasoner? > Sorry, I didn't explain myself properly. precomputeInferences is a method in the OWLReasoner interface, so each instance of a reasoner implementation has that method. As arguments to the method, one must pass the type of inference that should be computed - if in doubt, CLASS_HIERARCHY is a good one. HTH, I. > > Kind Regards, > > Altaf Hussain > > > ________________________________ > From: Ignazio Palmisano <ipa...@gm...> > To: altaf hussain <alt...@ya...>; > owl...@li... > Sent: Tuesday, September 17, 2013 2:18 PM > > Subject: Re: [OWLAPI-developer] Finding Inferred Individuals of a Specific > Class > > On 17 September 2013 18:13, altaf hussain <alt...@ya...> wrote: >> Hi Maryam, >> >> I believe, you haven't put all the related code snippet. Here is a example >> skeleton to get the inferred + direct individual of a class using Pellet >> reasoner and OWL API: >> >> PelletReasoner reasoner = >> PelletReasonerFactory.getInstance().createReasoner(passedOntology);//pass >> your ontology >> //Boolean consitant = reasoner.isConsistent(); >> reasoner.getKB().realize(); >> //reasoner.getKB().printClassTree(); >> >> OWLClass classA = >> manager.getOWLDataFactory().getOWLClass(IRI.create(baseOntologyURI + >> "#CLASSA")); >> NodeSet<OWLNamedIndividual> individuals = >> reasoner.getInstances(classA, false); >> >> It should return the Individuals. > > Yes this is correct, although you should be able to call > OWLReasoner.precomputeInferences() rather than the reasoner specific > realize() - under the hood the same operations will be carried out, > but your version will only work with Pellet, while > precomputeInferences() is supported by any of the reasoners that can > be used with the OWL API. > I. > >> >> HTH. >> >> Kind Regards, >> >> Altaf Hussain >> Graduate Student Researcher >> Centre for Logic and Information >> >> Graduate Student (CS) and Teaching Assistant >> St. Francis Xavier University >> >> Alumni' 02 Batch, Dept. of Computer Science and Engineering >> Shah Jalal University of Science and Technology >> >> Blog: http://altafhussainbd.wordpress.com >> >> >> ________________________________ >> From: maryam alipour <mar...@ya...> >> To: maryam alipour <mar...@ya...>; >> "owl...@li..." >> <owl...@li...> >> Sent: Tuesday, September 17, 2013 1:56 PM >> Subject: Re: [OWLAPI-developer] Finding Inferred Individuals of a Specific >> Class >> >> Hi, >> >> This is the method that I used to find inferred instances. It doesn't >> print >> anything for me although I can see inferred instances through Protege. >> Could >> you help me what should I do to make it works. The other question that I >> have is that the first time I open the ontology in Protege I need to run >> the >> reasoner to see the inferred instances. By using reasoner in OWL API would >> it be like running the reasoner in Protege or I need to run the reasoner >> by >> code first and then use the following code? >> >> Set<OWLNamedIndividual> corrected_instances = >> reasoner.getInstances(having_corrected_data_range,false).getFlattened(); >> System.out.println("Individuals of having_corrected_data_range: "); >> for (OWLNamedIndividual Cor_ind : corrected_instances) { >> System.out.println(" " + Cor_ind); >> } >> System.out.println("\n"); >> >> Thanks, >> Maryam >> >> ________________________________ >> From: maryam alipour <mar...@ya...> >> To: OWLAPIDeveloper <owl...@li...> >> Sent: Tuesday, September 17, 2013 11:42:32 AM >> Subject: [OWLAPI-developer] Finding Inferred Individuals of a Specific >> Class >> >> Hi, >> >> Which method I can use to find inferred individual of a specific class? >> >> Thanks, >> Maryam >> >> >> >> >> ------------------------------------------------------------------------------ >> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, >> SharePoint >> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack >> includes >> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> >> >> >> ------------------------------------------------------------------------------ >> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, >> SharePoint >> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack >> includes >> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> >> >> >> >> ------------------------------------------------------------------------------ >> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! >> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, >> SharePoint >> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack >> includes >> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. >> >> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Owlapi-developer mailing list >> Owl...@li... >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer >> > > ------------------------------------------------------------------------------ LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99! 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk _______________________________________________ Owlapi-developer mailing list Owl...@li... https://lists.sourceforge.net/lists/listinfo/owlapi-developer |