Generating values for empty attributes

那年仲夏 提交于 2019-12-23 16:01:54

问题


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".


回答1:


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



来源:https://stackoverflow.com/questions/19723721/generating-values-for-empty-attributes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!