[Pellet-users] About function getInconsistentClasses

Evren Sirin evren at clarkparsia.com
Wed Sep 19 13:29:13 UTC 2007


There are couple of programs with the code you have. You create
reasoner1 and do not load any ontologies. As accepted there are no
inconsistent classes in an empty knowledgebase. You load the data to the
other reasoner but do not ask any queries against it. Moreover, you are
mixing Jena and OWLAPI reasoners whihc is something you probably do not
want (Typically one either uses Jena or OWLAPI interface but not both).
I suggest you to look at the sample programs in the examples directory
to understand the basics of using Pellet with these interfaces. You can
find more information about Jena and OWLAPI (and how to use reasoners
with them)in their own documentation.

Cheers,
Evren

On 9/18/07 10:22 PM, anningsl at 163.com wrote:
> Hi all
>
> I have defined an ontology,and defined an inconsistent class. The code
> as follows:
>
> import java.io.File;
> import java.io.FileInputStream;
> import java.io.FileNotFoundException;
> import java.io.InputStream;
> import java.util.Iterator;
> import java.util.Set;
>
> import org.mindswap.pellet.KnowledgeBase;
> import org.mindswap.pellet.PelletOptions;
> import org.mindswap.pellet.jena.ModelReader;
> import org.mindswap.pellet.jena.OWLReasoner;
> import org.mindswap.pellet.owlapi.Reasoner;
> import org.semanticweb.owl.model.OWLClass;
>
> import com.hp.hpl.jena.rdf.model.Model;
>
> public class ConceptConsistent {
>
> public static void main (String arg[]){
>
> InputStream in = null;
> try {
> in = new FileInputStream(new File ("g://test.owl"));
> } catch (FileNotFoundException e) {
> System.out.println(e.getMessage());
> e.printStackTrace();
> }
>
> ModelReader reader = new ModelReader();
> System.out.println("The ontology is-------------");
>
> if (in==null){
> System.out.println("The ontology file is not found");
> return;
> }
>
> Model model = reader.read(in);
> OWLReasoner reasoner = new OWLReasoner();
> Reasoner reasoner1 = new Reasoner();
>
> reasoner.load(model);
>
> Set objects = reasoner1.getInconsistentClasses();
> System.out.println("The inconsistent classes in the ontology are:");
>
> Iterator itr = objects.iterator();
>
> while (itr.hasNext())
> {
> System.out.println("The class : " + itr.next().toString()+ "is
> inconsistent" );
> }
>
>
> }
>
>
> }
> But when I debug, the itr is null. what's wrong with the function
> getInconsistentClasses.
> Is there another function can be used to check the inconsistency for
> classes??
>
> Thank you very much
>
> BRs
>
> Anning
>
>
>
>
>
>
> From: pellet-users-request at lists.owldl.com
> To: pellet-users at lists.owldl.com
> Date: Tue, 18 Sep 2007 20:01:04 +0800 (CST)
> Subject: Pellet-users Digest, Vol 11, Issue 14
>
> > Send Pellet-users mailing list submissions to >
> pellet-users at lists.owldl.com > > To subscribe or unsubscribe via the
> World Wide Web, visit >
> http://lists.owldl.com/mailman/listinfo/pellet-users > or, via email,
> send a message with subject or body 'help' to >
> pellet-users-request at lists.owldl.com > > You can reach the person
> managing the list at > pellet-users-owner at lists.owldl.com > > When
> replying, please edit your Subject line so it is more specific > than
> "Re: Contents of Pellet-users digest..." > > > Today's Topics: > > 1.
> N-ary relations (Role Francois) > 2. Re: N-ary relations (Bijan
> Parsia) > 3. Re: N-ary relations (Markus Stocker) > > >
> ----------------------------------------------------------------------
> > > Message: 1 > Date: Tue, 18 Sep 2007 10:05:02 +0200 (CEST) > From:
> "Role Francois" > Subject: [Pellet-users] N-ary relations > To:
> pellet-users at lists.owldl.com > Message-ID: >
> <49034.84.5.96.213.1190102702.squirrel at webmail.univ-paris5.fr> >
> Content-Type: text/plain;charset=iso-8859-1 > > Hi Pellet users, > >
> First of all, many thanks to Rob and Bijan for their answers
> concerning > how to control debug information. > > I have another
> (unrelated) question. I wonder how n-ary relations (n> 2) > can be
> represented in OWL. > For example suppose the temperature of an object
> depends both on its > location and the time of the day as in the
> foillowing : > > temperature(object1,garden,afternoon,20) >
> temperature(object1,garden,morning,20) >
> temperature(object1,house,afternoon,18) > .... > > Of course we could
> use binary relations such as : > >
> gardenAfternoonTemperature(object1,20) >
> gardenMorningTemperature(objetc1,10) > .... > > But it seems quite
> awkward... > > I realize this is not a Pellet-specific question but if
> any one has any > suggestion I would be grateful, > > Fran?ois > > > >
> > ------------------------------ > > Message: 2 > Date: Tue, 18 Sep
> 2007 09:17:35 +0100 > From: Bijan Parsia > Subject: Re: [Pellet-users]
> N-ary relations > To: "Role Francois" > Cc:
> pellet-users at lists.owldl.com > Message-ID:
> <175182B8-3525-4380-8186-8544AB3DBB14 at clarkparsia.com> > Content-Type:
> text/plain; charset=US-ASCII; delsp=yes; format=flowed > > On Sep 18,
> 2007, at 9:05 AM, Role Francois wrote: > > > Hi Pellet users, > > > >
> First of all, many thanks to Rob and Bijan for their answers > >
> concerning > > how to control debug information. > > > > I have
> another (unrelated) question. I wonder how n-ary relations > > (n> 2)
> > > can be represented in OWL. > > Standardly, by reification (i.e.,
> by making the relation an object > with (binary) relations to each
> term). > > Some DLs have syntactic support for this (i.e., DLR). > >
> There are some special cases. > > > For example suppose the
> temperature of an object depends both on its > > location and the time
> of the day as in the foillowing : > > This could perhaps be modeled
> using an n-ary datatype predicate, > which are part of OWL 1.1. If the
> set of times of day is small, you > could use a set of unary datatypes
> (morningTemp, eveningTemp), or, if > we added lists to the supported
> datatypes, unary datatypes of pairs. > > I don't know that any of the
> implementations support n-ary datatype > predicates yet. > > >
> temperature(object1,garden,afternoon,20) > >
> temperature(object1,garden,morning,20) > >
> temperature(object1,house,afternoon,18) > > .... > > > > Of course we
> could use binary relations such as : > > > >
> gardenAfternoonTemperature(object1,20) > >
> gardenMorningTemperature(objetc1,10) > > .... > > Or, hasTemp
> [timeOfDay afternoon; degrees 20]. > > Which is more standard. > > >
> But it seems quite awkward... > > Yep. If the values tended to be
> ground, one could use nary dl safe > rules (which are not currently
> supported by anyone; see the AL Log > papers for an idea of what they
> could be like). > > > I realize this is not a Pellet-specific question
> but if any one has > > any > > suggestion I would be grateful, > >
> Yep. public-owl-dev is a better list. > > Cheers, > Bijan. > > >
> ------------------------------ > > Message: 3 > Date: Tue, 18 Sep 2007
> 09:29:57 +0100 > From: "Markus Stocker" > Subject: Re: [Pellet-users]
> N-ary relations > To: "Role Francois" > Cc:
> pellet-users at lists.owldl.com > Message-ID: > > Content-Type:
> text/plain; charset=ISO-8859-1 > > Hi Francois, > > Just a short note,
> you might find this [1] useful, > > markus > > [1]
> http://www.w3.org/TR/swbp-n-aryRelations/ > > On 9/18/07, Role
> Francois wrote: > > Hi Pellet users, > > > > First of all, many thanks
> to Rob and Bijan for their answers concerning > > how to control debug
> information. > > > > I have another (unrelated) question. I wonder how
> n-ary relations (n> 2) > > can be represented in OWL. > > For example
> suppose the temperature of an object depends both on its > > location
> and the time of the day as in the foillowing : > > > >
> temperature(object1,garden,afternoon,20) > >
> temperature(object1,garden,morning,20) > >
> temperature(object1,house,afternoon,18) > > .... > > > > Of course we
> could use binary relations such as : > > > >
> gardenAfternoonTemperature(object1,20) > >
> gardenMorningTemperature(objetc1,10) > > .... > > > > But it seems
> quite awkward... > > > > I realize this is not a Pellet-specific
> question but if any one has any > > suggestion I would be grateful, >
> > > > Fran?ois > > > > > >
> _______________________________________________ > > Pellet-users
> mailing list > > Pellet-users at lists.owldl.com > >
> http://lists.owldl.com/mailman/listinfo/pellet-users > >
> _______________________________________________ > > > > Sponsored by
> Clark & Parsia, LLC http://clarkparsia.com/ > > > > >
> ------------------------------ > >
> _______________________________________________ > Pellet-users mailing
> list > Pellet-users at lists.owldl.com >
> http://lists.owldl.com/mailman/listinfo/pellet-users >
> _______________________________________________ > > Sponsored by Clark
> & Parsia, LLC http://clarkparsia.com/ > > End of Pellet-users Digest,
> Vol 11, Issue 14 > ******************************************** >
>
> ------------------------------------------------------------------------
> 杀70万种木马病毒,瑞星2008版免费
> <http://pro.163.com/event.ng/Type=click&FlightID=96648&AdID=98138&TargetID=635&Values=31,43,51,60,72,82,91,100,110,312,330,332,499,587,702,733,734&Redirect=http://ad.cn.doubleclick.net/clk;134682177;20226578;k%3Fhttp://www.rising.com.cn/2008/trial/index.htm>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Pellet-users mailing list
> Pellet-users at lists.owldl.com
> http://lists.owldl.com/mailman/listinfo/pellet-users
> _______________________________________________
>
> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/



More information about the Pellet-users mailing list