is_a returns incomplete list for Individuals

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

is_a returns incomplete list for Individuals

Brownson
Hi,

Below is an except of an Individual from my owl file.

owlready2 is not able to return the complete list of items in it.
Specifically, out of the 10 items rdf:type resource items right below, it ALWAYS returns only 7 of them.
this happens irrespective of which individual i select. It never returns the complete list of objects(?) contained within the individual

        <rdf:type rdf:resource="http://webprotege.stanford.edu/R7P3if8uaj7tEI99RLQXgtF"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RB2K1EI4LCXPuqFcz2ATDdu"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RBL4TR34XZ145GcSStoBI53"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RBLvISf6m8xU02FTFmF1r9q"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RDH11zqfHFIShipPMrRzY0C"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RJP4l1shnj1v9ChjjNHMAj"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RPpp3f4PzUv8U0g6xV0HwQ"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RRxNdrqJovE7BfmjiI0UPW"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RboTl527YOCKrb3172yEl0"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/Ry8vybXrgRKuiIrw9rUELe"/>

I have been trying with is_a and the result i get is as below


[webprotege.stanford.edu.R7P3if8uaj7tEI99RLQXgtF,
 webprotege.stanford.edu.RB2K1EI4LCXPuqFcz2ATDdu,
 webprotege.stanford.edu.RBL4TR34XZ145GcSStoBI53,
 webprotege.stanford.edu.RBLvISf6m8xU02FTFmF1r9q,
 webprotege.stanford.edu.RPpp3f4PzUv8U0g6xV0HwQ,
 webprotege.stanford.edu.RboTl527YOCKrb3172yEl0,
 webprotege.stanford.edu.Ry8vybXrgRKuiIrw9rUELe,
webprotege.stanford.edu.RDN3XfQzmiwGSvuHuqclxzC.some(webprotege.stanford.edu.R9n5ADz9ZXNUFN5yzuQTl2C), webprotege.stanford.edu.RDN3XfQzmiwGSvuHuqclxzC.some(webprotege.stanford.edu.RCy7CmcSBVHo4OxmbynwQDs), webprotege.stanford.edu.RDN3XfQzmiwGSvuHuqclxzC.some(webprotege.stanford.edu.Rh1sypNmA7tZVhuk2lfEBW)]

It should have returned 13 items but only 10 is returned.... Please check if this is a bug or am i doing something wrong... Thanks a lot in advance


--------Except of Individual from my owl file STARTS HERE -----
   

    <owl:NamedIndividual rdf:about="http://webprotege.stanford.edu/RBKnTkMtqBcr22gT0lXARws">
        <rdf:type rdf:resource="http://webprotege.stanford.edu/R7P3if8uaj7tEI99RLQXgtF"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RB2K1EI4LCXPuqFcz2ATDdu"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RBL4TR34XZ145GcSStoBI53"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RBLvISf6m8xU02FTFmF1r9q"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RDH11zqfHFIShipPMrRzY0C"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RJP4l1shnj1v9ChjjNHMAj"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RPpp3f4PzUv8U0g6xV0HwQ"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RRxNdrqJovE7BfmjiI0UPW"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/RboTl527YOCKrb3172yEl0"/>
        <rdf:type rdf:resource="http://webprotege.stanford.edu/Ry8vybXrgRKuiIrw9rUELe"/>
        <rdf:type>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://webprotege.stanford.edu/RDN3XfQzmiwGSvuHuqclxzC"/>
                <owl:someValuesFrom rdf:resource="http://webprotege.stanford.edu/R9n5ADz9ZXNUFN5yzuQTl2C"/>
            </owl:Restriction>
        </rdf:type>
        <rdf:type>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://webprotege.stanford.edu/RDN3XfQzmiwGSvuHuqclxzC"/>
                <owl:someValuesFrom rdf:resource="http://webprotege.stanford.edu/RCy7CmcSBVHo4OxmbynwQDs"/>
            </owl:Restriction>
        </rdf:type>
        <rdf:type>
            <owl:Restriction>
                <owl:onProperty rdf:resource="http://webprotege.stanford.edu/RDN3XfQzmiwGSvuHuqclxzC"/>
                <owl:someValuesFrom rdf:resource="http://webprotege.stanford.edu/Rh1sypNmA7tZVhuk2lfEBW"/>
            </owl:Restriction>
        </rdf:type>
        <webprotege:R7erHwPB5Bb37pF9YMjdDeY rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Uart</webprotege:R7erHwPB5Bb37pF9YMjdDeY>
        <webprotege:R8A29pRvig0rlaPGtRQ1PcV rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0x01</webprotege:R8A29pRvig0rlaPGtRQ1PcV>
        <webprotege:RBJZgQtTk2MMvmlA5S0kYcu rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0x00</webprotege:RBJZgQtTk2MMvmlA5S0kYcu>
        <webprotege:RDMNhmx3srUzp1fJoYfcGk1 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0x03</webprotege:RDMNhmx3srUzp1fJoYfcGk1>
        <rdfs:label>Media Hardkey</rdfs:label>
    </owl:NamedIndividual>

--------Except of Individual from my owl file ENDS HERE -----
Reply | Threaded
Open this post in threaded view
|

Re: is_a returns incomplete list for Individuals

Brownson
To add some clarification.... What I am doing is parsing an OWL file. So i have a class and i am parsing the list of individuals within this class.... For each individual, i am checking to see which classes it belongs to. This is the point where it is failing... It's not giving me the complete list of classes the individual belongs to

Any help would be greatly appreciated. Many thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: is_a returns incomplete list for Individuals

Brownson
In reply to this post by Brownson
Thanks to a tip from Jiba, INDIRECT_is_a returns the full list. Many thanks for the tip
Reply | Threaded
Open this post in threaded view
|

Re: is_a returns incomplete list for Individuals

Brownson
update... INDIRECT_is_a is not what i need... it returns items that are not even in the list i provided
Reply | Threaded
Open this post in threaded view
|

Re: is_a returns incomplete list for Individuals

Jiba
Administrator
In reply to this post by Brownson
Hi,

I added an OWL header to your file, and loaded it, but I got the 13 parents classes (including 3 restrictions).

Here is the OWL file I used: t.owl

And the code:

from owlready2 import *

onto_path.append("/tmp")
onto = get_ontology("/tmp/t.owl").load()

i = IRIS["http://webprotege.stanford.edu/RBKnTkMtqBcr22gT0lXARws"]

print(i.is_a)
print(len(i.is_a))


If the problem persists, could you send me an entire example for reproducing the problem? Including code and ontology?

Jiba