porting r2rml query translator functions to Scala