I am having some trouble discerning appositives from their nouns in apposition.
Consider an example from the Wikipedia article on appositives, "My friend Alice Smith likes jelly beans." "My friend" is the subject, while "Alice Smith" is a restrictive appositive.
Then consider "I visited Canada, a beautiful country." Here, "Canada" is an object, while "a beautiful country" is a non-restrictive appositive, according to the article. Why isn't "a beautiful country" the object and "Canada" a restrictive appositive, since it narrows the scope down from "a beautiful country" to a particular beautiful country?
The criteria can't be that the noun in apposition is always placed before the appositive in a sentence, as the article specifies that the appositive appears first in the sentence, "The first to arrive at the house, she unlocked the front door." This example also restricts us from saying that the appositive is always closer to the predicate.
So what is the correct criteria used to appropriately discern the appositive [phrase] from its noun [phrase] in apposition?