Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bizarre OWL2API parsing problem with datatypes #15

Closed
NicolasRouquette opened this issue Jun 19, 2017 · 2 comments
Closed

Bizarre OWL2API parsing problem with datatypes #15

NicolasRouquette opened this issue Jun 19, 2017 · 2 comments

Comments

@NicolasRouquette
Copy link
Member

Converting from OWL => OML requires mapping OWL datatype definitions as OML scalar data ranges.

Two variants of OWL datatypes seem to pose problems with the OWL2API v5.0.5 currently used:

  1. Datatype restriction
    <rdfs:Datatype rdf:about="&PrimitiveTypes;UnlimitedNatural">
        <owl:equivalentClass>
            <rdfs:Datatype>
                <owl:onDatatype rdf:resource="&xsd;integer"/>
                <owl:withRestrictions rdf:parseType="Collection">
                    <rdf:Description>
                        <xsd:minInclusive rdf:datatype="&xsd;integer">-1</xsd:minInclusive>
                    </rdf:Description>
               </owl:withRestrictions>
            </rdfs:Datatype>
        </owl:equivalentClass>
    </rdfs:Datatype>

Asking the OWLAPI for the definition of PrimitiveTypes:UnlimitedNatural returns an error IRI like this: <http://org.semanticweb.owlapi/error#Error9>.

  1. Enumeration of literals

    <rdfs:Datatype rdf:about="&UML;VisibilityKind">
        <owl:equivalentClass>
            <rdfs:Datatype>
                <owl:oneOf>
                    <rdf:Description>
                        <rdf:type rdf:resource="&rdf;List"/>
                        <rdf:first rdf:datatype="&xsd;string">package</rdf:first>
                        <rdf:rest>
                            <rdf:Description>
                                <rdf:type rdf:resource="&rdf;List"/>
                                <rdf:first rdf:datatype="&xsd;string">private</rdf:first>
                                <rdf:rest>
                                    <rdf:Description>
                                        <rdf:type rdf:resource="&rdf;List"/>
                                        <rdf:first rdf:datatype="&xsd;string">protected</rdf:first>
                                        <rdf:rest>
                                            <rdf:Description>
                                                <rdf:type rdf:resource="&rdf;List"/>
                                                <rdf:first rdf:datatype="&xsd;string">public</rdf:first>
                                                <rdf:rest rdf:resource="&rdf;nil"/>
                                            </rdf:Description>
                                        </rdf:rest>
                                    </rdf:Description>
                                </rdf:rest>
                            </rdf:Description>
                        </rdf:rest>
                    </rdf:Description>
                </owl:oneOf>
            </rdfs:Datatype>
        </owl:equivalentClass>
    </rdfs:Datatype>
    
    <rdfs:Datatype rdf:about="&UML;ParameterEffectKind">
        <owl:equivalentClass>
            <rdfs:Datatype>
                <owl:oneOf>
                    <rdf:Description>
                        <rdf:type rdf:resource="&rdf;List"/>
                        <rdf:first rdf:datatype="&xsd;string">create</rdf:first>
                        <rdf:rest>
                            <rdf:Description>
                                <rdf:type rdf:resource="&rdf;List"/>
                                <rdf:first rdf:datatype="&xsd;string">delete</rdf:first>
                                <rdf:rest>
                                    <rdf:Description>
                                        <rdf:type rdf:resource="&rdf;List"/>
                                        <rdf:first rdf:datatype="&xsd;string">read</rdf:first>
                                        <rdf:rest>
                                            <rdf:Description>
                                                <rdf:type rdf:resource="&rdf;List"/>
                                                <rdf:first rdf:datatype="&xsd;string">update</rdf:first>
                                                <rdf:rest rdf:resource="&rdf;nil"/>
                                            </rdf:Description>
                                        </rdf:rest>
                                    </rdf:Description>
                                </rdf:rest>
                            </rdf:Description>
                        </rdf:rest>
                    </rdf:Description>
                </owl:oneOf>
            </rdfs:Datatype>
        </owl:equivalentClass>
    </rdfs:Datatype>

Usually, the OWLAPI provides the correct definition for UML:VisibilityKind but provides an error IRI for the definition of UML:ParameterEffectKind.

With Protege 5.2.0, loading these ontologies produces errors in the log:

2017-06-19 12:45:05.632 [pool-4-thread-1] ERROR OWLRDFConsumer    Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error2 for type Class
2017-06-19 12:45:05.636 [pool-4-thread-1] INFO  OntologyLoader    Finished loading imported ontology at file:/opt/local/imce/users/nfr/github.imce/gov.nasa.jpl.imce.ontologies.public/ontologies/imce.jpl.nasa.gov/www.omg.org/spec/PrimitiveTypes/20110701/PrimitiveTypes.owl
2017-06-19 12:45:06.002 [pool-4-thread-1] ERROR OWLRDFConsumer    Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error3 for type Datatype
2017-06-19 12:45:06.006 [pool-4-thread-1] ERROR OWLRDFConsumer    Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error4 for type Datatype
2017-06-19 12:45:06.007 [pool-4-thread-1] ERROR OWLRDFConsumer    Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error5 for type Datatype
2017-06-19 12:45:06.008 [pool-4-thread-1] ERROR OWLRDFConsumer    Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error6 for type Datatype
2017-06-19 12:45:06.009 [pool-4-thread-1] ERROR OWLRDFConsumer    Entity not properly recognized, missing triples in input? http://org.semanticweb.owlapi/error#Error7 for type Datatype
@NicolasRouquette
Copy link
Member Author

The problem seems to be caused by the import of OWL in foundation/annotation.

With Protege 5.2.0:

    <owl:Ontology rdf:about="http://imce.jpl.nasa.gov/foundation/annotation/annotation">
        <owl:imports rdf:resource="http://purl.org/dc/elements/1.1/"/>
        <owl:imports rdf:resource="http://www.w3.org/2002/07/owl"/>
...

This causes errors when parsing datatype definitions.

    <owl:Ontology rdf:about="http://imce.jpl.nasa.gov/foundation/annotation/annotation">
        <owl:imports rdf:resource="http://purl.org/dc/elements/1.1/"/>
        <!--
        <owl:imports rdf:resource="http://www.w3.org/2002/07/owl"/>
        -->
...

No errors.

The explicit import of OWL was done to solve the problem of the builtin datatype definitions (#14).

@NicolasRouquette
Copy link
Member Author

Remove the explicit import of OWL; this needs to be handled in the OML Converter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant