Can Hermit infer the type of an individual?

50 views
Skip to first unread message

Mark Schreiber

unread,
Jul 19, 2016, 12:09:48 PM7/19/16
to HermiT Users
Hi,

I'm trying to figure out if Hermit can reason that an individual has rdf:Type a class based on an OWL ontology, preferably from the command line.

Any advice?

Thanks,
Mark





Ignazio Palmisano

unread,
Jul 19, 2016, 12:24:05 PM7/19/16
to hermit-users

On 19 Jul 2016 5:09 p.m., "Mark Schreiber" <markjsc...@gmail.com> wrote:
>
> Hi,
>
> I'm trying to figure out if Hermit can reason that an individual has rdf:Type a class based on an OWL ontology, preferably from the command line.
>

It can, but I don't know if there is any command line utility included.
Cheers,
Ignazio

> Any advice?
>
> Thanks,
> Mark
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "HermiT Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hermit-users...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Birte Glimm

unread,
Jul 19, 2016, 12:31:20 PM7/19/16
to Ignazio Palmisano, hermit-users
As Ignazio said, HermiT can do that, but it indeed has no command line
switch for that. Not all methods of the Java interface are available
from the command line.

Best,

Birte

On 19 July 2016 at 18:24, Ignazio Palmisano
--
Jun. Prof. Dr. Birte Glimm Tel.: +49 731 50 24125
Inst. of Artificial Intelligence Secr: +49 731 50 24258
University of Ulm Fax: +49 731 50 24188
D-89069 Ulm birte...@uni-ulm.de
Germany

Mark Schreiber

unread,
Jul 22, 2016, 6:35:58 PM7/22/16
to HermiT Users, ipalmisan...@gmail.com, birte...@uni-ulm.de
Thanks.

I found this method to do it programmatically and wrapped it into a custom app.

//get subclasses of Class (including indirect subclasses)
NodeSet<OWLClass> subClasses = hermit.getSubClasses(new OWLClassImpl(
                IRI.create(
                        "http://example.com/MyClass")), false);

I guess if I felt inspired I could make a version of the executable JAR that offered this as a command line option.

Birte Glimm

unread,
Jul 23, 2016, 4:28:46 AM7/23/16
to Mark Schreiber, HermiT Users, Ignazio Palmisano
Well, the method computed the subclasses of a given class. This is
already available via command line, but you wanted the instances of a
class, i.e., the individuals that have a given class as type.

Best,

Birte

Mark Schreiber

unread,
Jul 25, 2016, 9:32:09 AM7/25/16
to HermiT Users, markjsc...@gmail.com, ipalmisan...@gmail.com, birte...@uni-ulm.de
Oops, copied the wrong code snippet. This is the part I wanted.

            NodeSet<OWLNamedIndividual> instances = hermit.getInstances(myClass, false);
            for (OWLNamedIndividual ind : instances.getFlattened()) {
                //print the IRI of the individual 
                System.out.println("\t" + ind.toStringID());

Birte Glimm

unread,
Jul 25, 2016, 10:06:01 AM7/25/16
to Mark Schreiber, HermiT Users, ipalmisan...@gmail.com
This looks much better and should do the job.

Best,

Birte

--
Jun. Prof. Dr. Birte Glimm Tel.: +49 731 50 24125
Inst. of Artificial Intelligence Secr: +49 731 50 24258
University of Ulm Fax: +49 731 50 24188
D-89069 Ulm birte...@uni-ulm.de
Germany

Reply all
Reply to author
Forward
0 new messages