spechub / Hets

The Heterogeneous Tool Set
http://hets.eu
GNU General Public License v2.0
57 stars 19 forks source link

OWL parse error: Prefix not registered for prefix name: oboInOwl: #1618

Open mcodescu opened 8 years ago

mcodescu commented 8 years ago

With the ontology https://ontohub.org/bioportal_mappings/BDO.owl, I save the theory of the node BDO_http%3A%2F%2Fpurl.org%2Fskeletome%2Fbonedysplasia as an owl file, with a random URL for the name of the ontology and the empty prefix. When I try to analyze the resulting file again, the parser complains about the prefix oboInOwl:

*** Error:
process stop! ExitSuccess
OWL parse error: Prefix not registered for prefix name: oboInOwl:
java.lang.RuntimeException: Prefix not registered for prefix name: oboInOwl:
    at org.semanticweb.owlapi.util.DefaultPrefixManager.getIRI(DefaultPrefixManager.java:240)
    at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.getIRI(ManchesterOWLSyntaxEditorParser.java:974)
    at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser$DefaultEntityChecker.getOWLClass(ManchesterOWLSyntaxEditorParser.java:2844)
    at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.getOWLClass(ManchesterOWLSyntaxEditorParser.java:392)
    at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseClassFrame(ManchesterOWLSyntaxEditorParser.java:1333)
    at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseClassFrame(ManchesterOWLSyntaxEditorParser.java:1318)
    at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser.parseOntology(ManchesterOWLSyntaxEditorParser.java:2254)
    at org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxOntologyParser.parse(ManchesterOWLSyntaxOntologyParser.java:130)
    at uk.ac.manchester.cs.owl.owlapi.ParsableOWLOntologyFactory.loadOWLOntology(ParsableOWLOntologyFactory.java:212)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:866)
    at uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntologyFromOntologyDocument(OWLOntologyManagerImpl.java:814)
    at OWL2Parser.main(OWL2Parser.java:60)

The prefix appears in the ontology, e.g. in Class: oboInOwl:Definition but not in the prefix declarations part of the ontology.

mcodescu commented 8 years ago

Now I notice that the prefix is declared in the ontologies imported by bonedysplasia.

mcodescu commented 8 years ago

The imported ontology http://purl.org/obo/owl/PATO.owl seems to have been converted from OBO to RDF/XML, and it contains: <!--oboInOwl meta-model - we must declare this here, otherwise the ontology will be OWL-Full unless we import http://www.geneontology.org/formats/oboInOwl#-->

mcodescu commented 8 years ago

https://ontohub.org/sandbox/testGenIndividuals.owl is a minimal file for the problem of generated anonymous individuals. With hets: v0.99, 1458196355, I get

logic OWL.RL-ALC

Prefix: : <http://purl.org/obo/owl/>
Prefix: oban: <http://purl.org/obo/oban/>
Prefix: obo: <http://purl.org/obo/owl/obo#>
Prefix: oboContent: <http://purl.org/obo/owl/>
Prefix: oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
Prefix: owl: <http://www.w3.org/2002/07/owl#>
Prefix: owl11: <http://www.w3.org/2006/12/owl11#onClass>
Prefix: owl2: <http://www.w3.org/2006/12/owl2#onClass>
Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>

Class: oboInOwl:DbXref
Class: oboInOwl:Definition
AnnotationProperty: oboInOwl:hasDbXref
AnnotationProperty: oboInOwl:hasDefinition
AnnotationProperty: oboInOwl:hasOBONamespace
AnnotationProperty: oboInOwl:hasURI
AnnotationProperty: label
Individual: _:genid1
            Annotations: oboInOwl:hasDbXref _:genid2
Individual: _:genid1
            Annotations: label
                         "An inability to completely empty the `urinary bladder` (FMA:15900) during the process of `urination` (GO:0060073) owing to a neurological condition."@en
