The Definition of Legal Relations in a BDI Multiagent Framework