Description logic

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

Description logic

rv
Hello,

I am loading an ontology that has the following class description:

<owl:Class rdf:ID="FrenchWine">
    <owl:intersectionOf rdf:parseType="Collection">
        <owl:Class rdf:about="Wine">
        <owl:Restriction>
            <owl:onProperty rdf:resource="#hasBody" />
            <owl:hasValue rdf:resource="#Full" />
        </owl:Restriction>
    </owl:intersectionOf>
</owl:Class>

Is it possible to access the owl:intersectionOf property in order to determine its members?

Many thanks,

Roger.
Reply | Threaded
Open this post in threaded view
|

Re: Description logic

Jiba
Administrator
Hello,

Yes, you can find the intersection in FrenchWine.is_a. Then, the .Classes attribute of the intersection contains the elements in the intersection : the Wine class and the resctriction.

You may try something like:

print(onto.FrenchWine.is_a[0].Classes)
print(onto.FrenchWine.is_a[0].Classes[1].Property)
print(onto.FrenchWine.is_a[0].Classes[1].type)
print(onto.FrenchWine.is_a[0].Classes[1].value)

(you may need to replace [0] by [1] depending on the values in .is_a)

Best regards,
Jiba