简体   繁体   中英

org.semanticweb.owl.io.UnparsableOntologyException

I created the owl file with Protégé 5.0 .. But I got this error when I load in java code .. May I know if you have any idea for this.

Thanks & Regards, Su

org.semanticweb.owl.io.UnparsableOntologyException: Problem parsing file:/C:/.../owls/PCOCPG.owl Could not parse ontology. Either a suitable parser could not be found, or parsing failed. See parser logs below for explanation. The following parsers were tried: 1) RDFXMLParser 2) OWLXMLParser 3) OWLFunctionalSyntaxOWLParser 4) TurtleOntologyParser 5) OWLOBOParser 6) KRSS2OWLParser 7) ManchesterOWLSyntaxOntologyParser

Detailed logs:
--------------------------------------------------------------------------------
Parser: RDFXMLParser
edu.unika.aifb.rdf.api.syntax.RDFParserException: [line=18:column=72] Expecting rdf:RDF element.

--------------------------------------------------------------------------------
Parser: OWLXMLParser
(Current element Prefix

--------------------------------------------------------------------------------
Parser: OWLFunctionalSyntaxOWLParser
org.coode.owl.functionalparser.ParseException: Encountered "<" at line 1, column 1.
Was expecting one of:
    "Ontology" ...
    "Namespace" ...
     (Line 0)

--------------------------------------------------------------------------------
Parser: TurtleOntologyParser
java.net.URISyntaxException: Illegal character in query at index 4: ?xml version="1.0"?

--------------------------------------------------------------------------------
Parser: OWLOBOParser
org.coode.obo.parser.ParseException: Encountered "<!DOCTYPE Ontology " at line 4, column 1.
Was expecting:
    "\n" ...


--------------------------------------------------------------------------------
Parser: KRSS2OWLParser
de.uulm.ecs.ai.owl.krssparser.ParseException: Encountered "<?xml version=\"1.0\"?>" at line 1, column 1.
Was expecting one of:
    <EOF> 
    "(" ...
    "end-tbox" ...
    "end-abox" ...


--------------------------------------------------------------------------------
Parser: ManchesterOWLSyntaxOntologyParser
org.coode.manchesterowlsyntax.ManchesterOWLSyntaxParserException: Expected 'Ontology:' <URI>


    at uk.ac.manchester.cs.owl.ParsableOWLOntologyFactory.loadOWLOntology(ParsableOWLOntologyFactory.java:191)
    at uk.ac.manchester.cs.owl.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:461)
    at uk.ac.manchester.cs.owl.OWLOntologyManagerImpl.loadOntologyFromPhysicalURI(OWLOntologyManagerImpl.java:430)
    at org.bootstrep.onthology.pcocpg.PCOCPGOntology.readOntology(PCOCPGOntology.java:144)
    at org.bootstrep.eventextract.lingpattern.util.ReadConditionPattern.main(ReadConditionPattern.java:451)

The first parser error is the one that refers to your case.

Detailed logs:

Parser: RDFXMLParser edu.unika.aifb.rdf.api.syntax.RDFParserException: [line=18:column=72] Expecting rdf:RDF element.

Can you share the ontology being parsed? It appears to have a problem around line 18.

At first I save the owl file with OWL/XML format and I got that Error.

Now I changed it to save with RDF/XML .., it's work ..

Thank You all . ^_^

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM