The European Court of Human Rights on Tuesday ruled that Turkey had violated conventions on freedom of expression when it blocked access to YouTube for more than two years until late 2010.