first commit, function creates a text-file from a given set of triples in a database in reasonable speed