Does owlready parse DisjointUnion?

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

Does owlready parse DisjointUnion?

Matthias
Hi,

it seems that owlready does not parse the DisjointUnion keyword.

In the below example, PARENT is a DisjointUnion of CHILD1 and CHILD2.

I would expect that CHILD1 and CHILD2 is_a PARENT,
CHILD1 is disjoint from CHILD2 and
PARENT is equivalent to the union of CHILD1 and CHILD2.

Neither of the above is the case.

Am I doing something wrong or does owlready ignore DisjointUnion?

Cheers,

Matthias


>>> o = owlready2.get_ontology("test.owl")
>>> o.load()
get_ontology("http://www.semanticweb.org/urba/ontologies/2019/9/test.owl#")
>>> for x in o.classes():
...     print(x, x.is_a, x.equivalent_to)
...
test.PARENT [owl.Thing] []
test.CHILD1 [owl.Thing] []
test.CHILD2 [owl.Thing] []
>>> list(o.disjoint_classes())
[]


<?xml version="1.0"?>
<Ontology xmlns="http://www.w3.org/2002/07/owl#"
     xml:base="http://www.semanticweb.org/urba/ontologies/2019/9/test.owl"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     ontologyIRI="http://www.semanticweb.org/urba/ontologies/2019/9/test.owl">
    <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
    <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <Prefix name="xml" IRI="http://www.w3.org/XML/1998/namespace"/>
    <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
    <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>

    <Declaration>
        <Class IRI="http://test.info/test#PARENT"/>
    </Declaration>
    <Declaration>
        <Class IRI="http://test.info/test#CHILD1"/>
    </Declaration>
    <Declaration>
        <Class IRI="http://test.info/test#CHILD2"/>
    </Declaration>

    <DisjointUnion>
        <Class IRI="http://test.info/test#PARENT"/>
        <Class IRI="http://test.info/test#CHILD1"/>
        <Class IRI="http://test.info/test#CHILD2"/>
    </DisjointUnion>
   
</Ontology>
Reply | Threaded
Open this post in threaded view
|

Re: Does owlready parse DisjointUnion?

Jiba
Administrator
Hi,

You are right, disjoint unions were not supported.

I've added disjoint unions in the development version. You can now load them from OWL/XML, and you can access them as Class.disjoint_unions.

Best regards,
Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Does owlready parse DisjointUnion?

Matthias
Thanks a lot Jiba!