Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating values for empty attributes

I am trying to fill the empty spaces generated by the use of Optional in the SPARQL query language. Are there any ways that I can achieve this?

The use of !bound on the optional variable generates true or false, but I want to fill the cells with my own values such as "?" or "unknown".

like image 815
honour nwagwu Avatar asked Nov 01 '13 09:11

honour nwagwu


1 Answers

Perhaps you could use one of the following constructs...

COALESCE(?c, "unknown")

Source: http://www.w3.org/TR/sparql11-query/#func-coalesce

or

IF(bound(?c), ?c, "unknown")

Source: http://www.w3.org/TR/sparql11-query/#func-if

like image 122
w5m Avatar answered Oct 04 '22 12:10

w5m