rdmenezes / ontowiz

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

Onto-Perl discards "0" in "set(..)" functions.Problem when rebuilding Onto-Perl object using Onto-Perl routines #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Insert "my $acc="0"" in OBO/Core/Dbxref.pm
2. Validate that ({dbxref-object}->acc() eq "0")
3. Observe the error: Replace "if $_[1]) {}" with "if(length($_[1])) {...}".

Steps taken
The problem was discovered when trying to rebuild the OntoPerl objects during 
OntoWiz validation. Currently the "sub acc {...}" function is given the 
modification stated, but probably several functions might need similar 
refreshments.

Programmatically speaking, an argument is empty when it is not given any value. 
At most circumstances the above if-sentence performs correct. The problem comes 
when "$_[1] = "0"", as the return-value of the test is "false", while, thereby
ignoring all values having "0" as a string. This issue may be solved
rewriting test into "if(length($_[1])) {...}".

Original issue reported on code.google.com by oeks...@gmail.com on 28 Feb 2013 at 12:48

GoogleCodeExporter commented 9 years ago
Hi Ole,

thanks for your input.
vlmir

Original comment by vladimir.n.mironov@gmail.com on 1 Mar 2013 at 6:41