Implement JSON/SHAPED and SHAPED/JSON comparison by conversion.