Are ores minerals or rocks?


The internet defines an ore as a rock with a high concentration of a certain mineral. However my textbook defines it as a mineral from which elements can be obtained.

Also the internet says hematite is a mineral and an ore, but bauxite is a ore and a rock (not a mineral).

so, what is an ore, a rock or a mineral?