[Pellet-users] Check for no subclass
Alexander Musidlowski
musidlow at informatik.hu-berlin.de
Sun Feb 24 09:40:09 UTC 2008
Hi Rob,
that´s exactly what i´m looking for. It would be really nice if
getSubclass returns an empty set but i doesn´t, does it?
I´ve tested it with a small example and got owl:nothing.
Is there any documentation where i can see what i can expect what the
methods return if there found nothing? I´m also using getSubProperty,
getEquivalentProperty, getEquivalentClass.
--
Bye
Alex
am Samstag, 23. Februar 2008 um 22:51 schrieben Sie:
> Hmm I did think getSubClasses returned an empty set.... Anyway, if
> you are referring to NOTHING as OWL:Nothing, then you can see if the returned subclass
> set contains the returned NOTHING class. So:
> OWLClass nothing =
> reasoner.getManager().getOWLDataFactory().getOWLNothing();
> if (!reasoner.getSubClasses(cls).contains(nothing))
> {
> //do stuff
> }
> Hope this helps,
> Rob
> ---------------------------------------
> Dr. Rob Davey
> NCYC / Institute of Food Research
> Computational Biology / John Innes Centre
> Norwich Research Park
> Norwich, Norfolk, NR4 7HU
> Tel IFR : +44 (0)1603 251449 / x1449
> Tel JIC : +44 (0)1603 450833 / x2833
> Web : http://cbr.jic.ac.uk/dicks/
> ---------------------------------------
> -----Original Message-----
> From: pellet-users-bounces at lists.owldl.com on behalf of Alexander Musidlowski
> Sent: Sat 2/23/2008 2:19 PM
> To: pellet-users at lists.owldl.com
> Subject: [Pellet-users] Check for no subclass
>
> Hi,
> my problem is that
> subClsSets = reasoner.getSubClasses(cls);
> behaves different to
> subPropSets = reasoner.getSubProperties(property);
> If there is no subclass the result is [[NOTHING]]. If there is no
> subproperty the result is [[]]. The last one can be checked by
> isEmpty() but how can i check if there is no subclass?
> isEmpty() doesn´t work which is quite right, check for null also fails
> and a check for size() fails, if there is just one subclass. So how
> can i check that there is no subclass?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 183 bytes
Desc: not available
Url : http://lists.owldl.com/pipermail/pellet-users/attachments/20080224/cd804a61/attachment.pgp
More information about the Pellet-users
mailing list