opencaesar / owl-adapter

The OML adapter for OWL
Apache License 2.0
0 stars 2 forks source link

[BUG] - oml2owl does not validate the OML before running the conversion #31

Closed JWT007 closed 3 years ago

JWT007 commented 3 years ago

Description

If I have an OML and it refers to a non-existing concept - in the example below: 'part:ColoredPartInstance' does not exist...this is an error (which a cleaned Rosetta project will report with red underline).

@dc:title "UC 1.0 - Scalar Property Restriction"
description <http://t-systems.com/general/restriction_analysis/UC1.0> with # as UC1.0 {

    uses <http://t-systems.com/general/restriction_analysis/restriction_analysis> 

    ci BluePart     : part:ColoredPartInstance

}

An OWL is created with bogus data and elements named "nullnull". (here shortened for brevity) No error occurs and the adapter silently creates invalid classes to "fill in the holes".

<?xml version="1.0"?>
<rdf:RDF ...>
    <owl:Ontology rdf:about="http://t-systems.com/general/restriction_analysis/UC1.0">
        <owl:imports rdf:resource="http://t-systems.com/general/restriction_analysis/restriction_analysis"/>
        <oml:ontologyType rdf:resource="http://opencaesar.io/oml#Description"/>
        <dc:title>UC 1.0 - Scalar Property Restriction</dc:title>
    </owl:Ontology>

    <!-- nullnull -->
    <owl:Class rdf:about="nullnull"/>

    <!-- http://t-systems.com/general/restriction_analysis/UC1.0#BluePart -->
    <owl:NamedIndividual rdf:about="http://t-systems.com/general/restriction_analysis/UC1.0#BluePart">
        <rdf:type rdf:resource="nullnull"/>
    </owl:NamedIndividual>

</rdf:RDF>

Expected Behavior

The 'oml2owl' adapter should run an OML validation before performing the conversion. If Rosetta would report an error than oml2owl should as well.

melaasar commented 3 years ago

The Oml2Owl (Owl Adapter) now runs oml-validate internally before it converts to Owl. Please retest with the latest revision and repoen if still reproducible.