SMS2 with CSV no BIND(IF....)?

We've been experimenting with CSV import using SMS2 mapping as an alternative to TARQL ( .

We've found however that SMS2 mappings don't seem to support BIND(IF...) expressions which makes mapping based on a decision using the column value impossible.

mapping "special" values to a particular value/URI
BIND(IF( ?employmentType=1, "FULL TIME" , "PART TIME") as ?jobString),

Any plans on supporting IF in BIND?

(Apart from this issue it does appear that it could be a viable alternative to TARQL)


This is a supported expression. What problem are you seeing?

We're finding that anywhere where we've used BIND(IF... the target variable is never resolved (ie missing from the CONSTRUCT output).

BIND (IF(?CASUAL = "0" && ?FULLTIME = "0",?noemployment,
			IF(?CASUAL = "1", URI(CONCAT('')),
			URI(CONCAT('http:/')))) as ?emptype)

?emptype is never resolved.
(Even tried changing the test to = 0 in case it was converting the text value to a number)
All other BINDs are resolving as expected.

example of CSV


Thanks for the details. We'll take a look.

Where is ?noemployment declared? Does it work if you replace that with a constant value?

?noemployment is not declared so should not be resolved (ie the triple that uses that variable in the CONSTRUCT
eg vars:employmentType ?emptype;
would not be created).
So, in the example we don't want ?emptype to resolve if both CASUAL & FULLTIME values are both 0.

Thanks. I've reproduced the issue. As a workaround, you can BIND something which creates an error, eg BIND(integer("X") as ?noemployment). We'll get this fixed shortly.

Thanks - will give that a try.

That works thanks Jess. We will use that for now :+1:

Glad it's working. Thanks again for reporting it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.