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-discussion] Problem with getDomain() via API

Jörg Ludwig jl at act-consulting.de
Tue May 4 02:00:50 PDT 2010


Hi all,
 
i am not sure if the "getDomain()" method from the "Interface Slot" working
correctly or if i understand something wrong.
What i want is to read all values of a slot. And now i stopped by the
getDomain() method. For my test i am using the newspaper.pprj example with Protege 3.4.4.
For my tests i am using the slot "other_information" used at the class "Person".
 
public void myexportertest() {
        KnowledgeBase kb = this.getKnowledgeBase();
        Slot s = kb.getSlot("other_information");
  // ...
  // Reading other things like MinimumValue or MaximumValue and so on...
  // ...
        // Domain
  // Just for my test! Check the size of the collection.
        Collection dsds = s.getDomain();
        JOptionPane.showMessageDialog(null, "Domainsize: "+dsds.size(), "Information", JOptionPane.INFORMATION_MESSAGE);
  // Try to read the class
        Iterator domain = s.getDomain().iterator();
        if (domain.hasNext()) {
            Cls cls = (Cls) domain.next();
            JOptionPane.showMessageDialog(null, "Domain: "+cls.getName(), "Information", JOptionPane.INFORMATION_MESSAGE);
        }
 }
 
My results are:
Domainsize: 8
Domain: Director
 
Uhhhmmm... The class Director is a subsubsubclass of class Person. The volume of class Person with all sub classes are 8.
Ok. That is my question better my confusion. 
 
Why i get a Domainsize of 8?
Why i get Director as Domain and not Person?
 
Hope that someone can give me an answer.
 
Thanks,
Jörg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20100504/31064f35/attachment.html>


More information about the protege-discussion mailing list