History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: ALI-11
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: James Leigh
Reporter: Matthias Moi
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
AilBaba

Compilation of Java-Classes fails if the ontology specifies a property which is inferred by a subclass and restricted

Created: 05/Aug/11 02:16 PM   Updated: 10/Aug/11 08:21 PM
Component/s: object-repository
Affects Version/s: 2.0-beta10
Fix Version/s: 2.0-beta12

Environment: mac os / windows 7


 Description   
The Problem is easy to understand with the following example. The Code of the OWL-file is attached.

I think, the problem is in the restriction of the property for AlevelFormation Entity. In my example the entity Formation is connected via hasPart to other Formation or VehicleThing. The ALevelFormation, which is a Formation restricts the hasPart property in that way, that only Object of the Type BLevelFormation can be addressed. The compiler founds a Set BLevelFormation for getHasPart in the generated interface ALevelFormation because of the depth of inheritance ALevelFormation should specify V

/var/folders/l5/4z_54rs55dx51dslmss40qpm0000gn/T/OWLCompiler1701491496037452730/testOnto/ALevelFormation.java:9: getTestOntoHasPart() in testOnto.ALevelFormation clashes with getTestOntoHasPart() in testOnto.Formation; attempting to use incompatible return type
found : java.util.Set<testOnto.BLevelFormation>
required: java.util.Set<testOnto.FormationOrVehicleThing>
Set<BLevelFormation> getTestOntoHasPart();


Here is an Example file:


<?xml version="1.0"?>


<!DOCTYPE rdf:RDF [
    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY owl2xml "http://www.w3.org/2006/12/owl2-xml#" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
    <!ENTITY testOnto "http://www.uni-paderborn.de/ontologies/2011/7/testOnto.owl#" >
]>


<rdf:RDF xmlns="http://www.uni-paderborn.de/ontologies/2011/7/testOnto.owl#"
     xml:base="http://www.uni-paderborn.de/ontologies/2011/7/testOnto.owl"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:owl2xml="http://www.w3.org/2006/12/owl2-xml#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:testOnto="http://www.uni-paderborn.de/ontologies/2011/7/testOnto.owl#">
    <owl:Ontology rdf:about="">
        <rdfs:comment
            >Just a test ontology</rdfs:comment>
    </owl:Ontology>
    


    <!--
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Object Properties
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->

    


    <!-- http://www.uni-paderborn.de/ontologies/2011/7/testOnto.owl#hasPart -->

    <owl:ObjectProperty rdf:about="#hasPart">
        <rdfs:domain rdf:resource="#Formation"/>
        <rdfs:range>
            <owl:Class>
                <owl:unionOf rdf:parseType="Collection">
                    <rdf:Description rdf:about="#Formation"/>
                    <rdf:Description rdf:about="#VehicleThing"/>
                </owl:unionOf>
            </owl:Class>
        </rdfs:range>
    </owl:ObjectProperty>
    


    <!--
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Classes
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->

    


    <!-- http://www.uni-paderborn.de/ontologies/2011/7/testOnto.owl#ALevelFormation -->

    <owl:Class rdf:about="#ALevelFormation">
        <rdfs:subClassOf rdf:resource="#FBFormation"/>
        <rdfs:subClassOf>
            <owl:Restriction>
                <owl:onProperty rdf:resource="#hasPart"/>
                <owl:allValuesFrom rdf:resource="#BLevelFormation"/>
            </owl:Restriction>
        </rdfs:subClassOf>
        <owl:disjointWith rdf:resource="#BLevelFormation"/>
    </owl:Class>
    


    <!-- http://www.uni-paderborn.de/ontologies/2011/7/testOnto.owl#BLevelFormation -->

    <owl:Class rdf:about="#BLevelFormation">
        <rdfs:subClassOf rdf:resource="#FBFormation"/>
    </owl:Class>
    


    <!-- http://www.uni-paderborn.de/ontologies/2011/7/testOnto.owl#FBFormation -->

    <owl:Class rdf:about="#FBFormation">
        <rdfs:subClassOf rdf:resource="#Formation"/>
    </owl:Class>
    


    <!-- http://www.uni-paderborn.de/ontologies/2011/7/testOnto.owl#Formation -->

    <owl:Class rdf:about="#Formation">
        <rdfs:subClassOf rdf:resource="#SARThing"/>
    </owl:Class>
    


    <!-- http://www.uni-paderborn.de/ontologies/2011/7/testOnto.owl#SARThing -->

    <owl:Class rdf:about="#SARThing"/>
    


    <!-- http://www.uni-paderborn.de/ontologies/2011/7/testOnto.owl#VehicleThing -->

    <owl:Class rdf:about="#VehicleThing">
        <rdfs:subClassOf rdf:resource="#SARThing"/>
    </owl:Class>
</rdf:RDF>



<!-- Generated by the OWL API (version 2.2.1.1138) http://owlapi.sourceforge.net -->


 All   Comments   Change History      Sort Order:
Comment by James Leigh [10/Aug/11 08:21 PM]
Property restrictions will be ignored in 2.0-beta12 unless the property is a owl:FunctionalProperty as of revision 11162.

In the example provided the property #hasPart will always be compiled with Set<testOnto.FormationOrVehicleThing> regardless of what owl:Restrictions are used.

Thanks for reporting this!

Change by James Leigh [10/Aug/11 08:21 PM]
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 2.0-beta12 [ 10591 ]
Resolution Fixed [ 1 ]