Individual: _:genid2
            Annotations: oboInOwl:hasURI
                         "http://purl.org/obo/owl/HPO#HPO_probinson"^^xsd:anyURI
Individual: _:genid2
            Annotations: label "HPO:probinson"
Individual: _:genid3
            Annotations: oboInOwl:hasURI
                         "http://purl.org/obo/owl/UMLS#UMLS_C0005697"^^xsd:anyURI
Individual: _:genid3
            Annotations: label "UMLS:C0005697"
Class: HP#HP_0000002
       Annotations: oboInOwl:hasOBONamespace "human_phenotype"
       Annotations: label "Abnormality of body height"@en
Class: HP#HP_0000011
       Annotations: oboInOwl:hasDbXref _:genid3
       Annotations: oboInOwl:hasDefinition _:genid1
       Annotations: oboInOwl:hasOBONamespace "human_phenotype"
       Annotations: label "Neurogenic bladder"@en
Individual: _:genid1
            Types: oboInOwl:Definition
Individual: _:genid2
            Types: oboInOwl:DbXref
Individual: _:genid3
            Types: oboInOwl:DbXref
mcodescu commented 8 years ago

Opening the file in Protege and saving it in Manchester syntax has a similar result:

Prefix: : <http://purl.org/obo/owl/>
Prefix: oban: <http://purl.org/obo/oban/>
Prefix: obo: <http://purl.org/obo/owl/obo#>
Prefix: oboContent: <http://purl.org/obo/owl/>
Prefix: oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
Prefix: owl11: <http://www.w3.org/2006/12/owl11#onClass>
Prefix: owl2: <http://www.w3.org/2006/12/owl2#onClass>
Prefix: owl: <http://www.w3.org/2002/07/owl#>
Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Prefix: xml: <http://www.w3.org/XML/1998/namespace>
Prefix: xsd: <http://www.w3.org/2001/XMLSchema#>

Ontology: <http://www.semanticweb.org/test/ontologies/2016/3/untitled-ontology-24>

AnnotationProperty: oboInOwl:hasDbXref

AnnotationProperty: oboInOwl:hasDefinition

AnnotationProperty: oboInOwl:hasOBONamespace

AnnotationProperty: oboInOwl:hasURI

AnnotationProperty: rdfs:label

Datatype: rdf:PlainLiteral

Datatype: xsd:anyURI

Class: <http://purl.org/obo/owl/HP#HP_0000002>

    Annotations: 
        oboInOwl:hasOBONamespace "human_phenotype",
        rdfs:label "Abnormality of body height"@en

Class: <http://purl.org/obo/owl/HP#HP_0000011>

    Annotations: 
        oboInOwl:hasDbXref _:genid6,
        oboInOwl:hasOBONamespace "human_phenotype",
        oboInOwl:hasDefinition _:genid2,
        rdfs:label "Neurogenic bladder"@en

Class: oboInOwl:DbXref

    Individuals: 
        _:genid4,
        _:genid6

Class: oboInOwl:Definition

    Individuals: 
        _:genid2

Individual: _:genid1

    Annotations: 
        oboInOwl:hasDbXref _:genid4

Individual: _:genid2

    Annotations: 
        rdfs:label "An inability to completely empty the `urinary bladder` (FMA:15900) during the process of `urination` (GO:0060073) owing to a neurological condition."@en

    Types: 
        oboInOwl:Definition

Individual: _:genid4

    Annotations: 
        rdfs:label "HPO:probinson",
        oboInOwl:hasURI "http://purl.org/obo/owl/HPO#HPO_probinson"^^xsd:anyURI

    Types: 
        oboInOwl:DbXref

Individual: _:genid6

    Annotations: 
        rdfs:label "UMLS:C0005697",
        oboInOwl:hasURI "http://purl.org/obo/owl/UMLS#UMLS_C0005697"^^xsd:anyURI

    Types: 
        oboInOwl:DbXref