PathwayCommons / chibe

Pathway visualization and analysis tool for Pathway Commons and other BioPAX data
Eclipse Public License 1.0
13 stars 10 forks source link

Saving should ensure .owl extension #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When saving a model, if user enters some name not ending with .owl, ChiBE does 
not handle it and uses whatever name is given. 

ChiBE shouldn't save files without .owl extension. If the user ended the file 
name differently, then it should add .owl to the end of the file name.

Original issue reported on code.google.com by ozgunba...@gmail.com on 30 Sep 2012 at 7:24

GoogleCodeExporter commented 9 years ago
If a valid file extension other than .owl is written, it is now replaced with 
.owl.

Original comment by mervecak...@gmail.com on 2 Oct 2012 at 2:32

GoogleCodeExporter commented 9 years ago
But now it removes the part of the filename after the dot. It should not remove 
anything from filename, but just add .owl if it does not end with it. For 
instance If I want to set the filename to "AR.TP53.Path", I can't because ChiBE 
converts it to AR.TP53.owl. It should be converted to AR.TP53.Path.owl

Original comment by ozgunba...@gmail.com on 2 Oct 2012 at 5:13

GoogleCodeExporter commented 9 years ago
I can save it as AR.TP53.Path.owl, it does not remove .Path part. What I have 
observed is that if the written name does not end with a valid file extension, 
FileChooser adds .owl to the end of the file name. Therefore, no part is 
removed from the name. If a valid extension is given - like .xml - then we 
replace it with .owl. This may be associated with Windows though.
I was replacing the extension because I thought a name like TP53.xml.owl could 
be confusing. 

Original comment by mervecak...@gmail.com on 3 Oct 2012 at 1:48

GoogleCodeExporter commented 9 years ago
When you give "AR.TP53.Path" as the filename (without .owl extension), is it 
converted to "AR.TP53.Path.owl" in your system? It is converted to 
"AR.TP53.owl" in my computer.

Original comment by ozgunba...@gmail.com on 3 Oct 2012 at 4:54

GoogleCodeExporter commented 9 years ago
Yes, when I simply write "AR.TP53.Path" in file name text field, the model is 
saved as "AR.TP53.Path.owl". I'm using Windows 7.

Original comment by mervecak...@gmail.com on 4 Oct 2012 at 10:04

GoogleCodeExporter commented 9 years ago
This is really weird. When I check the code (below), I see that it has to erase 
.Path from the name. Maybe windows is too smart and auto-adding the extension.

                // Ensure that file extension is .owl
                if (!fileName.endsWith(".owl"))
                {
                    fileName = fileName.substring(0, fileName.lastIndexOf("."));
                    fileName += ".owl";
                }

Anyway, I commented out the fourth line, and it works in Linux.

Changing graph.xml to graph.xml.owl is fine. We cannot know if the last portion 
after dot is a misplaced extension or part of the name.

Can you please check if it still works in windows?

Original comment by ozgunba...@gmail.com on 4 Oct 2012 at 10:24

GoogleCodeExporter commented 9 years ago
No problem in Windows.

Original comment by mervecak...@gmail.com on 8 Oct 2012 at 9:12