Python Create Json Array Javascript Append Function In Prolog