Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpret on conversion process overrides interpret on enhancement #386

Open
ewpatton opened this issue Apr 7, 2014 · 1 comment
Open

Comments

@ewpatton
Copy link

ewpatton commented Apr 7, 2014

In an enhancement parameters file I have the "" => null interpretation on the conversion process:

      conversion:interpret [
         conversion:symbol        "";
         conversion:interpretation conversion:null;
      ];

and on a specific column I have an interpret statement that maps "" => 0:

      conversion:enhance [
         ov:csvCol          24;
         ov:csvHeader       "m_steps";
         conversion:label   "m_steps";
         conversion:equivalent_property fitness:steps;
         conversion:comment "";
         conversion:range   xsd:integer;
         conversion:interpret [
            conversion:symbol "";
            conversion:interpretation 0;
         ];
      ];

When I query the endpoint, I do not see any 0 values when the global interpretation is enabled. If I comment out the interpretation, then I see 0 values as I expected. This may be user error, but I would expect that something specific to the enhancement should override a default value defined for all enhancements.

This experience is based on commit af7910f.

@timrdf timrdf added this to the Direct user request milestone Apr 7, 2014
@timrdf
Copy link
Owner

timrdf commented Apr 7, 2014

The relevant portion of code is:

if( (interpretAsNullStrings.contains((record.getValue(c-1))) || // The original cell value (before conv:delimit_object is applied)
     interpretAsNullStrings.contains(value))                    // The delimited sub-value (because of conv:delimits_object)
    &&             
     valueHandlers.get(c).interpretsAsNull(value) ) {           // Column-specific 
   logger.finest("r " + rowNum + " c "+c+" skipping b/c " + 
                 "(cell value global as-null: " + interpretAsNullStrings.contains((record.getValue(c-1))) + " or "+
                  "sub-value global as-null: "  + interpretAsNullStrings.contains(value) + ") and " +
                  "col-specific as-null: "      + valueHandlers.get(c).interpretsAsNull(value));
   // TODO: column should be the authoritative source of this decision (and should include global in its decision). 
   continue;      
}  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants