linikujp / owltools

Automatically exported from code.google.com/p/owltools
0 stars 0 forks source link

OWLGraphWrapper getAllUsedSubsets method does not work? #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
OWLOntology uberon = 
manager.loadOntology(IRI.create("http://obo.svn.sourceforge.net/viewvc/obo/ubero
n/trunk/composite-metazoan-basic.obo"));
OWLGraphWrapper graph = new OWLGraphWrapper(uberon);
System.out.println(graph.getAllUsedSubsets().size());
System.out.println(graph.getOWLClassesInSubset("uberon_slim").size());

What is the expected output? What do you see instead?
I expect to obtain the number of subsets in Uberon for the first print, I 
obtain 0.
I expect to obtain the number of classes in the subset "uberon_slim" for the 
second print, but obtain 0.

What version of the product are you using? On what operating system?
0.4.0 20121220
Mac 10.7.5

Please provide any additional information below.
I hope that it is an actual bug, and that I am not just an idiot misusing this 
code :p

Original issue reported on code.google.com by TheITGuy...@gmail.com on 18 Jan 2013 at 3:14

GoogleCodeExporter commented 9 years ago
Hello,
thank you for reporting the issue. You have stumbled over the difference 
between the OWL-API parser and the recommended oboformat.org parser. It seems 
the parser and conversion to OWL in the OWL-API does not implement subsets.

While using the OWLGraphWrapper, we strongly recommend to use the 
org.obolibrary.oboformat.parser.OBOFormatParser to directly load the OBO file 
and convert it using obo2owl.

Even better, we have a wrapper which can load OWL and OBO using the intended 
parser: owltools.io.ParserWrapper

For you it would read:
ParserWrapper parserWrapper = new ParserWrapper();
String iriString = 
"http://obo.svn.sourceforge.net/viewvc/obo/uberon/trunk/composite-metazoan-basic
.obo";
OWLGraphWrapper graph = parserWrapper.parseToOWLGraph(iriString);

This will give you the intended non zero counts for subsets.

I hope this helps.

Original comment by HDie...@lbl.gov on 18 Jan 2013 at 6:35

GoogleCodeExporter commented 9 years ago
This works fine, thank you.

Original comment by TheITGuy...@gmail.com on 19 Jan 2013 at 1:13

GoogleCodeExporter commented 9 years ago

Original comment by HDie...@lbl.gov on 7 Feb 2013 at 5:51