为CONCAT使用自动分隔符?

时间:2017-10-26 00:41:37

标签: sparql rdf concat

我的查询是这样开始的:

SELECT
      #MIN(?dateYear) AS     ?dateYears)
      (GROUP_CONCAT(DISTINCT     ?dateYear ; separator = ", ") AS     ?dateYears)
      (CONCAT(GROUP_CONCAT(DISTINCT ?gameENLabel; separator = ", ") ,", ", GROUP_CONCAT(DISTINCT ?gameJALabel; separator = ", "), ", ", GROUP_CONCAT(DISTINCT ?hepburnLabel; separator = ", "), ", ", GROUP_CONCAT(DISTINCT ?gameZHLabel; separator = ", "), ", ", GROUP_CONCAT(DISTINCT ?pinyinLabel; separator = ", ")) as ?wookie)
      (GROUP_CONCAT(DISTINCT     ?dataLink ; separator = ", ") AS     ?dataLinks)
      #(?game AS ?dataPages)
      (GROUP_CONCAT(DISTINCT     ?wikiLink ; separator = ", ") AS     ?wikiLinks)
      (GROUP_CONCAT(DISTINCT     ?wikiName ; separator = ", ") AS     ?wikiNames)

      WHERE {
          ...
      }

它可以工作,但是当GROUP_CONCAT(DISTINCT ?gameJALabel; separator = ", ")返回一个空弹簧时,紧接着它的逗号仍会被渲染。是否可以为CONCAT命令提供一个仅在前面的命令返回某些内容时才会呈现的分隔符?是否有更好的方法来完成我不了解的所有这些?谢谢!

0 个答案:

没有答案