write patterns to output along with sentence and relationship instance