Ignorance is not a defence in law.
It is, sometimes. Trespassing for example. A lot of laws say "willingly" or "with the intent to"