protected WonMessage createWonMessage(WonNodeInformationService wonNodeInformationService,
URI needURI,
URI wonNodeURI,
Dataset needDataset,
final boolean usedForTesting,
final boolean doNotMatch ) throws WonMessageBuilderException {
NeedModelWrapper needModelWrapper = new NeedModelWrapper(needDataset);
if (doNotMatch){
needModelWrapper.addFlag(WON.NO_HINT_FOR_ME);
needModelWrapper.addFlag(WON.NO_HINT_FOR_COUNTERPART);
}
if (usedForTesting){
needModelWrapper.addFlag( WON.USED_FOR_TESTING);
}
RdfUtils.replaceBaseURI(needDataset, needURI.toString());
return WonMessageBuilder.setMessagePropertiesForCreate(
wonNodeInformationService.generateEventURI(wonNodeURI),
needURI,
wonNodeURI).addContent(needModelWrapper.copyDataset()).build();
}