From: Jennifer L. V. <ven...@st...> - 2017-04-06 21:14:46
|
On Apr 6, 2017, at 9:35 AM, Ignazio Palmisano <ipa...@gm...<mailto:ipa...@gm...>> wrote: On 6 Apr 2017 15:47, "Jennifer Leigh Vendetti" <ven...@st...<mailto:ven...@st...>> wrote: On Apr 5, 2017, at 11:09 PM, Ignazio Palmisano <ipa...@gm...<mailto:ipa...@gm...>> wrote: On 6 Apr 2017 01:43, "Jennifer Leigh Vendetti" <ven...@st...<mailto:ven...@st...>> wrote: On Apr 5, 2017, at 12:39 PM, Ignazio Palmisano <ipa...@gm...<mailto:ipa...@gm...>> wrote: Interestingly, if I load the ontology with later versions of the OWL API (I tried 4.2.8 and 4.3.1), it parses successfully. More interesting: I'm trying with the version4 branch and parsing is failing. One thing I noticed (using 4.3.1) is that specifying a document format reliably results in parsing exceptions, i.e.: String path = "src/test/resources/HIVOntology2.7.obo"; FileDocumentSource fileDocumentSource = new FileDocumentSource(new File(path), new OBODocumentFormat()); OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); OWLOntology ontology = manager.loadOntologyFromOntologyDocument(fileDocumentSource); … will show the "Could not find tag for: part_of” exception. However, the original code snippet I sent that doesn’t specify the document format will pass parsing with no exceptions: It means there's a parser not throwing exceptions. Can you check what the format associated to the ontology is after loading? manager.getOntologyFormat(ontology) reports: OBO 1.2 Format J. Kind of explains it - 1.2 is the compatibility format, in the compatibility module. Check the exact class name - I believe it's slightly different. The exact class name is OBO12DocumentFormat. If so, ensuring the compatibility module is in your 4.2.5 classpath should allow you to parse without errors. I'm not sure it will actually parse the data contained, though. It might just be hiding the exception. Yes, I can confirm that. After adding the compatibility module it parses w/out errors. Thanks for the help Ignazio. Best, Jennifer |