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

translateShorthandIdToExpandedId in conversion to obo #830

Open
cmungall opened this issue Mar 15, 2019 · 2 comments
Open

translateShorthandIdToExpandedId in conversion to obo #830

cmungall opened this issue Mar 15, 2019 · 2 comments
Assignees

Comments

@cmungall
Copy link
Member

Example:

<?xml version="1.0"?>
<rdf:RDF xmlns="http://purl.obolibrary.org/obo/phipo.owl#"
     xml:base="http://purl.obolibrary.org/obo/phipo.owl"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:oboInOwl="http://www.geneontology.org/formats/oboInOwl#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace">

    <owl:Ontology rdf:about="http://purl.obolibrary.org/obo/phipo.owl">
        <owl:imports rdf:resource="http://purl.obolibrary.org/obo/ro/core.owl"/>
    </owl:Ontology>
    

    <!-- http://purl.obolibrary.org/obo/PHIPO_0000304 -->

    <owl:ObjectProperty rdf:about="http://purl.obolibrary.org/obo/FOO_1">
      <oboInOwl:shorthand rdf:datatype="http://www.w3.org/2001/XMLSchema#string">foo</oboInOwl:shorthand>
    </owl:ObjectProperty>

</rdf:RDF>
Exception in thread "main" java.lang.NullPointerException
        at org.obolibrary.obo2owl.OWLAPIObo2Owl.translateShorthandIdToExpandedId(OWLAPIObo2Owl.java:1739)
        at org.obolibrary.obo2owl.OWLAPIObo2Owl.oboIdToIRI_load(OWLAPIObo2Owl.java:1679)
        at org.obolibrary.obo2owl.OWLAPIObo2Owl.oboIdToIRI(OWLAPIObo2Owl.java:1643)
        at org.obolibrary.oboformat.writer.OBOFormatWriter$OWLOntologyNameProvider.getName(OBOFormatWriter.java:992)
        at org.semanticweb.owlapi.oboformat.OBOFormatRenderer$1.getName(OBOFormatRenderer.java:74)
        at org.obolibrary.oboformat.writer.OBOFormatWriter.write(OBOFormatWriter.java:312)
        at org.obolibrary.oboformat.writer.OBOFormatWriter.write(OBOFormatWriter.java:200)
        at org.semanticweb.owlapi.oboformat.OBOFormatRenderer.render(OBOFormatRenderer.java:88)
        at org.semanticweb.owlapi.oboformat.OBOFormatStorer.storeOntology(OBOFormatStorer.java:42)
        at org.semanticweb.owlapi.util.AbstractOWLStorer.storeOntology(AbstractOWLStorer.java:155)
        at org.semanticweb.owlapi.util.AbstractOWLStorer.storeOntology(AbstractOWLStorer.java:119)
        at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1525)
        at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.saveOntology(OWLOntologyManagerImpl.java:1502)
        at owltools.io.ParserWrapper.saveOWL(ParserWrapper.java:289)
        at owltools.io.ParserWrapper.saveOWL(ParserWrapper.java:209)
        at owltools.cli.CommandRunner.runSingleIteration(CommandRunner.java:3712)
        at owltools.cli.CommandRunnerBase.run(CommandRunnerBase.java:76)
        at owltools.cli.CommandRunnerBase.run(CommandRunnerBase.java:68)
        at owltools.cli.CommandLineInterface.main(CommandLineInterface.java:12)

Note that BOTH the import AND the shorthand need to be present.

At the least the reporting should be more informative as it's a pain to debug these

@cmungall cmungall self-assigned this Mar 15, 2019
@cmungall
Copy link
Member Author

Another test case:

<?xml version="1.0"?>
<rdf:RDF xmlns="http://purl.obolibrary.org/obo/phipo.owl#"
     xml:base="http://purl.obolibrary.org/obo/phipo.owl"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:oboInOwl="http://www.geneontology.org/formats/oboInOwl#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace">
    <owl:Ontology rdf:about="http://purl.obolibrary.org/obo/phipo.owl">
        <owl:imports rdf:resource="http://purl.obolibrary.org/obo/phipo/imports/ro_import.owl"/>
    </owl:Ontology>
    



    <!-- http://www.geneontology.org/formats/oboInOwl#Subset -->

    <rdf:Description rdf:about="http://www.geneontology.org/formats/oboInOwl#Subset">
        <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/IAO_0000102"/>
    </rdf:Description>
    


</rdf:RDF>

@cthoyt
Copy link

cthoyt commented Sep 30, 2022

Bump on this, I just had the same issue again I reported in ontodev/robot#1055

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

2 participants