Skip to Content

Converting discussion into text

  • Origin: Calculated attribute

In order to convert all the comments in the discussions tab of an item to a separate text field (for instance, to use for export), enter the following expression:

 

@prefix cmw: <http://comindware.com/logics#>.

@prefix comment: <http://comindware.com/ontology/comment#>.

@prefix sort: <http://comindware.com/ontology/dataset/sort#>.

@prefix string: <http://www.w3.org/2000/10/swap/string#>.

 

{

  from

  {

    ?item comment:commentsTopTreeWithChildren ?comment.

    ?comment comment:date ?date.

    ?comment comment:authorName ?authorName.

    ?comment comment:value ?commentValue.

    ("Date: {0} Author: {1} Text: {2}\r\n" ?date ?authorName ?commentValue) string:format ?commentText.

  } select ?commentText -> ?commentsTexts.

  ?commentsTexts string:concatenation ?value.

}