"my wife Rania"
1st - we can differentiate both from the context. But, it would not be much helpful in Duolingo.
2nd - in Duolingo, there is no "." (full stop/period) sign for the phrase at the end of a statement while there is "." (full stop/period) at end of a statement if it is a sentence. At the statement above, we can see that there is no "." (full stop/period). So, it is surely a phrase.
3rd - we can put هي in the middle of the sentence to distinguish: زوجتي (هي) رانيا "my wife is Rania" from زوجي رانيا "my wife Rania".