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-owl] SWRL rule -- infer(string)

Thomas Russ tar at ISI.EDU
Wed Oct 29 18:04:25 PDT 2008

On Oct 29, 2008, at 3:43 PM, Koosha wrote:
> I have another easy questions:
> Q) How can we get JUST instances of a class without their rdf types.
> The following
> OWLNamedClass trackClass = owlModel.getOWLNamedClass("Track");	
> Collection colTracks= trackClass.getInstances(true);
> System.out.println("the tracks are:"+colTracks);
> gives the individuals of the class with their RDF types (see below)  
> however I
> want to get JUST Track_5 and Track_6 (only direct individuals)

You want to get the names or the browser text for the instances.
So you will have to loop over them individually.

   for (Object o: colTracks) {
     OWLIndividual i = (OWLIndividual) o;

or  i.getLocalName()  or  i.getBrowserText()

More information about the protege-owl mailing list