Nationalism clearly caused Americans to object to having their ships torpedoed and to foreign powers (Germany) going around making offers of US territory to Mexico.
The others didn't really figure much. Americans weren't paricularly militaristic, they's had an imperialist binge in 1898 but it had pretty much blown over by 1917, and the US had no alliances with Britain or anyone else. As for ancestry, it was the Irish and German Americans who were most influenced by this, and with them its influence was against entering the war.
However, to answer the broader question "how did those things cause world war 1?" European imperialism lead to the competition between Britain and the Germans and set the stage for an all out conflict.
Alliances were a more direct cause, because when an ally of Germany attacked an ally of another power, they were driven to confront each other. Britain (like the US) had no alliances at this time, but could not ignore a European conflict which might lead to one power dominating the continent - an intolerable situation
The afore mentioned competition between those two European powers also caused a build up of military forces (especially naval) which intesified the tensions between the two contries, and was a major factor in fueling the war.